Installation of package 'glmnet' had Non-Zero Exit Status after R update

111 views Asked by At

I recently updated by version of R from 3.6 to 4.3. After the update, I have not been able to install the 'glmnet' package.

Below is the initial message and first error...

install.packages('glmnet')
Installing package into ‘/home/nganhien/R/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/glmnet_4.1-8.tar.gz'
Content type 'application/x-gzip' length 2439515 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

* installing *source* package ‘glmnet’ ...
** package ‘glmnet’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘gcc (Homebrew GCC 5.5.0_7) 5.5.0’
using Fortran compiler: ‘GNU Fortran (Homebrew GCC 5.5.0_7) 5.5.0’
using C++ compiler: ‘g++ (Homebrew GCC 5.5.0_7) 5.5.0’
using C++17
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/nganhien/R/x86_64-pc-linux-gnu-library/4.3/RcppEigen/include' -I'/home/nganhien/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include'    -Iglmnetpp/include -Iglmnetpp/src -Iglmnetpp/test -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-aeZVAy/r-base-4.3.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c RcppExports.cpp -o RcppExports.o
gfortran  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-aeZVAy/r-base-4.3.1=. -fstack-protector-strong  -c coxnet5dpclean.f -o coxnet5dpclean.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG  -I'/home/nganhien/R/x86_64-pc-linux-gnu-library/4.3/RcppEigen/include' -I'/home/nganhien/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include'    -Iglmnetpp/include -Iglmnetpp/src -Iglmnetpp/test -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-aeZVAy/r-base-4.3.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c elnet_exp.cpp -o elnet_exp.o
In file included from glmnetpp/include/glmnetpp_bits/elnet_point/internal/base.hpp:4:0,
                 from glmnetpp/include/glmnetpp_bits/elnet_point/internal/gaussian_base.hpp:5,
                 from glmnetpp/include/glmnetpp_bits/elnet_point.hpp:11,
                 from glmnetpp/include/glmnetpp:4,
                 from elnet_exp.cpp:3:
glmnetpp/include/glmnetpp_bits/util/iterator/counting_iterator.hpp:44:64: error: 'constexpr' is not allowed in declaration of friend template specialization 'bool operator==<>(const glmnetpp::util::counting_iterator<IntType>&, const glmnetpp::util::counting_iterator<IntType>&)'
                                        const counting_iterator&);

After this there is pages and pages of text along with multiple errors. Some examples of the errors are error: 'constexpr' is not allowed in declaration of friend template specialization 'bool operator==<>(const glmnetpp::util::counting_iterator<IntType>&, const glmnetpp::util::counting_iterator<IntType>&)'const counting_iterator&); and error: 'glmnetpp::util::counting_iterator<int>::value_type glmnetpp::util::counting_iterator<int>::curr_' is private value_type curr_; and error: within this context { return it1.curr_ != it2.curr_; } and error: 'compute_abs_grad' was not declared in this scope base_t::construct([&](index_t k, auto& g) { return compute_abs_grad(k, g); }); and more.

At the end I get the following.

is used but never defined [-fpermissive]
     static bool check_kkt(
                 ^
make: *** [/usr/lib/R/etc/Makeconf:200: elnet_exp.o] Error 1
ERROR: compilation failed for package ‘glmnet’
* removing ‘/home/nganhien/R/x86_64-pc-linux-gnu-library/4.3/glmnet’

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

If anyone has any ideas, I would appreciate it. Here is my sessioninfo().

R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8    
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8    LC_PAPER=en_CA.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Vancouver
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.1 tools_4.3.1   

I tried, downgrading the version of R to 4.2.x but had the same problem installing 'glmnet'. I don't appear to have any problems with any other package.

0

There are 0 answers