I am compiling R version 4.2.2. The compile goes fine until this step:

begin installing recommended package Matrix
* installing *source* package ‘Matrix’ ...
** package ‘Matrix’ successfully unpacked and MD5 sums checked
** using non-staged installation
** libs
make[3]: Entering directory `/tmp/Rtmp4WNRuo/R.INSTALL16ecd1ed7a6a/Matrix/src'
gcc -std=c99 -I"/home/user/Downloads/R-4.2.2/include" -DNDEBUG `/home/user/Downloads/R-4.2.2/bin/Rscript -e 'Rcpp:::CxxFlags()'`   -I/usr/local/include   -fpic  -c -std=c99 -lm -Wall -Wextra -pedantic -O3 -Wfloat-equal -g -c CHMfactor.c -o CHMfactor.o
Error in loadNamespace(x) : there is no package called ‘Rcpp’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
In file included from chm_common.h:5,
                 from CHMfactor.h:4,
                 from CHMfactor.c:2:
CHOLMOD/Include/cholmod.h:83:10: fatal error: SuiteSparse_config.h: No such file or directory
   83 | #include "SuiteSparse_config.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [CHMfactor.o] Error 1
make[3]: Leaving directory `/tmp/Rtmp4WNRuo/R.INSTALL16ecd1ed7a6a/Matrix/src'
ERROR: compilation failed for package ‘Matrix’
* removing ‘/home/user/Downloads/R-4.2.2/library/Matrix’
make[2]: *** [Matrix.ts] Error 1
make[2]: Leaving directory `/home/user/Downloads/R-4.2.2/src/library/Recommended'
make[1]: *** [recommended-packages] Error 2
make[1]: Leaving directory `/home/user/Downloads/R-4.2.2/src/library/Recommended'
make: *** [stamp-recommended] Error 2

This seems like a "chicken and the egg" type problem since why would I assume that the Rcpp package would exist if I am compiling a new version of R? Does someone have any insights into this?

Thank you!

OS = CentOS 7
gcc = 12.2.0
CFLAGS = '-gdwarf-2 -gstrict-dwarf'
PATH = /usr/local/gcc-12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_RUN_PATH, LD_LIBRARY_PATH, LD_PKG_PATH = /usr/local/gcc-12/lib64:/usr/local/gcc-12/lib:/usr/local/gcc-12/include:/usr/local/lib64:/usr/local/lib:/usr/local/include:/usr/lib64:/usr/lib:/usr/include
make distclean
./configure
make
0

There are 0 best solutions below