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 on Linux #3

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

Failed to compile on Linux #3

giantwhale opened this issue Nov 2, 2016 · 3 comments

Comments

@giantwhale
Copy link

giantwhale commented Nov 2, 2016

I am not familiar with the R build system. When I tried to install this package either through install.packages or R CMD INSTALL, I got the following message:

* installing to library ‘/myownpath/R/xxx-main/build’
* installing *source* package ‘RcppBDT’ ...
** libs
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/myownpath/R/xxx-main/build/Rcpp/include" -I"/myownpath/R/xxx-main/build/BH/include"      -c RcppBDTdd.cpp -o RcppBDTdd.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
make: [RcppBDTdd.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/myownpath/R/xxx-main/build/Rcpp/include" -I"/myownpath/R/xxx-main/build/BH/include"      -c RcppBDTdt.cpp -o RcppBDTdt.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
make: [RcppBDTdt.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/myownpath/R/xxx-main/build/Rcpp/include" -I"/myownpath/R/xxx-main/build/BH/include"      -c RcppBDTdu.cpp -o RcppBDTdu.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
make: [RcppBDTdu.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/myownpath/R/xxx-main/build/Rcpp/include" -I"/myownpath/R/xxx-main/build/BH/include"      -c RcppBDTpt.cpp -o RcppBDTpt.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
make: [RcppBDTpt.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/myownpath/R/xxx-main/build/Rcpp/include" -I"/myownpath/R/xxx-main/build/BH/include"      -c RcppBDTtz.cpp -o RcppBDTtz.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
make: [RcppBDTtz.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/myownpath/R/xxx-main/build/Rcpp/include" -I"/myownpath/R/xxx-main/build/BH/include"      -c RcppExports.cpp -o RcppExports.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
make: [RcppExports.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/myownpath/R/xxx-main/build/Rcpp/include" -I"/myownpath/R/xxx-main/build/BH/include"      -c toPOSIXct.cpp -o toPOSIXct.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
make: [toPOSIXct.o] Error 127 (ignored)
-shared -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -o RcppBDT.so RcppBDTdd.o RcppBDTdt.o RcppBDTdu.o RcppBDTpt.o RcppBDTtz.o RcppExports.o toPOSIXct.o -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -lR
sh: line 2: -shared: command not found
make: *** [RcppBDT.so] Error 127
ERROR: compilation failed for package ‘RcppBDT’
* removing ‘/myownpath/R/xxx-main/build/RcppBDT’

Instead of compiling cpp sources through:

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

it used the wrong command with g++ - missing:

I/usr/lib64/microsoft-r/3.3/lib64/R/include

I tried to install Rcpp and it succeeded. Do you know what's going on here?


My temporary workaround is to cd into the src directory and manually compile all cpp files by:

g++ -fPIC -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/xxx/build/Rcpp/include" -I"/xxx/build/BH/include"      -c RcppBDTdd.cpp -o RcppBDTdd.o
g++ -fPIC -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/xxx/build/Rcpp/include" -I"/xxx/build/BH/include"      -c RcppBDTdt.cpp -o RcppBDTdt.o
g++ -fPIC -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/xxx/build/Rcpp/include" -I"/xxx/build/BH/include"      -c RcppBDTdu.cpp -o RcppBDTdu.o
g++ -fPIC -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/xxx/build/Rcpp/include" -I"/xxx/build/BH/include"      -c RcppBDTpt.cpp -o RcppBDTpt.o
g++ -fPIC -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/xxx/build/Rcpp/include" -I"/xxx/build/BH/include"      -c RcppBDTtz.cpp -o RcppBDTtz.o
g++ -fPIC -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/xxx/build/Rcpp/include" -I"/xxx/build/BH/include"      -c RcppExports.cpp -o RcppExports.o
g++ -fPIC -I/usr/lib64/microsoft-r/3.3/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/xxx/build/Rcpp/include" -I"/xxx/build/BH/include"      -c toPOSIXct.cpp -o toPOSIXct.o
g++ -fPIC -shared -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -o RcppBDT.so RcppBDTdd.o RcppBDTdt.o RcppBDTdu.o RcppBDTpt.o RcppBDTtz.o RcppExports.o toPOSIXct.o -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -lR

I also have to manually add -fPIC to build the shared library.

@eddelbuettel
Copy link
Owner

eddelbuettel commented Nov 2, 2016

Briefly:

  • I don't have Microsoft R so I cannot help you with particulars
  • RcppBDT itself works just fine on Linux, see
  • You should never have gotten RcppBDT without Rcpp as the latter is a declared dependency

So in short there is no reproducible issue here, beyond make something you may need to report to Microsoft,

@giantwhale
Copy link
Author

thank you, confirmed this is a bug in Microsoft-R-Open

microsoft/microsoft-r-open#17

@eddelbuettel
Copy link
Owner

eddelbuettel commented Nov 4, 2016

Thanks for the follow-up, and the reference! I left a message in their threads microsoft/microsoft-r-open#11 and microsoft/microsoft-r-open#17 too.

In a nutshell, 9000+ CRAN package are built with a set of assumptions about how things are going to work at install time, and "they" violated that contract here. Which leaves you in the hole they dug :-/

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

No branches or pull requests

2 participants