david-cortes / MatrixExtra

(R) Efficient methods and operators for the sparse matrix classes in 'Matrix' (esp. CSR format or "RsparseMatrix")
https://cran.r-project.org/package=MatrixExtra
GNU General Public License v3.0
19 stars 3 forks source link

MatrixExtra 0.1.9 requires something newer than g++ 8.3.1 #2

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 2 years ago

This is mostly an FYI for thoserunning into installation issues. I just noticed that, contrary to MatrixExtra 0.1.8, MatrixExtra 0.1.9 requires something never than g++ 8.3.1, e.g. g++ 9.3.1. I'm not sure what's needed from that version, because it appears to compile with g++ -std=gnu++11 .... Maybe this can be described in SystemRequirements: ....

gcc 8.3.1 (fails)

$ g++ --version
g++ (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.

$ R CMD INSTALL MatrixExtra_0.1.9.tar.gz 
* installing to library ‘/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8’
* installing *source* package ‘MatrixExtra’ ...
** package ‘MatrixExtra’ successfully unpacked and MD5 sums checked
** using staged installation
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c assignment.cpp -o assignment.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c cbind.cpp -o cbind.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c matmul.cpp -o matmul.o
matmul.cpp: In function ‘void gemm_csr_drm_as_dcm(int, int, const int*, const int*, const double*, const real_t*, size_t, real_t*, int, int)’:
matmul.cpp:137:41: error: ‘ldc’ is predetermined ‘shared’ for ‘shared’
             private(write_ptr, temp_arr)
                                         ^
make: *** [/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/etc/Makeconf:177: matmul.o] Error 1
ERROR: compilation failed for package ‘MatrixExtra’
* removing ‘/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/MatrixExtra’
* restoring previous ‘/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/MatrixExtra’

gcc 9.3.1 (works)

$ g++ --version
g++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Copyright (C) 2019 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.

$ R CMD INSTALL MatrixExtra_0.1.9.tar.gz 
* installing to library ‘/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8’
* installing *source* package ‘MatrixExtra’ ...
** package ‘MatrixExtra’ successfully unpacked and MD5 sums checked
** using staged installation
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c assignment.cpp -o assignment.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c cbind.cpp -o cbind.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c matmul.cpp -o matmul.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c misc.cpp -o misc.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c operators.cpp -o operators.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c rbind.cpp -o rbind.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c slice.cpp -o slice.o
g++ -std=gnu++11 -I"/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/include" -DNDEBUG -DUSE_ROBINMAP -DHAS_LD=1 -DSUPPORTS_RESTRICT=1 -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/Rcpp/include' -I'/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/include' -I/usr/local/include  -fopenmp -fno-trapping-math -fno-math-errno -fvisibility=hidden -fpic  -g -O2  -c slice_coo.cpp -o slice_coo.o
g++ -std=gnu++11 -shared -L/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/lib -L/usr/local/lib64 -o MatrixExtra.so RcppExports.o assignment.o cbind.o matmul.o misc.o operators.o rbind.o slice.o slice_coo.o -fopenmp -L/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -L/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/libs -l:float.so -Wl,-rpath=/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/float/libs -L/software/c4/cbi/software/R-4.1.2-gcc8/lib64/R/lib -lR
installing to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/00LOCK-MatrixExtra/00new/MatrixExtra/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 (MatrixExtra)

FWIW, I've noticed this while test installation all 22,000+ packages on CRAN and Bioconductor. All but 5-10 packages work with gcc 8.3.1.

david-cortes commented 2 years ago

Thanks for the bug report. I think this is related to OpenMP5.0 support in compilers, and will probably fail also in older CLANG versions and current MSVC. It’s nevertheless an easy fix and now the current master should compile with GCC8 without any extra requirements.

HenrikBengtsson commented 2 years ago

Even better, thanks for the quick fix.