0

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!

Community
  • 1
  • 1
Alex
  • 103
  • 9
  • It's a FAQ and we've been over this a number of times. See eg [this answer](http://stackoverflow.com/a/29986242/143305). Closing this... – Dirk Eddelbuettel Jul 24 '16 at 18:51
  • Hi Dirk, thank you for the link. It is helpful. However, the link doesn't address the first part of my question, namely the error I get and why I can't use `make install` to complete the installation. Do you have any ideas about these? – Alex Jul 24 '16 at 19:20
  • It is my sincere belief that you are better off not compiling locally. The pre-built packages are correctly configured, reliable, and frequently updated. You can switch BLAS/LAPACK libraries with them at will. And in the narrow sense the failure looks look an upstream bug related to building in a clean directory which I reported recently and which has been fixed. Disable the `NEWS.rds` target in `doc/Makefile` if you must... – Dirk Eddelbuettel Jul 24 '16 at 19:22

0 Answers0