Skip to content
Prev 10224 / 15075 Next

Build R with Intel Compiler

Your and Brian?s guesses were right: the -openmp linker flag was it. It compiles now fine, though I get errors in make check-all and make install: 

Running a make check-all gives me (with and without flag -ipo)

Running examples in 'mgcv-Ex.R? failed
...
Loading required package: splines
+          s(x2,bs="tr",m=3)+s(x3,bs="tr",m=2),data=dat)
Warning in sqrt(rowSums((P$X %*% x$Vp[first:last, first:last, drop = FALSE]) *  :
  NaNs produced
Error in if (se && pd[[i]]$se) { : missing value where TRUE/FALSE needed
Calls: plot -> plot.gam
Execution halted

A sudo make install gives me:

/opt/intel/composer_xe_2013_sp1.1.103/bin/intel64/icc -std=gnu99 -I. -I../../src/include -I../../../R-3.0.2/src/include -I/usr/X11/include/ -D__ACCELERATE__ -DHAVE_CONFIG_H    -fPIC  -O3 -ipo -openmp -xHost  -DR_HOME='"/usr/local/R/R-intel/R.framework/Versions/3.0/Resources"' -o Rscript \
	  ../../../R-3.0.2/src/unix/Rscript.c
installing packages ...
  building HTML index ...
dyld: Library not loaded: libiomp5.dylib
  Referenced from: /Users/simonzehnder/Downloads/build/bin/exec/R
  Reason: image not found
/bin/sh: line 1: 87375 Done                    echo "utils:::make.packages.html(.Library, verbose=FALSE, docdir=\"/usr/local/R/R-intel/R.framework/Versions/3.0/Resources/doc\")"
     87376 Trace/BPT trap: 5       | R_DEFAULT_PACKAGES=NULL LC_ALL=C ../../bin/R --vanilla --slave > /dev/null
make[2]: *** [install] Error 133
make[1]: *** [install] Error 1
make: *** [install] Error 1

It seems that it is connected with the MKL. I have in my MKL variable ?-lmkl_gf_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread. It seems that libiomp5 is not linked to correctly. 

I uploaded also my config.log to https://gist.github.com/simonsays1980/7359508 

Best

Simon
On 07 Nov 2013, at 15:33, Simon Urbanek <simon.urbanek at r-project.org> wrote: