I'm trying to compile R 3.3.1 on Ubuntu Server 16.04. I've successfully compiled this version of R previously on the same computer, but now I can't get R to compile.
My goal is to use the HiPLARM package. I've been following the installation instructions for HiPLARM, so I needed to recompile R with shared BLAS (I'm using MKL). I uninstalled my previous installation, and I've added the additional --enable-BLAS-shlib
flag to configure
, but the compilation fails. When I remove the additional flag (and return to my original configuration settings), the compilation appears to work, but installation fails. I don't know what would have changed on my system that would have allowed me to successfully compile the same version of R with the same installation instructions but not doesn't.
Here are the specifics. I run this script:
export MKLPATH=/opt/intel/mkl/lib/intel64_lin
export MKLINCLUDE=/opt/intel/mkl/include
export R_PAPERSIZE=letter
export R_BATCHSAVE=--no-save
export FFLAGS="-I$MKLINCLUDE"
export CFLAGS="-march=native -O3 -m64 -I$MKLINCLUDE"
export CXXFLAGS="-march=native -O3 -m64 -I$MKLINCLUDE"
export FCFLAGS="-I$MKLINCLUDE"
MKL="-L$MKLPATH -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl"
./configure --with-blas="$MKL" --with-lapack
The configure summary appears as expected, so I then use make
to compile, and everything appears fine except:
main.c: In function ‘dummy_ii’:
main.c:1656:12: warning: function returns address of local variable [-Wreturn-local-addr]
return (uintptr_t) ⅈ
When I run R from the bin
directory, everything appears to be working correctly. I can multiply two 5000x5000 matrices of random normal draws in less time than without MKL. However, when I use make install
or checkinstall
, I receive the following errors:
installing doc ...
/usr/bin/install: cannot stat 'NEWS': No such file or directory
/usr/bin/install: cannot stat 'NEWS.pdf': No such file or directory
/usr/bin/install: cannot stat 'NEWS.rds': No such file or directory
/usr/bin/install: cannot stat 'NEWS': No such file or directory
/usr/bin/install: cannot stat 'NEWS.pdf': No such file or directory
Makefile:119: recipe for target 'install-sources2' failed
make[1]: *** [install-sources2] Error 1
Also, when I attempt to use the --enable-BLAS-shlib
flag in my script, I receive many warnings of implicit declaration of function
, and the compiling eventually fails with many undefined reference
errors. I've found this post, but the script isn't successful for me (perhaps because I'm not using the Intel compilers?).
Any help would be tremendously appreciated!