Issue
I am struggling to install keras on my Rstudio version 2021.09.2 Build 382 (R version 3.6.0 (2019-04-26)) on Linux Centos 7. I am having this error message:
ERROR: compilation failed for package ‘RcppTOML’
* removing ‘/usr/lib64/R/library/RcppTOML’
ERROR: dependency ‘RcppTOML’ is not available for package ‘reticulate’
* removing ‘/usr/lib64/R/library/reticulate’
ERROR: dependency ‘reticulate’ is not available for package ‘tfautograph’
* removing ‘/usr/lib64/R/library/tfautograph’
ERROR: dependency ‘reticulate’ is not available for package ‘tfruns’
* removing ‘/usr/lib64/R/library/tfruns’
ERROR: dependencies ‘reticulate’, ‘tfruns’, ‘tfautograph’ are not available for package ‘tensorflow’
* removing ‘/usr/lib64/R/library/tensorflow’
ERROR: dependencies ‘reticulate’, ‘tensorflow’, ‘tfruns’ are not available for package ‘keras’
* removing ‘/usr/lib64/R/library/keras’
I tried to install manually directly from the tar, but I still have the same error.
1: In install.packages("keras") :
installation of package ‘RcppTOML’ had non-zero exit status
2: In install.packages("keras") :
installation of package ‘reticulate’ had non-zero exit status
3: In install.packages("keras") :
installation of package ‘tfautograph’ had non-zero exit status
4: In install.packages("keras") :
installation of package ‘tfruns’ had non-zero exit status
5: In install.packages("keras") :
installation of package ‘tensorflow’ had non-zero exit status
6: In install.packages("keras") :
installation of package ‘keras’ had non-zero exit status
Any idea how to solve it? Thanks.
Solution
I finally understood, there is a bug on CentOS 7: RcppTOML fails to compile with g++ 4.8.5 (20150623), but installs with g++ 5.3.1 (20160406) from scl-devtoolset-4.
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
These lines fixed the issue
Answered By - user979974 Answer Checked By - Senaida (WPSolving Volunteer)