Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile Rcpp based packages #17

Closed
giantwhale opened this issue Nov 3, 2016 · 4 comments
Closed

Failed to compile Rcpp based packages #17

giantwhale opened this issue Nov 3, 2016 · 4 comments

Comments

@giantwhale
Copy link

giantwhale commented Nov 3, 2016

I couldn't compile Rcpp-based package RcppBDT on two of my PCs, one uses CentOS and the other uses Ubuntu. The errors are the same. (I can compile some other Rcpp-based packages though)

Here's the link to the original post: eddelbuettel/rcppbdt#3

The problem is weird. R is supposed to compile c++ source scripts with something like

g++ -I/usr/lib64/microsoft-r/3.3/include ...

However, it removed the first part of the above command and run the following instead

I/user/lib64/microsoft-r/3.3/include ...

Then I got a No File Found error, because there's no file named I/user/lib64/microsoft-r/3.3/include

@nathansoz
Copy link
Contributor

nathansoz commented Nov 4, 2016

This is related to #11 and is a side effect of how we compile microsoft-r-open. A temporary workaround is to download the package source and edit: src/Makevars

Remove:

CXX_STD = CXX11

And then edit the PKG_CPPFLAGS line to looks like this:

PKG_CPPFLAGS = -I../inst/include/ -std=c++11

@eddelbuettel
Copy link

eddelbuettel commented Nov 4, 2016

@nathansoz The strategy if jumping away from the default compiler which R used may lead to a number of similar build surprises. It may be a lot easier to stick with compilers R picked...

@nathansoz
Copy link
Contributor

nathansoz commented Nov 7, 2016

As far as I know, there is no "default compiler" for R on Linux (whereas I know there is a specified toolchain for Windows that we use). Can you point me to documentation that specifies a default compiler for R on Linux? I'd be happy to consider it in the 3.3.3 release if this is the case.

We are for sure going to upgrade to a compiler that has c++11 support in that release, but we are trying to also balance backwards compatibility concerns as we release a single binary for all platforms.

Edit: I went into more detail in #11 where I also replied. Let's continue that discussion there. I'll close this issue for now as this and #11 have the same root cause.

@eddelbuettel
Copy link

there is no "default compiler" for R on Linux

You have the question backwards:

tar xfz R_*tar.gz  # some release
configure       # lots of options
make
make install

will work with just about any compiler version -- that is what configure.

BUT that compiler version and its capabilities are then encoded.

You play a risky game by messing. You can, however, override with a suitable set of arguments in the system Makeconf or a level above (via env.vars). It is doable, but a ton of things may break and you get to pick up the pieces. Just test this real well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants