Paul Baines' Homepage
Harvard University, Department of Statistics
Computing:
R Packages: C/C++ Code, Lapack, MKL, ATLAS, ACML, OpenMP, Profiling and more...
Document to appear here soon.
Installing R with Intel Compilers (icc, icpc, ifort) and MKL
I've always had impressive results with MKL and intel compilers on the Intel-based clusters that I have used in recent years. Given that I was just given access to a new Intel-based cluster that did not have a supported R installation, I decided to have some fun and build R with only intel compilers and MKL linked for all matrix operations (rather than the standard BLAS/Lapack implementations included with R). For anyone interested in doing the same, here are some pointers:
- Remove any remnants of other R versions from the environment variables (PATH, LD_LIBRARY_PATH etc)
- Edit the file 'config.site' included with R to customize your R installation as follows (you can tweak this as desired but it took me a few tries to find a configuration that worked):
R_PAPERSIZE=letter
CC="icc -std=c99"
CFLAGS="-g -O2 -fPIC -DPIC"
F77=ifort
FFLAGS="-g -O2 -fPIC"
MAIN_LD="icc -std=c99"
MAIN_LDFLAGS="-Wl,--export-dynamic"
CPICFLAGS="-fPIC -DPIC"
FPICFLAGS="-fPIC"
SHLIB_LD="icc -std=c99"
SHLIB_LDFLAGS="-shared"
DYLIB_LD="icc -std=c99"
DYLIB_LDFLAGS="-shared"
LDFLAGS="-L/usr/local/lib64 -L/usr/local/intel/mkl/10.0.3.020/lib/em64t" # Change to your MKL lib location
CXX=icpc
SHLIB_CXXLD=icpc
SHLIB_CXXLDFLAGS="-shared"
FC=ifort
- Set up your MKL specifications for R as follows:
- Run: ./configure --with-blas="${MKL}" --with-lapack
- Run: make
- Cross your fingers. :)
setenv MKL_LIB_PATH "${MKL_HOME}/lib/em64t" # Again, modify depending on whether 32/64-bit
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${MKL_LIB_PATH}
setenv MKL "-L${MKL_LIB_PATH} -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack -liomp5 -lpthread -lguide -lmkl_def -lmkl_core -lmkl"
Depending on your favourite shell, you can tweak as desired. I linked to multi-threaded MKL here, you could also link to serial MKL by modifying the linking options given above.
Software:
RxCEcolInf
D. James Greiner, Paul D. Baines and and Kevin M. Quinn (2009). RxCEcolInf: R x C Ecological Inference With Optional Incorporation of Survey Information. R package version 0.1-1.
Recommended download from CRAN. Source code is available here.
cmd
Paul D. Baines (2009). cmd: Color-Magnitude Diagrams. R package version 0.1-1.
Source code is available here.