Installing Rmpi on centos with intel mpi - r

I am trying to install Rmpi in package in R, with intel mpi installed. First I downloaded Rmpi, and the processed by following comand:
Command line
R CMD INSTALL --configure-args="--with-mpi=/opt/intel_2015/impi/5.0.1.035/intel64/" Rmpi_0.6-5.tar.gz
But it didn't install, instead it shows the following result:
Log
* installing to library ‘/home/user/R/x86_64-pc-linux-gnu-library/3.2’
* installing *source* package ‘Rmpi’ ...
** package ‘Rmpi’ successfully unpacked and MD5 sums checked
checking for gcc... icc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether icc -std=gnu99 accepts -g... yes
checking for icc -std=gnu99 option to accept ISO C89... none needed
Trying to find mpi.h ...
Found in /opt/intel_2015/impi/5.0.1.035/intel64//include
Trying to find libmpi.so or libmpich.a ...
Found libmpi in /opt/intel_2015/impi/5.0.1.035/intel64//lib
checking for openpty in -lutil... yes
checking for main in -lpthread... yes
configure: error: Unknown type of mpi: use --with-Rmpi-type or RMPI_TYPE to specify it
ERROR: configuration failed for package ‘Rmpi’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/3.2/Rmpi’
* restoring previous ‘/home/user/R/x86_64-pc-linux-gnu-library/3.2/Rmpi’
Then I used --with-Rmpi-type='MPI2CH' and --with-Rmpi-type='OPENMPI' Nothing worked, I know It must be the mpi type problem. But I tried everything I can find, still can't figure it out.
Architecture
Centos 6.7 final
R-3.2.3
Rmpi_0.6-5
Following is my .bashrc file of intel
source /opt/intel_2015/bin/compilervars.sh intel64
source /opt/intel_2015/impi/5.0.1.035/bin64/mpivars.sh
source /opt/intel_2015/composer_xe_2015.0.090/mkl/bin/mklvars.sh intel64
source /opt/intel_2015/bin/iccvars.sh intel64
After I tried the following command:
R CMD INSTALL --configure-args="\
--with-Rmpi-include='/opt/intel_2015/impi/5.0.1.035/intel64/include' \
--with-Rmpi-libpath='/opt/intel_2015/impi/5.0.1.035/intel64/lib' \
--with-mpi='/opt/intel_2015/impi/5.0.1.035/intel64' \
--with-Rmpi-type='OPENMPI' " Rmpi_0.6-5.tar.gz
It shows the following result, still something wrong, but promising:
* installing *source* package ‘Rmpi’ ...
** package ‘Rmpi’ successfully unpacked and MD5 sums checked
checking for openpty in -lutil... no
checking for main in -lpthread... no
configure: creating ./config.status
config.status: creating src/Makevars
** libs
icc -std=gnu99 -I/opt/R-3.2.3MKL/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/opt/intel_2015/impi/5.0.1.035/intel64/include -DMPI2 -DOPENMPI -I/usr/local/include -fpic -ip -O3 -opt-mem-layout-trans=3 -xHost -march=core-avx2 -wd188 -fp-model precise -c Rmpi.c -o Rmpi.o
icc -std=gnu99 -I/opt/R-3.2.3MKL/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/opt/intel_2015/impi/5.0.1.035/intel64/include -DMPI2 -DOPENMPI -I/usr/local/include -fpic -ip -O3 -opt-mem-layout-trans=3 -xHost -march=core-avx2 -wd188 -fp-model precise -c conversion.c -o conversion.o
icc -std=gnu99 -I/opt/R-3.2.3MKL/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/opt/intel_2015/impi/5.0.1.035/intel64/include -DMPI2 -DOPENMPI -I/usr/local/include -fpic -ip -O3 -opt-mem-layout-trans=3 -xHost -march=core-avx2 -wd188 -fp-model precise -c internal.c -o internal.o
icc -std=gnu99 -shared -L/usr/local/lib64 -o Rmpi.so Rmpi.o conversion.o internal.o -L/opt/intel_2015/impi/5.0.1.035/intel64/lib -lmpi
installing to /home/user/R/x86_64-pc-linux-gnu-library/3.2/Rmpi/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (Rmpi)

Please try this one:
what I figure out is dependency error. I mean Rmpi does not work if OpenMPI was compiled to dynamically load extensions, which is nowadays the default installation. If your OpenMPI is >= 1.x (and for some installs of 1.x.x) you will need to install it from the sources disabling dlopen.
So:
Try uninstalling all of the MPI interfaces, reinstalled OpenMPI
using the "--enabled-shared --disable-dlopen" command, and Rmpi should able
to install sucessfully inside R.
R CMD INSTALL Rmpi_0.6-5.tar.gz --configure-args="--with-mpi=/usr/local/ --with-Rmpi-type=OPENMPI --enabled-shared --disable-dlopen"
I hope it work for you. but don't give up :)

Related

Can't install nloptr package for R on CentOS 7

I am encountering the same type of problem as described in this question. However, in accordance with the answer, I have updated my R (version 4.1.3) and CMake (version 3.12.3) and I still can't seem to install the package. I am running CentOS 7.
Here is the log:
> install.packages("nloptr")
Installing package into ‘/home/userr/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/nloptr_2.0.0.tar.gz'
Content type 'application/x-gzip' length 2219414 bytes (2.1 MB)
==================================================
downloaded 2.1 MB
* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++11 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -std=gnu++11 accepts -g... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config knows NLopt... no
using NLopt via local cmake build on x86_64
set CMAKE_BIN=/usr/local/bin/cmake
set CC=gcc -std=gnu11
set CFLAGS=-I/usr/local/include -fpic -g -O2
set CXX=g++
set CXXFLAGS=-std=gnu++11 -I/usr/local/include -fpic -g -O2
set LDFLAGS=-L/usr/local/lib
CMake Error: The source directory "/tmp/RtmpVJjt9p/R.INSTALL27cf4036808b/nloptr/src/nlopt-build" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Error: /tmp/RtmpVJjt9p/R.INSTALL27cf4036808b/nloptr/src/nlopt-build is not a directory
CMake Error: The source directory "/tmp/RtmpVJjt9p/R.INSTALL27cf4036808b/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=gnu11 -I"/opt/R/4.1.3/lib/R/include" -DNDEBUG -I../inst/include -I'/home/userr/R/x86_64-pc-linux-gnu-library/4.1/testthat/include' -I/usr/local/include -fpic -g -O2 -c init_nloptr.c -o init_nloptr.o
gcc -std=gnu11 -I"/opt/R/4.1.3/lib/R/include" -DNDEBUG -I../inst/include -I'/home/userr/R/x86_64-pc-linux-gnu-library/4.1/testthat/include' -I/usr/local/include -fpic -g -O2 -c nloptr.c -o nloptr.o
g++ -std=gnu++11 -I"/opt/R/4.1.3/lib/R/include" -DNDEBUG -I../inst/include -I'/home/userr/R/x86_64-pc-linux-gnu-library/4.1/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.1.3/lib/R/include" -DNDEBUG -I../inst/include -I'/home/userr/R/x86_64-pc-linux-gnu-library/4.1/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.1.3/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.1.3/lib/R/lib -lRlapack -L/opt/R/4.1.3/lib/R/lib -lRblas -lgfortran -lm -lquadmath -Lnlopt/lib -lnlopt -L/opt/R/4.1.3/lib/R/lib -lR
installing to /home/userr/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-nloptr/00new/nloptr/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package ‘nloptr’
finding HTML links ... done
auglag html
bobyqa html
ccsaq html
check.derivatives html
cobyla html
crs2lm html
direct html
is.nloptr html
isres html
lbfgs html
mlsl html
mma html
neldermead html
newuoa html
nl.grad html
nl.opts html
nloptr-package html
nloptr html
nloptr.get.default.options html
nloptr.print.options html
print.nloptr html
sbplx html
slsqp html
stogo html
tnewton html
varmetric html
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘nloptr’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/userr/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-nloptr/00new/nloptr/libs/nloptr.so':
libnlopt.so.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/userr/R/x86_64-pc-linux-gnu-library/4.1/nloptr’
Warning in install.packages :
installation of package ‘nloptr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp3kX1wu/downloaded_packages’
I don't know what could be causing the error, but my guess is that this line from the above log is the most relevant:
CMake Error: The source directory "/tmp/RtmpVJjt9p/R.INSTALL27cf4036808b/nloptr/src/nlopt-build" does not exist.
I would be thankful for all the help as I don't know much about Linux systems.

R cannot load libraries calling lapack functions

I'm trying to install some of the popular R packages but somehow my R does not see the lapack installation. Or rather the compiler doesn't see it, I guess, because when it checks LAPACK_LIBS it says it found it. I checked sessionInfo() and La_version() and they both point to where lapack is installed. How do I even go about solving it?
> install.packages("RcppArmadillo")
Installing package into ‘/homeUPDATES
/marcin/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/RcppArmadillo_0.10.5.0.0.tar.gz'
Content type 'application/x-gzip' length 1669395 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -std=gnu++14 accepts -g... (cached) yes
checking whether we have a suitable tempdir... /tmp
checking whether R CMD SHLIB can already compile programs using OpenMP... yes
checking LAPACK_LIBS... system LAPACK found
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/home/marcin/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppArmadillo.cpp -o RcppArmadillo.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/home/marcin/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/home/marcin/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fastLm.cpp -o fastLm.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -L/usr/local/opt/gsl/lib -lgsl -llapack -lgslcblas -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/usr/local/opt/gettext/lib -L/usr/lib/R/lib -lR
installing to /home/marcin/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘RcppArmadillo’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/marcin/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so':
/home/marcin/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so: undefined symbol: dgesvx_
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/marcin/R/x86_64-pc-linux-gnu-library/4.1/RcppArmadillo’
Warning in install.packages("RcppArmadillo") :
installation of package ‘RcppArmadillo’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpw0yc9E/downloaded_packages’
>
UPDATE 1:
I made sure that the blas and lapack .so files have 755 permissions but it didn't help.
UPDATE 2:
The same problem occurs when I try to build from source a package that needs lapack. For example, I tried installing the GpGp package with the following Makevars
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(SHLIB_OPENMP_CXXFLAGS)
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
and it gives the same problem.
Try sudo apt-get update in terminal. Does it say something is locked? It looks to me like something else is using the depenent files and thus the process is locked. If this is the case you can either wait for the process to be done or reboot.
You can also try to install forcing no lock:
install.packages("RcppArmadillo",INSTALL_opts = '--no-lock')
You also might also try installing via remotes and the github page which will get you the latest dev version rather than the cran version:
library(remotes)
remotes::install_github("RcppCore/RcppArmadillo")
Please install openblas-dev libraries:
sudo apt -y install libopenblas-dev
The symbol dgesvx_ is not found. These are the extern C defines, that wrap to the fortran drivers. Then grepping for the symbol you'll find it here:
~> grep dgesvx_ /usr/lib/x86_64-linux-gnu/liblapack.so.3
grep: /usr/lib/x86_64-linux-gnu/liblapack.so.3: binary file matches
So eventually I figured out that the problem was my ~/.R/Makevars file. Dirk's comment under my original question made me wonder where do these extra commands come from and I found them in Makevars. I don't remember when and why I added something to it but when I reverted back to just an empty Makevars file everything worked! Thanks Dirk!

Failure to install phylosmith - unable to load shared object, undefined symbol

Setup:
R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Platform: x86_64-pc-linux-gnu (64-bit)
Ubuntu 16.04
Issue:
Cannot install phylosmith package.
Command: devtools::install_github('schuyler-smith/phylosmith', lib = "/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/")
Output:
Downloading GitHub repo schuyler-smith/phylosmith#HEAD
✓ checking for file ‘/tmp/RtmpOU4qAW/remotes570e65639b36/schuyler-smith-phylosmith-2bd9c9b/DESCRIPTION’ ...
─ preparing ‘phylosmith’:
✓ 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 ‘phylosmith_1.0.5.tar.gz’
* installing *source* package ‘phylosmith’ ...
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++11 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -std=gnu++11 accepts -g... (cached) yes
checking whether g++ version is sufficient... (5.4.0) yes
checking for macOS... not found as on Linux
checking for OpenMP... found
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppParallel/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppArmadillo/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppProgress/include' -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppParallel/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppArmadillo/include' -I'/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/RcppProgress/include' -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c correlations_Rcpp.cpp -o correlations_Rcpp.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o phylosmith.so RcppExports.o correlations_Rcpp.o -fopenmp -DARMA_64BIT_WORD -L/usr/lib/R/lib -lR
installing to /home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘phylosmith’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs/phylosmith.so':
/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs/phylosmith.so: undefined symbol: _ZN3tbb10interface58internal9task_base7destroyERNS_4taskE
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/phylosmith’
Warning message:
In i.p(...) :
installation of package ‘/tmp/RtmpOU4qAW/file570e27910aa/phylosmith_1.0.5.tar.gz’ had non-zero exit status'
Additional information: I have seen other posts with a similar issue, but different undefined symbols. I believe this error is specific to my given undefined symbol (_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE) but I'm not sure what that has do to with it or how to resolve it.
I've tried changing libraries and installing it straight from the .tar.gz file. I have GDAL version 2.2.2 and I think its the only installation I have too.
I've even tried copying the finsihed folder before it finished installing, and pasting it into the library. The package folder looks complete. Then, when I run the command library(phylosmith), I get the output:
Error: package or namespace load failed for ‘phylosmith’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/phylosmith/libs/phylosmith.so':
/home/dunfield/R/x86_64-pc-linux-gnu-library/4.0/phylosmith/libs/phylosmith.so: undefined symbol: _ZN3tbb10interface58internal9task_base7destroyERNS_4taskE
I also ran the linux command beforehand as instructed:
sudo apt install libmysqlclient-dev libgdal-dev libudunits2-dev
I installed TBB with the terminal command apt install libtbb-dev and the TBB package in R devtools::install_package("jjallaire/TBB"). Neither attempt changed the error output even after restarting the Linux and RStudio.
At this point, I know its got to be something to do with the symbols that include tbb in the .so file. Any help troubleshooting would be greatly appreciated!
The author fixed it! Phylosmith should now be installable on Linux no problem. See github.com/schuyler-smith/phylosmith/issues/15 for detail.

Error install RcppArmadillo on macOS Catalina [duplicate]

This question already has answers here:
Cannot compile R packages with c++ code after updating to macOS Catalina
(2 answers)
Closed 3 years ago.
I followed the steps in R Compiler Tools for Rcpp on macOS (for R 3.6.x), but an error occurs when I try to install RcppArmadillo. I don't have Xcode.app install, and prefer to use the command line tools instead.
The answers posted here didn't help :(
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... clang++ -std=gnu++11 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether clang++ -std=gnu++11 accepts -g... (cached) yes
checking whether g++ version is sufficient... almost
configure: WARNING: Compiler self-identifies as being compliant with GNUC extensions but is not g++.
checking for macOS... found
checking for macOS Apple compiler... not found
checking for clang compiler... found
checking for OpenMP compatible version of clang... found and suitable
checking LAPACK_LIBS... system LAPACK found
checking for OpenMP... missing
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
clang++ -std=gnu++11 -I"/usr/local/Cellar/r/3.6.1_1/lib/R/include" -DNDEBUG -I"/usr/local/lib/R/3.6/site-library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -I../inst/include -fPIC -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from RcppArmadillo.cpp:22:
In file included from ../inst/include/RcppArmadillo.h:31:
In file included from ../inst/include/RcppArmadilloForward.h:26:
In file included from /usr/local/lib/R/3.6/site-library/Rcpp/include/RcppCommon.h:29:
In file included from /usr/local/lib/R/3.6/site-library/Rcpp/include/Rcpp/r/headers.h:59:
In file included from /usr/local/lib/R/3.6/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
In file included from /usr/local/clang7/include/c++/v1/cmath:305:
/usr/local/clang7/include/c++/v1/math.h:301:15: fatal error: 'math.h' file not found
#include_next <math.h>
^~~~~~~~
1 error generated.
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/usr/local/lib/R/3.6/site-library/RcppArmadillo’
* restoring previous ‘/usr/local/lib/R/3.6/site-library/RcppArmadillo’
The downloaded source packages are in
‘/private/var/folders/ny/f06ns0d568bgf6s559z8j_9m0000gn/T/Rtmp0t1pHj/downloaded_packages’
Warning message:
In install.packages("RcppArmadillo") :
installation of package ‘RcppArmadillo’ had non-zero exit status
A side note mentioned in this answer saved me. The trick is to add the following line to $(R RHOME)/etc/Makeconf
CPPFLAGS = -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include

Non Zero excess status when installing RQuantLib

I am trying to install RQuantLib on a Mac OSX 10.13. I have the latest version of R: Version 3.4.3.
I have done the following pre requisites using homebrew
brew install boost
brew install quantlib
However, when I try
install.packages("RQuantLib", configure.args="--with-boost include=/usr/local/include/ --with-boost-lib=/usr/local/lib/")
R returns
* installing *source* package ‘RQuantLib’ ...
** package ‘RQuantLib’ successfully unpacked and MD5 sums checked
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for R... yes
checking for quantlib-config... yes
checking for Boost development files... yes
checking for minimal Boost version... yes
configure: creating ./config.status
config.status: creating src/Makevars
Completed configuration and ready to build.
** libs
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG
-I"/Users/rorymcstay/Library/R/3.4/library/Rcpp/include" -
I/usr/local/include -Wall -g -O2 -
I/usr/local/Cellar/quantlib/1.12/include -I/usr/local/include/ -
I../inst/include -I. -fopenmp -DRCPP_NEW_DATE_DATETIME_VECTORS -fPIC -
Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
clang: error: unsupported option '-fopenmp'
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘RQuantLib’
* removing ‘/Users/rorymcstay/Library/R/3.4/library/RQuantLib’
Warning in install.packages :
installation of package ‘RQuantLib’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/mf/7p4rjjq53zg5_3bdqznb9p2h0000gn/T/RtmpsowkET/do wnloaded_packages’
Can anyone see what is going wrong?
Thanks
Rory

Resources