r-lib / later

Schedule an R function or formula to run after a specified period of time.
https://r-lib.github.io/later
Other
138 stars 27 forks source link

Error installing related to boost - R 3.6.1 #94

Closed j-andrews7 closed 5 years ago

j-andrews7 commented 5 years ago

I'm trying to install later on a computing cluster, but am running into an error related to boost. Any insight would be much appreciated. I have tried using an unstaged installation with no success. Both BH and Rcpp are installed.

* installing *source* package ‘later’ ...
** package ‘later’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
icpc  -I"/export/R-3.6.1-intel/lib64/R/include" -DNDEBUG -pthread -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include" -I/usr/local/include    -fPIC -std=c++11 -c RcppExports.cpp -o RcppExports.o
icpc  -I"/export/R-3.6.1-intel/lib64/R/include" -DNDEBUG -pthread -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include" -I/usr/local/include    -fPIC -std=c++11 -c callback_registry.cpp -o callback_registry.o
In file included from /home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include/boost/noncopyable.hpp(15),
                 from threadutils.h(6),
                 from callback_registry.h(11),
                 from callback_registry.cpp(5):
/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include/boost/core/noncopyable.hpp(42): error: defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr
        BOOST_CONSTEXPR noncopyable() = default;
                        ^

In file included from callback_registry.cpp(5):
callback_registry.h(42): warning #858: type qualifier on return type is meaningless
    const bool operator()(const T a, const T b) const {
    ^

compilation aborted for callback_registry.cpp (code 2)
make: *** [callback_registry.o] Error 2
ERROR: compilation failed for package ‘later’
* removing ‘/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/later’

The downloaded source packages are in
        ‘/tmp/RtmpHoerYX/downloaded_packages’
Warning message:
In install.packages("later") :
  installation of package ‘later’ had non-zero exit status
sessionInfo

```r R version 3.6.1 (2019-07-05) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS release 6.9 (Final) Matrix products: default BLAS/LAPACK: /export/intel/compilers_and_libraries_2017.6.256/linux/mkl/lib/intel64_lin/libmkl_intel_lp64.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] ps_1.3.0 prettyunits_1.0.2 crayon_1.3.4 withr_2.1.2 [5] rprojroot_1.3-2 assertthat_0.2.1 R6_2.4.0 backports_1.1.4 [9] magrittr_1.5 cli_1.1.0 curl_4.0 remotes_2.1.0 [13] callr_3.3.1 tools_3.6.1 compiler_3.6.1 processx_3.4.1 [17] pkgbuild_1.0.3 ```

wch commented 5 years ago

Hm, the Intel compiler must be sensitive to that pattern, while gcc and clang do not seem to mind it.

I've pushed a potential fix that removes the leading const. Can you try installing it?

devtools::install_github('r-lib/later@wch-fix-const-error')

We'll have to investigate what exactly that change means to make sure it's OK.

j-andrews7 commented 5 years ago

No dice, still get the same error minus the warning:

> devtools::install_github('r-lib/later@wch-fix-const-error')
Downloading GitHub repo r-lib/later@wch-fix-const-error
✔  checking for file ‘/tmp/RtmpMhTKvm/remotes5ba4364b04f2/r-lib-later-6fdd0b4/DESCRIPTION’ (337ms)
─  preparing ‘later’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘later_0.8.0.9002.tar.gz’

Installing package into ‘/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package ‘later’ ...
** using staged installation
** libs
icpc  -I"/export/R-3.6.1-intel/lib64/R/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include" -I/usr/local/include    -fPIC -std=c++11 -c RcppExports.cpp -o RcppExports.o
icpc  -I"/export/R-3.6.1-intel/lib64/R/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include" -I/usr/local/include    -fPIC -std=c++11 -c callback_registry.cpp -o callback_registry.o
In file included from /home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include/boost/noncopyable.hpp(15),
                 from threadutils.h(6),
                 from callback_registry.h(11),
                 from callback_registry.cpp(5):
/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/BH/include/boost/core/noncopyable.hpp(42): error: defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr
        BOOST_CONSTEXPR noncopyable() = default;
                        ^

compilation aborted for callback_registry.cpp (code 2)
make: *** [callback_registry.o] Error 2
ERROR: compilation failed for package ‘later’
* removing ‘/home/jandrews/R/x86_64-pc-linux-gnu-library/3.6/later’
Error: Failed to install 'later' from GitHub:
  (converted from warning) installation of package ‘/tmp/RtmpMhTKvm/file5ba42269fae9/later_0.8.0.9002.tar.gz’ had non-zero exit status
wch commented 5 years ago

This looks like it might be a bug in the Intel compiler.

http://boost.2283326.n4.nabble.com/core-noncopyable-test-boost-unit-test-singleton-massive-test-failures-td4666675.html

A comment here says it was fixed with version 14.0 of the Intel compiler: https://software.intel.com/en-us/forums/intel-c-compiler/topic/404755

What version are you using?

It looks like there's a workaround in Boost for version <=13.10, but I don't know if it's applied in your case.

https://github.com/eddelbuettel/bh/blob/e0c4da7e/inst/include/boost/config/compiler/intel.hpp#L532-L537 https://github.com/eddelbuettel/bh/blob/e0c4da7e/inst/include/boost/core/noncopyable.hpp#L41-L43

j-andrews7 commented 5 years ago

Should be well past that.

[jandrews@login01 ~]$ icpc -v
icpc version 17.0.6 (gcc version 5.5.0 compatibility)

The intel compiler gets loaded automatically when R is started - I don't have any control over it. gcc is also available.

wch commented 5 years ago

If you can use gcc, that would probably be the easiest thing to try to make this work.

j-andrews7 commented 5 years ago

I figured, I just don't know how to force it to use gcc over icpc given that R won't start if I remove icpc. I'm putting the cluster's admin through hell trying to upgrade to R 3.6, but I guess this is another one for him.

wch commented 5 years ago

I think you can create a ~/.R/Makevars file, and put in the following:

CC=gcc
CXX=c++
j-andrews7 commented 5 years ago

Yeah, I played around with that a bit but kept breaking R's startup due to the icpc reliance. The solution was to edit the Makevars file in later/src and change the first few lines to:

CC=gcc
CXX=g++
#CXX_STD=CXX11

Thanks for all your help!

wch commented 5 years ago

I'm just curious - why does your R installation need a compiler at startup?

j-andrews7 commented 5 years ago

It does, the cluster loads up both the intel compilers and gcc when the R module is made available - removing the intel compilers before startup throws an error when R is started, as I believe the admin built R with them due to a performance increase.

I ran into a lot of issues with installing various packages, so I actually basically gave up on the system's R installations and installed/managed through conda (which I probably should have done from the start).