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

Mirco Wahab wahab-mail at gmx.de
Sat Oct 15 12:02:45 CEST 2011

On 10/15/2011 1:15 AM, Mark Abraham wrote:
> I use
> ccmake ..\
> -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\

Thanks for your hints, I made it now through `cmake` with:

--- 8< --- [cut here] ------------------------------------------



export CXX=icpc
export CC=icc

cmake ../$GMXVERSION  \
       -DGMX_MPI=OFF             \
       -DGMX_THREADS=ON          \
       -DGMX_X11=OFF                        \


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_C_FLAGS:STRING=' -msse3 -ip -funroll-all-loops -std=gnu99  '

Even with the wrong options, the `make` would eventually succeed
with some option-warnings but without error.

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


Still broken with the new Intel Compiler but probably close ;-)

Thanks and regards,


More information about the gromacs.org_gmx-users mailing list