I am trying to install factoextra
, but I gets stuck during the CMake part, in particular with error like:
CMake Error: The source directory "/tmp/..." does not exist.
(same when I try to install its dependencies: nloptr
, pbkrtest
, lme4
, car
, rstatix
, FactoMineR
, ggpubr
)
any idea?
thanks
ps:
- R version 4.0.0
- centos 7
last part of logs:
CMake Error: The source directory "/tmp/RtmpgJySdf/R.INSTALL20c31df42f6/nloptr/src/nlopt-build" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Unknown argument -j
Unknown argument 2
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Don't merge stdout/stderr output and pass the
original stdout/stderr handles to the native
tool so it can use the capabilities of the
calling terminal (e.g. colored output).
-- = Pass remaining options to the native tool.
CMake Error: The source directory "/tmp/RtmpgJySdf/R.INSTALL20c31df42f6/nloptr/src/nlopt" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
cp: cannot stat 'nlopt/include/*': No such file or directory
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c init_nloptr.c -o init_nloptr.o
gcc -std=gnu99 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c nloptr.c -o nloptr.o
g++ -std=gnu++11 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c test-C-API.cpp -o test-C-API.o
g++ -std=gnu++11 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c test-runner.cpp -o test-runner.o
g++ -std=gnu++11 -shared -L/opt/R/4.0.0/lib/R/lib -L/usr/local/lib -o nloptr.so init_nloptr.o nloptr.o test-C-API.o test-runner.o -L/opt/R/4.0.0/lib/R/lib -lRlapack -L/opt/R/4.0.0/lib/R/lib -lRblas -lgfortran -lm -lquadmath -Lnlopt/lib -lnlopt -L/opt/R/4.0.0/lib/R/lib -lR
/bin/ld: cannot find -lnlopt
collect2: error: ld returned 1 exit status
make: *** [nloptr.so] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/opt/R/4.0.0/lib/R/library/nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/opt/R/4.0.0/lib/R/library/lme4’
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/opt/R/4.0.0/lib/R/library/pbkrtest’
ERROR: dependencies ‘pbkrtest’, ‘lme4’ are not available for package ‘car’
* removing ‘/opt/R/4.0.0/lib/R/library/car’
ERROR: dependency ‘car’ is not available for package ‘rstatix’
* removing ‘/opt/R/4.0.0/lib/R/library/rstatix’
ERROR: dependency ‘car’ is not available for package ‘FactoMineR’
* removing ‘/opt/R/4.0.0/lib/R/library/FactoMineR’
ERROR: dependency ‘rstatix’ is not available for package ‘ggpubr’
* removing ‘/opt/R/4.0.0/lib/R/library/ggpubr’
ERROR: dependencies ‘FactoMineR’, ‘ggpubr’ are not available for package ‘factoextra’
* removing ‘/opt/R/4.0.0/lib/R/library/factoextra’
The downloaded source packages are in
‘/tmp/Rtmp98DJqK/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("factoextra") :
installation of package ‘nloptr’ had non-zero exit status
2: In install.packages("factoextra") :
installation of package ‘lme4’ had non-zero exit status
3: In install.packages("factoextra") :
installation of package ‘pbkrtest’ had non-zero exit status
4: In install.packages("factoextra") :
installation of package ‘car’ had non-zero exit status
5: In install.packages("factoextra") :
installation of package ‘rstatix’ had non-zero exit status
6: In install.packages("factoextra") :
installation of package ‘FactoMineR’ had non-zero exit status
7: In install.packages("factoextra") :
installation of package ‘ggpubr’ had non-zero exit status
8: In install.packages("factoextra") :
installation of package ‘factoextra’ had non-zero exit status
3
Answers
so,
I think I finally figure out!
factoextra
(or better,nloptr
) currently needs a combination ofI solved this problem by
sudo apt-get install libnlopt-dev
.In Ubuntu install cmake v3.20.2 from the source and it will solve the issue: