After a few days of reading and headache, I finally gave a try at building R from source with Intel MKL and ICC. Documentation and posts on this topic are rather incomplete, sometime fantasist et do not give much explanations about configure options. As I am not sure if mine is correct, I would appreciate some advices and hints. OS: Fedora 22 parallel_studio_xe_2016 Hardware : 8 Thread(s) per core: 2 Vendor ID: GenuineIntel Model name: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz - Sandybridge R-3.2.2 Here is my build configuration: ------------------------------------------------------- source /opt/intel/compilers_and_libraries_2016/linux/mkl/bin/mklvars.sh intel64 source /opt/intel/bin/compilervars.sh intel64 _mkllibpath=$MKLROOT/lib/intel64 _icclibpath=$MKLROOT/linux/compiler/lib export LD_LIBRARY_PATH=${_mkllibpath}:${_icclibpath} export MKL="-L${_mkllibpath} -L${_icclibpath} -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread" export CC="icc" export F77="ifort" export CXX="icpc" export AR="xiar" export LD="xild" export CFLAGS="-O3 -ipo -openmp -parallel -xAVX" export CXXFLAGS="-O3 -ipo -openmp -parallel -xAVX" export FFLAGS="-O3 -ipo -openmp -parallel -xAVX" export MAIN_LDFLAGS='-openmp' ./configure --with-lapack --with-blas="$MKL" --enable-R-shlib --enable-memory-profiling --enable-openmp --enable-BLAS-shlib --enable-lto F77=${F77} FC=${F77} ------------------------------------------------------------ After I run ./configure, it seems from config.log everything is fine: checking for dgemm_ in result: yes checking whether double complex BLAS can be used result: yes checking whether the BLAS is complete result: yes The only error I can see is ld complaining about not finding -lRblas ---------------------------------------------------------------------------- Then run $ make with no errors. Now, with no $ make install, I get this: -------------------------------------------------------------------- $ ldd bin/exec/R linux-vdso.so.1 (0x00007ffe073f3000) libR.so => /usr/lib64/R/lib/libR.so (0x00007f43939e6000) libRblas.so => not found libm.so.6 => /lib64/libm.so.6 (0x00007f43936de000) libiomp5.so => /opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64/libiomp5.so (0x00007f439339c000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4393185000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4392f69000) libc.so.6 => /lib64/libc.so.6 (0x00007f4392ba8000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f43929a4000) libblas.so.3 => /lib64/libblas.so.3 (0x00007f439274b000) libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f439241f000) libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f43921e0000) libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f4391f96000) libtre.so.5 => /lib64/libtre.so.5 (0x00007f4391d85000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f4391b15000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f43918ef000) libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f43916de000) libz.so.1 => /lib64/libz.so.1 (0x00007f43914c8000) librt.so.1 => /lib64/librt.so.1 (0x00007f43912c0000) libicuuc.so.54 => /lib64/libicuuc.so.54 (0x00007f4390f2e000) libicui18n.so.54 => /lib64/libicui18n.so.54 (0x00007f4390ad7000) libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f43908b5000) /lib64/ld-linux-x86-64.so.2 (0x00005557e2243000) libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f439068a000) libicudata.so.54 => /lib64/libicudata.so.54 (0x00007f438ec5f000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f438e8dc000) ----------------------------------------------------------------------------------------------- Now a few questions: 1- am I not supposed to see something like this in the ldd command return? libmkl_intel_lp64.so => /opt/intel.... libmkl_intel_thread.so => /opt/intel/.... libmkl_core.so => /opt/intel/... Or do I need to run $make install before ldd? 2- when visiting Intel MKL link advisor[0], here is what I get as configure and make options: Linking: -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lpthread -lm Compiler options: -DMKL_ILP64 -qopenmp -I${MKLROOT}/include What is the difference between -openmp and -qopenmp? Shall I use indeed the above compiler options? Thank you for help in this difficult topic for me. -- google.com/+arnaudgabourygabx
On Wed, Sep 2, 2015 at 7:35 PM, arnaud gaboury <arnaud.gaboury at gmail.com> wrote:> After a few days of reading and headache, I finally gave a try at > building R from source with Intel MKL and ICC. Documentation and posts > on this topic are rather incomplete, sometime fantasist et do not give > much explanations about configure options. > As I am not sure if mine is correct, I would appreciate some advices and hints. > > OS: Fedora 22 > parallel_studio_xe_2016 > Hardware : 8 Thread(s) per core: 2 Vendor ID: GenuineIntel Model name: > Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz - Sandybridge > R-3.2.2 > > Here is my build configuration: > > ------------------------------------------------------- > source /opt/intel/compilers_and_libraries_2016/linux/mkl/bin/mklvars.sh intel64 > source /opt/intel/bin/compilervars.sh intel64 > _mkllibpath=$MKLROOT/lib/intel64 > _icclibpath=$MKLROOT/linux/compiler/lib > export LD_LIBRARY_PATH=${_mkllibpath}:${_icclibpath} > export MKL="-L${_mkllibpath} -L${_icclibpath} -lmkl_intel_lp64 > -lmkl_intel_thread -lmkl_core -liomp5 -lpthread" > export CC="icc" > export F77="ifort" > export CXX="icpc" > export AR="xiar" > export LD="xild" > export CFLAGS="-O3 -ipo -openmp -parallel -xAVX" > export CXXFLAGS="-O3 -ipo -openmp -parallel -xAVX" > export FFLAGS="-O3 -ipo -openmp -parallel -xAVX" > export MAIN_LDFLAGS='-openmp' > ./configure --with-lapack --with-blas="$MKL" --enable-R-shlib > --enable-memory-profiling --enable-openmp --enable-BLAS-shlib > --enable-lto F77=${F77} FC=${F77} > ------------------------------------------------------------ > > After I run ./configure, it seems from config.log everything is fine: > > checking for dgemm_ in > result: yes > > checking whether double complex BLAS can be used > result: yes > > checking whether the BLAS is complete > result: yes > > The only error I can see is ld complaining about not finding -lRblas > ---------------------------------------------------------------------------- > > Then run $ make with no errors. > Now, with no $ make install, I get this: > > -------------------------------------------------------------------- > $ ldd bin/exec/R > linux-vdso.so.1 (0x00007ffe073f3000) > libR.so => /usr/lib64/R/lib/libR.so (0x00007f43939e6000) > libRblas.so => not found > libm.so.6 => /lib64/libm.so.6 (0x00007f43936de000) > libiomp5.so => /opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64/libiomp5.so > (0x00007f439339c000) > libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4393185000) > libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4392f69000) > libc.so.6 => /lib64/libc.so.6 (0x00007f4392ba8000) > libdl.so.2 => /lib64/libdl.so.2 (0x00007f43929a4000) > libblas.so.3 => /lib64/libblas.so.3 (0x00007f439274b000) > libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f439241f000) > libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f43921e0000) > libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f4391f96000) > libtre.so.5 => /lib64/libtre.so.5 (0x00007f4391d85000) > libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f4391b15000) > liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f43918ef000) > libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f43916de000) > libz.so.1 => /lib64/libz.so.1 (0x00007f43914c8000) > librt.so.1 => /lib64/librt.so.1 (0x00007f43912c0000) > libicuuc.so.54 => /lib64/libicuuc.so.54 (0x00007f4390f2e000) > libicui18n.so.54 => /lib64/libicui18n.so.54 (0x00007f4390ad7000) > libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f43908b5000) > /lib64/ld-linux-x86-64.so.2 (0x00005557e2243000) > libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f439068a000) > libicudata.so.54 => /lib64/libicudata.so.54 (0x00007f438ec5f000) > libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f438e8dc000) > ----------------------------------------------------------------------------------------------- > > > Now a few questions: >EDIT> 1- am I not supposed to see these libraries in the list ? > libmkl_intel_lp64.so > libmkl_intel_thread.so > libmkl_core.so > > Or do I need to run $make install before ldd? > > 2- when visiting Intel MKL link advisor[0], here is what I get as > configure and make options: > Linking: -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core > -lmkl_intel_thread -lpthread -lm > Compiler options: -DMKL_ILP64 -qopenmp -I${MKLROOT}/include > > What is the difference between -openmp and -qopenmp? Shall I use > indeed the above compiler options? > > Thank you for help in this difficult topic for me. > > -- > > google.com/+arnaudgabourygabx-- google.com/+arnaudgabourygabx
arnaud gaboury <arnaud.gaboury at gmail.com> writes:> After a few days of reading and headache, I finally gave a try at > building R from source with Intel MKL and ICC. Documentation and posts > on this topic are rather incomplete, sometime fantasist et do not give > much explanations about configure options. > As I am not sure if mine is correct, I would appreciate some advices and hints.This is how we build R with the Intel compilers and MKL on CentOS 6.x, with different versions of R (latest version: 3.2.1) and Intel compilers (latest version: 2015.3) on Intel SandyBridge CPUs: fast="-ip -O3 -opt-mem-layout-trans=3 -xHost -mavx" export CC="icc" export CFLAGS="$fast -wd188 -fp-model precise" export F77="ifort" export FFLAGS="$fast -fp-model precise" export CXX="icpc" export CXXFLAGS="$fast -fp-model precise" export FC="ifort" export FCFLAGS="$fast -fp-model precise" ./configure --prefix=$destdir --with-blas='-mkl=parallel' --with-lapack --enable-BLAS-shlib ## Notes (they might not be true anymore): ## -static and -ipo break compilation ## -no-prec-div breaks make check ## -fp-model precise is needed for make check ## -wd188 removes a lot of warnings (see R Inst. & Adm. manual) We have successfully used this setup for a couple of years now. -- Regards, Bj?rn-Helge Mevik
On Fri, Sep 4, 2015, 9:24 AM Bj?rn-Helge Mevik <b.h.mevik at usit.uio.no> wrote: arnaud gaboury <arnaud.gaboury at gmail.com> writes:> After a few days of reading and headache, I finally gave a try at > building R from source with Intel MKL and ICC. Documentation and posts > on this topic are rather incomplete, sometime fantasist et do not give > much explanations about configure options. > As I am not sure if mine is correct, I would appreciate some advices andhints. This is how we build R with the Intel compilers and MKL on CentOS 6.x, with different versions of R (latest version: 3.2.1) and Intel compilers (latest version: 2015.3) on Intel SandyBridge CPUs: fast="-ip -O3 -opt-mem-layout-trans=3 -xHost -mavx" export CC="icc" export CFLAGS="$fast -wd188 -fp-model precise" export F77="ifort" export FFLAGS="$fast -fp-model precise" export CXX="icpc" export CXXFLAGS="$fast -fp-model precise" export FC="ifort" export FCFLAGS="$fast -fp-model precise" ./configure --prefix=$destdir --with-blas='-mkl=parallel' --with-lapack --enable-BLAS-shlib Thank you for this configuration. Nothing about openmp? What about my cited missing librairies. libmkl_intel_lp64.so libmkl_intel_thread.so libmkl_core.so Any idea why they are not listed by the ldd command? ## Notes (they might not be true anymore): ## -static and -ipo break compilation ## -no-prec-div breaks make check ## -fp-model precise is needed for make check ## -wd188 removes a lot of warnings (see R Inst. & Adm. manual) We have successfully used this setup for a couple of years now. -- Regards, Bj?rn-Helge Mevik ______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel [[alternative HTML version deleted]]
On Wed, 2015-09-02 at 20:49 +0200, arnaud gaboury wrote:> On Wed, Sep 2, 2015 at 7:35 PM, arnaud gaboury <arnaud.gaboury at gmail.com> wrote: > > After a few days of reading and headache, I finally gave a try at > > building R from source with Intel MKL and ICC. Documentation and posts > > on this topic are rather incomplete, sometime fantasist et do not give > > much explanations about configure options. > > As I am not sure if mine is correct, I would appreciate some advices and hints. > > > > OS: Fedora 22 > > parallel_studio_xe_2016 > > Hardware : 8 Thread(s) per core: 2 Vendor ID: GenuineIntel Model name: > > Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz - Sandybridge > > R-3.2.2 > > > > Here is my build configuration: > > > > ------------------------------------------------------- > > source /opt/intel/compilers_and_libraries_2016/linux/mkl/bin/mklvars.sh intel64 > > source /opt/intel/bin/compilervars.sh intel64 > > _mkllibpath=$MKLROOT/lib/intel64 > > _icclibpath=$MKLROOT/linux/compiler/lib > > export LD_LIBRARY_PATH=${_mkllibpath}:${_icclibpath} > > export MKL="-L${_mkllibpath} -L${_icclibpath} -lmkl_intel_lp64 > > -lmkl_intel_thread -lmkl_core -liomp5 -lpthread" > > export CC="icc" > > export F77="ifort" > > export CXX="icpc" > > export AR="xiar" > > export LD="xild" > > export CFLAGS="-O3 -ipo -openmp -parallel -xAVX" > > export CXXFLAGS="-O3 -ipo -openmp -parallel -xAVX" > > export FFLAGS="-O3 -ipo -openmp -parallel -xAVX" > > export MAIN_LDFLAGS='-openmp' > > ./configure --with-lapack --with-blas="$MKL" --enable-R-shlib > > --enable-memory-profiling --enable-openmp --enable-BLAS-shlib > > --enable-lto F77=${F77} FC=${F77} > > ------------------------------------------------------------ > > > > After I run ./configure, it seems from config.log everything is fine: > > > > checking for dgemm_ in > > result: yes > > > > checking whether double complex BLAS can be used > > result: yes > > > > checking whether the BLAS is complete > > result: yes > > > > The only error I can see is ld complaining about not finding -lRblas > > ---------------------------------------------------------------------------- > > > > Then run $ make with no errors. > > Now, with no $ make install, I get this: > > > > -------------------------------------------------------------------- > > $ ldd bin/exec/R > > linux-vdso.so.1 (0x00007ffe073f3000) > > libR.so => /usr/lib64/R/lib/libR.so (0x00007f43939e6000) > > libRblas.so => not found > > libm.so.6 => /lib64/libm.so.6 (0x00007f43936de000) > > libiomp5.so => /opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64/libiomp5.so > > (0x00007f439339c000) > > libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4393185000) > > libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4392f69000) > > libc.so.6 => /lib64/libc.so.6 (0x00007f4392ba8000) > > libdl.so.2 => /lib64/libdl.so.2 (0x00007f43929a4000) > > libblas.so.3 => /lib64/libblas.so.3 (0x00007f439274b000) > > libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f439241f000) > > libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f43921e0000) > > libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f4391f96000) > > libtre.so.5 => /lib64/libtre.so.5 (0x00007f4391d85000) > > libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f4391b15000) > > liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f43918ef000) > > libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f43916de000) > > libz.so.1 => /lib64/libz.so.1 (0x00007f43914c8000) > > librt.so.1 => /lib64/librt.so.1 (0x00007f43912c0000) > > libicuuc.so.54 => /lib64/libicuuc.so.54 (0x00007f4390f2e000) > > libicui18n.so.54 => /lib64/libicui18n.so.54 (0x00007f4390ad7000) > > libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f43908b5000) > > /lib64/ld-linux-x86-64.so.2 (0x00005557e2243000) > > libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f439068a000) > > libicudata.so.54 => /lib64/libicudata.so.54 (0x00007f438ec5f000) > > libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f438e8dc000) > > ----------------------------------------------------------------------------------------------- > > > > > > Now a few questions: > > > EDIT > > 1- am I not supposed to see these libraries in the list ? > > libmkl_intel_lp64.so > > libmkl_intel_thread.so > > libmkl_core.soYou are looking in the wrong place. With the option --enable-BLAS-shlib, R is linked to MKL via the library libRblas.so which you will find in the directory "lib" after building R.> > Or do I need to run $make install before ldd? > > > > 2- when visiting Intel MKL link advisor[0], here is what I get as > > configure and make options: > > Linking: -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core > > -lmkl_intel_thread -lpthread -lm > > Compiler options: -DMKL_ILP64 -qopenmp -I${MKLROOT}/include > > > > What is the difference between -openmp and -qopenmp? Shall I use > > indeed the above compiler options?The option -qopenmp replaces -openmp, which is deprecated. This is in the man page for icc. Martyn> > Thank you for help in this difficult topic for me. > > > > -- > > > > google.com/+arnaudgabourygabx > > >----------------------------------------------------------------------- This message and its attachments are strictly confidenti...{{dropped:8}}