Saturday, April 11, 2009

Rebuild R libraries for the new version

After upgrading to a new version of R, type "update.packages(checkBuilt =TRUE, ask=FALSE)" to rebuild all the libraries currently present in the system.
To install from Gary King's repository, just type "install.packages("Zelig", repos = "http://gking.harvard.edu")"

To build R, use "./configure --enable-R-shlib" or

./configure --enable-R-shlib CXXFLAGS="-g -O3" CFLAGS="-g -O3"
or
./configure --enable-R-shlib  --with-blas="-lptf77blas -lpthread -latlas" CXXFLAGS="-g -O3"

With OpenBLAS:

./configure --enable-R-shlib  --with-blas="-lpthread -lopenblas" CXXFLAGS="-g -O3"

Or with Intel MKL:

./configure --enable-R-shlib --enable-threads=posix --with-lapack --with-blas="-I$MKLROOT/include -L$MKLROOT/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_lapack -lmkl_core -liomp5 -lpthread" CXXFLAGS="-g -O3"


In case R cannot find the tcltk files, use this " ./configure --enable-R-shlib --with-tcl-config=/usr/lib/tcl8.5/tclConfig.sh --with-tk-config=/usr/lib/tk8.5/tkConfig.sh". This suddenly became necessary when I tried to compile the release candidate version of R 2.14 today. The solution was provided by this blog post.

This may yield even better results: ./configure --enable-R-shlib --with-tcl-config=/usr/lib/tcl8.5/tclConfig.sh --with-tk-config=/usr/lib/tk8.5/tkConfig.sh --with-blas="-lptf77blas -lpthread -latlas"

To fulfill build dependency, use "sudo apt-get build-dep r-cran-rgl"

http://wiki.r-project.org/rwiki/doku.php?id=getting-started:installation:debian

==================================================

MKL_LIB_PATH=/opt/intel/composer_xe_2013.4.183/mkl/lib/intel64

OMP_LIB_PATH=/opt/intel/composer_xe_2013.4.183/compiler/lib/intel64

export LD_LIBRARY_PATH=${MKL_LIB_PATH}:${OMP_LIB_PATH}

MKL=" -L${MKL_LIB_PATH}   -L${OMP_LIB_PATH} -Wl,--start-group -lmkl_gf_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread"


./configure --enable-R-shlib --enable-threads=posix --with-blas="$MKL" --with-lapack CXXFLAGS="-g -O3"

No comments:

Counter