welch-lab / RcppPlanc

GNU General Public License v2.0
3 stars 1 forks source link

Error Installing: ‘sparsity’ is predetermined ‘shared’ for ‘shared’ #6

Closed Siddharth-Gaywala closed 5 months ago

Siddharth-Gaywala commented 5 months ago

Hi! I was having trouble downloading the package. I run devtools::install_github("welch-lab/RcppPlanc") but get the error ‘sparsity’ is predetermined ‘shared’ for ‘shared’:

[ 33%] Building CXX object CMakeFiles/RcppPlanc.dir/rcppplanc_nmf.cpp.o
/usr/bin/g++ -DBLAS_IMPLICIT -DHAVE_OPENBLAS_CBLAS_H -DHIGHFIVE_HAS_CONCEPTS=0 -DMPI_NO_CPPBIND -DRcppPlanc_EXPORTS -I/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/tools/../src/common -I/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/tools/../src/nnls -I/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/tools/../src/nmf -I/mnt/hpc-apps/R/4.2.2/lib64/R/include -I/mnt/biohome/sgaywala/liger/packages/packrat/lib/x86_64-pc-linux-gnu/4.2.2/Rcpp/include -I/mnt/biohome/sgaywala/liger/packages/packrat/lib/x86_64-pc-linux-gnu/4.2.2/RcppArmadillo/include -I/mnt/biohome/sgaywala/liger/packages/packrat/lib/x86_64-pc-linux-gnu/4.2.2/RcppProgress/include -I/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/src/_deps/highfive-src/include -O2 -g -DNDEBUG -std=gnu++17 -fPIC -fopenmp -ffinite-math-only -fno-signaling-nans -fno-rounding-math -fno-trapping-math -fno-math-errno -fno-signed-zeros -MD -MT CMakeFiles/RcppPlanc.dir/rcppplanc_nmf.cpp.o -MF CMakeFiles/RcppPlanc.dir/rcppplanc_nmf.cpp.o.d -o CMakeFiles/RcppPlanc.dir/rcppplanc_nmf.cpp.o -c /mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/src/rcppplanc_nmf.cpp
In file included from /mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/tools/../src/common/nmf.hpp:6,
                 from /mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/tools/../src/nmf/bppnmf.hpp:7,
                 from /mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/src/rcppplanc_nmf.cpp:9:
/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/tools/../src/common/utils.hpp: In function ‘void makeSparse(double, T*)’:
/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/tools/../src/common/utils.hpp:142:59: error: ‘sparsity’ is predetermined ‘shared’ for ‘shared’
 #pragma omp parallel for default(none) shared(sparsity, X)
                                                           ^
make[2]: *** [CMakeFiles/RcppPlanc.dir/build.make:79: CMakeFiles/RcppPlanc.dir/rcppplanc_nmf.cpp.o] Error 1
make[2]: Leaving directory '/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/src'
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/RcppPlanc.dir/all] Error 2
make[1]: Leaving directory '/mnt/hpcscratch/nodescratch/login02/Rtmp8uyfCa/R.INSTALL2c26b53992c20c/RcppPlanc/src'
make: *** [Makefile:139: all] Error 2
ERROR: compilation failed for package ‘RcppPlanc’
* removing ‘/mnt/biohome/sgaywala/liger/packages/packrat/lib/x86_64-pc-linux-gnu/4.2.2/RcppPlanc’
Warning message:
In i.p(...) :
  installation of package ‘/mnt/hpcscratch/nodescratch/login02/Rtmp4xGQb4/file2bebba40e0f942/RcppPlanc_1.0.0.tar.gz’ had non-zero exit status

Session Info:

> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Rocky Linux 8.6 (Green Obsidian)

Matrix products: default
BLAS:   /mnt/hpc-apps/R/4.2.2/lib64/R/lib/libRblas.so
LAPACK: /mnt/hpc-apps/R/4.2.2/lib64/R/lib/libRlapack.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] Rcpp_1.0.12       magrittr_2.0.3    usethis_2.2.3     devtools_2.4.5
 [5] pkgload_1.3.4     xtable_1.8-4      R6_2.5.1          rlang_1.1.3
 [9] fastmap_1.2.0     urlchecker_1.0.1  stringr_1.5.1     tools_4.2.2
[13] pkgbuild_1.4.4    packrat_0.9.2     sessioninfo_1.2.2 miniUI_0.1.1.1
[17] cli_3.6.2         remotes_2.5.0     htmltools_0.5.8.1 ellipsis_0.3.2
[21] digest_0.6.35     lifecycle_1.0.4   processx_3.8.4    shiny_1.8.1.1
[25] callr_3.7.6       purrr_1.0.2       later_1.3.2       ps_1.7.6
[29] vctrs_0.6.5       profvis_0.3.8     htmlwidgets_1.6.4 fs_1.6.4
[33] promises_1.3.0    curl_5.2.1        memoise_2.0.1     glue_1.7.0
[37] cachem_1.1.0      mime_0.12         stringi_1.8.4     compiler_4.2.2
[41] desc_1.4.3        httpuv_1.6.15

This is on a Linux HPC cluster. Do you have any ideas on what could be causing this error or any advice on how to fix this?

theAeon commented 5 months ago

Can't say I've ever seen that error before. What version of GCC is being used?

theAeon commented 5 months ago

Just spun up a container to reproduce-it appears that this is something that was a breaking change in GCC 9. I get the same error running it directly on a rocky linux 8 container, but after installing gcc-toolset-9 and running it it works.

See if you have any HPC modules that load a later version of gcc.

[root@c1e576a919e9 /]# scl enable gcc-toolset-9 bash
[root@c1e576a919e9 /]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/gcc-toolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/gcc-toolset-9/root/usr --mandir=/opt/rh/gcc-toolset-9/root/usr/share/man --infodir=/opt/rh/gcc-toolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.2.1-20191120/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.2.1 20191120 (Red Hat 9.2.1-2) (GCC) 
[root@c1e576a919e9 /]# R

R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

> devtools::install_github("welch-lab/RcppPlanc")
Downloading GitHub repo welch-lab/RcppPlanc@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────
✔  checking for file '/tmp/Rtmp0dkDRs/remotesaf415bf123fd/welch-lab-RcppPlanc-94e1fee/DESCRIPTION' ...
─  preparing 'RcppPlanc':
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running 'cleanup'
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building 'RcppPlanc_1.0.0.tar.gz'

Installing package into '/usr/lib64/R/library'
(as 'lib' is unspecified)
* installing *source* package 'RcppPlanc' ...
** using staged installation
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
[snip]

** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'RcppPlanc'
    finding HTML links ... done
    H5Mat                                   html  
    H5SpMat                                 html  
    bppnnls                                 html  
    data                                    html  
    dim-H5SpMat                             html  
    format.H5Mat                            html  
    format.H5SpMat                          html  
    inmf                                    html  
    nmf                                     html  
    onlineINMF                              html  
    print.H5Mat                             html  
    print.H5SpMat                           html  
    symNMF                                  html  
    uinmf                                   html  
** 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 (RcppPlanc)
Siddharth-Gaywala commented 5 months ago

Thank you! Loading a newer version of GCC fixed the issue