HenrikBengtsson / CBI-software

A Scientific Software Stack for HPC (CentOS oriented)
https://wynton.ucsf.edu/hpc/software/software-repositories.html
5 stars 2 forks source link

NOTE: R package 'regsem' fail to install with gcc 7.3.1 #21

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 3 years ago

Possibly related to #16:

$ Rscript --version
R scripting front-end version 4.1.0 (2021-05-18)
> install.packages("regsem")
Installing package into ‘/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/regsem_1.6.2.tar.gz'
Content type 'application/x-gzip' length 79501 bytes (77 KB)
==================================================
downloaded 77 KB

* installing *source* package ‘regsem’ ...
** package ‘regsem’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
gcc -I"/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/RcppArmadillo/include' -I/usr/local/include   -fpic  -I/software/c4/cbi/software/geos-3.9.1/include -I/software/c4/cbi/software/gdal-2.4.4/include  -c regsem_init.c -o regsem_init.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_RAMmult.cpp -o regsem_rcpp_RAMmult.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_fit_fun.cpp -o regsem_rcpp_fit_fun.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_grad_ram.cpp -o regsem_rcpp_grad_ram.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_quasi_calc.cpp -o regsem_rcpp_quasi_calc.o
g++ -std=gnu++14 -shared -L/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/lib -L/software/c4/cbi/software/geos-3.9.1/lib -L/software/c4/cbi/software/gdal-2.4.4/lib -o regsem.so RcppExports.o regsem_init.o regsem_rcpp_RAMmult.o regsem_rcpp_fit_fun.o regsem_rcpp_grad_ram.o regsem_rcpp_quasi_calc.o -L/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/lib -lRlapack -L/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -L/software/c4/cbi/software/R-4.1.0-gcc7/lib64/R/lib -lR
installing to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/00LOCK-regsem/00new/regsem/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘regsem’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/00LOCK-regsem/00new/regsem/libs/regsem.so':
  /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/00LOCK-regsem/00new/regsem/libs/regsem.so: undefined symbol: regsem_rcpp_fit_fun
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc7/regsem’

The downloaded source packages are in
        ‘/scratch/henrik/RtmpJcGyX1/downloaded_packages’
Warning message:
In install.packages("regsem") :
  installation of package ‘regsem’ had non-zero exit status

Action

HenrikBengtsson commented 3 years ago

Confirmed it fails also with R_LIBS_USER=~/tmp R.

HenrikBengtsson commented 3 years ago

Works with R built with gcc 8.3.1;

[henrik@c4-dev3 ~]$ which R
/software/c4/cbi/software/R-4.1.0-gcc8/bin/R
[henrik@c4-dev3 ~]$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> install.packages("regsem", repos="https://cloud.r-project.org")
Installing package into ‘/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/regsem_1.6.2.tar.gz'
Content type 'application/x-gzip' length 79501 bytes (77 KB)
==================================================
downloaded 77 KB

* installing *source* package ‘regsem’ ...
** package ‘regsem’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
gcc -I"/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_init.c -o regsem_init.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_RAMmult.cpp -o regsem_rcpp_RAMmult.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_fit_fun.cpp -o regsem_rcpp_fit_fun.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_grad_ram.cpp -o regsem_rcpp_grad_ram.o
g++ -std=gnu++14 -I"/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/include" -DNDEBUG  -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c regsem_rcpp_quasi_calc.cpp -o regsem_rcpp_quasi_calc.o

g++ -std=gnu++14 -shared -L/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/lib -L/usr/local/lib64 -o regsem.so RcppExports.o regsem_init.o regsem_rcpp_RAMmult.o regsem_rcpp_fit_fun.o regsem_rcpp_grad_ram.o regsem_rcpp_quasi_calc.o -L/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/lib -lRlapack -L/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -L/software/c4/cbi/software/R-4.1.0-gcc8/lib64/R/lib -lR
installing to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI/00LOCK-regsem/00new/regsem/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (regsem)

The downloaded source packages are in
        ‘/scratch/henrik/RtmpTZ5snp/downloaded_packages’
> 
HenrikBengtsson commented 3 years ago

Reported upstream to https://github.com/Rjacobucci/regsem/issues/15.

From this, it looks like it may be better if we use scl-devtoolset/8 for building/using R 4.1.0, cf. #16.