[gmx-users] Link to Intel MKL (fftw) via cmake options

Mark Abraham Mark.Abraham at anu.edu.au
Sun Oct 16 14:25:32 CEST 2011


On 15/10/2011 9:02 PM, Mirco Wahab wrote:
> On 10/15/2011 1:15 AM, Mark Abraham wrote:
>> I use
>>
>> ccmake ..\
>> -DGMX_FFT_LIBRARY=mkl "\
>> -DMKL_LIBRARIES=${MKL}/lib/em64t/libmkl_intel_thread.so;${MKL}/lib/em64t/libmkl_lapack.so;${MKL}/lib/em64t/libmkl_core.so;${MKL}/lib/em64t/libmkl_em64t.a;${MKL}/lib/em64t/libguide.so;/usr/lib64/libpthread.so" 
>>
>> \
>> -DMKL_INCLUDE_DIR=${MKL}/include\
>> -DGMX_MPI=ON\
>> -DGMX_THREADS=OFF
>
> Thanks for your hints, I made it now through `cmake` with:
>
> --- 8< --- [cut here] ------------------------------------------
>
> GMXVERSION=gromacs-4.5.5
> GMXTARGET=/opt/gromacs455
>
> MINC=/opt/intel/composerxe/mkl/include
> MLIB=/opt/intel/composerxe/mkl/lib/intel64
> ILIB=/opt/intel/composerxe/lib/intel64
> LLIB=/usr/lib64
>
> export CXX=icpc
> export CC=icc
>
> cmake ../$GMXVERSION  \
>       -DGMX_FFT_LIBRARY=mkl
> "-DMKL_LIBRARIES=${MLIB}/libmkl_intel_ilp64.so;${MLIB}/libmkl_core.so;${MLIB}/libmkl_intel_thread.so;${ILIB}/libiomp5.so;${LLIB}/libpthread.so"\ 
>
>       -DMKL_INCLUDE_DIR=${MINC} \
>       -DGMX_MPI=OFF             \
>       -DGMX_THREADS=ON          \
>       -DCMAKE_INSTALL_PREFIX=${GMXTARGET}  \
>       -DGMX_X11=OFF                        \
>       -DGMX_BINARY_SUFFIX="_t"
>
> -------------------------------------------------------------------
>
> on `make`, there are still some compiler flag related
> problems. The cmake scripts invoked by the command
> above identified the Intel64 compiler and guessed
> 'almost correct' optimization and code-generation options:
> (Compiler: /opt/intel/composer_xe_2011_sp1.6.233/bin/intel64/ic*)
>
> --- [CMakeCache.txt] ---------------------------------------------
>
> ...
>
> //Flags used by the compiler during all build types
> CMAKE_CXX_FLAGS:STRING=' -msse2 -ip -funroll-all-loops -std=gnu99  '
>
> //Flags used by the compiler during release builds.
> CMAKE_CXX_FLAGS_RELEASE:STRING=-mtune=itanium2 -mtune=core2  -O3 -DNDEBUG
>
> //Flags used by the compiler during all build types
> CMAKE_C_FLAGS:STRING=' -msse2 -ip -funroll-all-loops -std=gnu99  '
>
> //Flags used by the compiler during release builds.
> CMAKE_C_FLAGS_RELEASE:STRING=-mtune=itanium2 -mtune=core2  -O3 -DNDEBUG
>
> ...
>
> --------------------------------------------------------------------
>
> These are obviously the wrong flags for the detected architecture,
> sse2 is no longer available and so are the the mtune architectures.
>
> The correct options for the actual compiler for Intel64 would read:
>
>    CMAKE_CXX_FLAGS:STRING=' -msse3 -ip -funroll-all-loops -std=gnu99 '
>    CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
>
>    CMAKE_C_FLAGS:STRING=' -msse3 -ip -funroll-all-loops -std=gnu99  '
>    CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
>
>
> Even with the wrong options, the `make` would eventually succeed
> with some option-warnings but without error.

Sure. GROMACS will not benefit noticeably from the SSE3 instruction set, 
so we don't bother looking for it.

>
> But the install is broken. On `make install-mdrun`, the scripts would
> remove any library from "src/gmxlib/CMakeFiles/CMakeRelink.dir"
> and bail out with the error below. Even if you copy the libraries
> by hand to CMakeRelink.dir/, the'll get removed by make install-mdrun
> before trying to link with them.
>
> --- [cat errmsg.txt] ---------------------------------------------
>
> [ 70%] Built target gmx
> [ 89%] Built target md
> [ 98%] Built target gmxpreprocess
> [100%] Built target mdrun
> [100%] Installing mdrun
> -- Install configuration: "Release"
> -- Install component: "libraries"
> CMake Error at /x/y/Gromacs/build/src/gmxlib/cmake_install.cmake:38 
> (FILE):
>    file INSTALL cannot find
>    
> "/x/y/Gromacs/build/src/gmxlib/CMakeFiles/CMakeRelink.dir/libgmx.so.6".
>
> --------------------------------------------------------------------
>
> Still broken with the new Intel Compiler but probably close ;-)

That looks very weird. What cmake version? What does make install-mdrun 
VERBOSE=1 say?

Mark



More information about the gromacs.org_gmx-users mailing list