Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix building with custom CXXFLAGS and LDFLAGS #15
Conversation
added 4 commits
Jul 19, 2016
* The CXXFLAGS variable was previously clobbered by a call to `R CMD config CXXFLAGS`. This commit fixes the issue by assigning the output of the call to a temporary variable and appending this temporary variable to the original CXXFLAGS * The LDFLAGS variable is now used when setting PKG_LIBS
| @@ -4202,7 +4202,8 @@ fi | |||
| if test -z "${R_HOME}"; then | |||
| as_fn_error $? "Could not determine R_HOME." "$LINENO" 5 | |||
| fi | |||
| CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS` | |||
| R_CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS` | |||
| CXXFLAGS="${CXXFLAGS} ${R_CXXFLAGS}" | |||
eddelbuettel
Jul 19, 2016
•
Owner
That's a good catch.
(Comment belongs to configure.in, of course.)
That's a good catch.
(Comment belongs to configure.in, of course.)
configure
Outdated
| @@ -4263,7 +4264,7 @@ fi | |||
| ## now use all these | |||
| PKG_CPPFLAGS="${PKG_CPPFLAGS} ${CXXFLAGS} $protobuf_cxxflags" | |||
|
|
|||
| PKG_LIBS="${PKG_LIBS} $rcpp_ldflags $protobuf_libs" | |||
| PKG_LIBS="${PKG_LIBS} ${LDFLAGS} $rcpp_ldflags $protobuf_libs" | |||
eddelbuettel
Jul 19, 2016
•
Owner
Doesn't that come in from R? May not do harm here, but might get added twice?
(Comment belongs to configure.in, of course.)
Doesn't that come in from R? May not do harm here, but might get added twice?
(Comment belongs to configure.in, of course.)
chradcliffe
Jul 19, 2016
Author
Contributor
You're right. I removed the LDFLAGS inclusion from my working copy and it looks as if src/Makevars is populated with the LDFLAGS variable correctly. I've pushed an update that removes the LDFLAGS so that there's no duplication.
You're right. I removed the LDFLAGS inclusion from my working copy and it looks as if src/Makevars is populated with the LDFLAGS variable correctly. I've pushed an update that removes the LDFLAGS so that there's no duplication.
|
Thanks. Looks like a nicely minimal patch. All this is of course fallback mode because under normal circumstances |
rcpp_ldflags already contains the environment's LDFLAGS so adding it again to PKG_LIB isn't necessary.
77dd9d7
into
eddelbuettel:master
1 check passed
1 check passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
I tried to build rprotobuf with a protobuf library install that was in a custom location (so that I had to set
CXXFLAGSandLDFLAGS), but I ran into an issue where the environment variables were picked up by the configure script, but at build time the paths were not set properly. I noticed two issues:CXXFLAGSvariable is clobbered in the configure script late in the build process so that the value written to src/Makevars does not preserve theCXXFLAGSas set in the environment at configure time.LDFLAGSvariable is omitted when settingPKG_LIBin configure.in, which means thatLDFLAGSsimilarly doesn't propagate to src/MakevarsAfter fixing these issues, I was able to successfully build with a custom libprotobuf location.