CMake Not Detecting MKL on Systems

Problems with Dalton installation? Find answers or ask for help here
Post Reply
JMartel
Posts: 20
Joined: 02 Feb 2014, 21:49
First name(s): John
Last name(s): Martel
Affiliation: UP
Country: United States

CMake Not Detecting MKL on Systems

Post by JMartel » 02 Feb 2014, 21:55

Hello,

It appears that CMake is not detecting MKL on my system, because at linking I get a bunch of error of "undefined reference to `dgemm_'" which is relates to missing BLAS libraries. I have Ubuntu 12.04, and MKL 11.0.4 is installed in its standard location '/opt/intel/mkl', I am using GNU and OpenMPI 1.6.5. Any ideas on what might be going wrong? Thanks in advance

bast
Posts: 1210
Joined: 26 Aug 2013, 13:22
First name(s): Radovan
Last name(s): Bast
Affiliation: none
Country: Germany

Re: CMake Not Detecting MKL on Systems

Post by bast » 02 Feb 2014, 22:06

hi John, how did you configure? what was the setup command?
have you set MATH_ROOT?

JMartel
Posts: 20
Joined: 02 Feb 2014, 21:49
First name(s): John
Last name(s): Martel
Affiliation: UP
Country: United States

Re: CMake Not Detecting MKL on Systems

Post by JMartel » 02 Feb 2014, 23:04

I have used './setup --mpi --mkl=sequential' , I tried setting MATH_ROOT to '/opt/intel/mkl' but that didn't help. The following is the output

Code: Select all

doudou@Pumpkin-Ubuntu:~/Downloads/DALTON-2013.1-Source$ ./setup --mpi --mkl=sequential
Configuring system: Ubuntu
 FC=mpif90 CC=mpicc CXX=mpicxx cmake -DENABLE_MPI=ON -DENABLE_SGI_MPT=OFF -DENABLE_OMP=OFF -DENABLE_64BIT_INTEGERS=OFF -DENABLE_CSR=OFF -DENABLE_SCALAPACK=OFF -DENABLE_SCALASCA=OFF -DENABLE_TIMINGS=OFF -DENABLE_XCFUN=OFF -DENABLE_STATIC_LINKING=OFF -DENABLE_AUTO_BLAS=ON -DENABLE_AUTO_LAPACK=ON -DMKL_FLAG="-mkl=sequential" -DENABLE_AUTO_BLAS=OFF -DENABLE_AUTO_LAPACK=OFF -DCMAKE_BUILD_TYPE=release /home/doudou/Downloads/DALTON-2013.1-Source

-- User set explicit MKL flag which is passed to the compiler and linker: -mkl=sequential
-- This disables math detection and builtin math libraries
-- mpi.mod matches current compiler, setting -DUSE_MPI_MOD_F90
-- System                : Linux
-- Processor type        : x86_64
-- Fortran compiler flags: -DVAR_GFORTRAN -DGFORTRAN=445 -ffloat-store -fcray-pointer -m64  -O3 -ffast-math -funroll-loops -ftree-vectorize -w
-- C compiler flags      : -std=c99 -DRESTRICT=restrict -DFUNDERSCORE=1 -DHAVE_NO_LSEEK64 -ffloat-store -m64 -O3 -ffast-math -funroll-loops -ftree-vectorize -Wno-unused
-- Libraries             : -mkl=sequential
-- Definitions           : SYS_LINUX;SYS_UNIX;VAR_GFORTRAN;COMPILER_UNDERSTANDS_FORTRAN_2003;VAR_MPI;USE_MPI_MOD_F90;BUILD_GEN1INT;VAR_MFDS;_FILE_OFFSET_BITS=64;IMPLICIT_NONE;BINARY_INFO_AVAILABLE;INSTALL_BASDIR="/home/doudou/Downloads/DALTON-2013.1-Source/build/basis";INSTALL_WRKMEM=64000000;INSTALL_MMWORK=1;BUILD_PELIB
-- The Fortran compiler identification is GNU
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working Fortran compiler: /home/doudou/Programs/OpenMPI/bin/mpif90
-- Check for working Fortran compiler: /home/doudou/Programs/OpenMPI/bin/mpif90  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /home/doudou/Programs/OpenMPI/bin/mpif90 supports Fortran 90
-- Checking whether /home/doudou/Programs/OpenMPI/bin/mpif90 supports Fortran 90 -- yes
-- Check for working C compiler: /home/doudou/Programs/OpenMPI/bin/mpicc
-- Check for working C compiler: /home/doudou/Programs/OpenMPI/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/doudou/Programs/OpenMPI/bin/mpicxx
-- Check for working CXX compiler: /home/doudou/Programs/OpenMPI/bin/mpicxx -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_UNDERSTANDS_FORTRAN03
-- Performing Test COMPILER_UNDERSTANDS_FORTRAN03 - Success
-- Math lib search order is MKL;ESSL;ATLAS;ACML;SYSTEM_NATIVE
-- You can select a specific type by defining for instance -D BLAS_TYPE=ATLAS or -D LAPACK_TYPE=ACML
-- or by redefining MATH_LIB_SEARCH_ORDER
-- Found MPI_C: /home/doudou/Programs/OpenMPI/lib/libmpi.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libnsl.so;/usr/lib/x86_64-linux-gnu/libutil.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/libdl.so 
-- Found MPI_CXX: /home/doudou/Programs/OpenMPI/lib/libmpi_cxx.so;/home/doudou/Programs/OpenMPI/lib/libmpi.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libnsl.so;/usr/lib/x86_64-linux-gnu/libutil.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/libdl.so 
-- Found MPI_Fortran: /home/doudou/Programs/OpenMPI/lib/libmpi_f90.so;/home/doudou/Programs/OpenMPI/lib/libmpi_f77.so;/home/doudou/Programs/OpenMPI/lib/libmpi.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libnsl.so;/usr/lib/x86_64-linux-gnu/libutil.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/libdl.so 
-- Performing Test MPI_COMPATIBLE
-- Performing Test MPI_COMPATIBLE - Success
-- Performing Test MPI_COMPILER_MATCHES
-- Performing Test MPI_COMPILER_MATCHES - Success
-- Performing Test MPI_ITYPE_MATCHES
-- Performing Test MPI_ITYPE_MATCHES - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/doudou/Downloads/DALTON-2013.1-Source/build

   configure step is done
   now you need to compile the sources:
 

bast
Posts: 1210
Joined: 26 Aug 2013, 13:22
First name(s): Radovan
Last name(s): Bast
Affiliation: none
Country: Germany

Re: CMake Not Detecting MKL on Systems

Post by bast » 02 Feb 2014, 23:07

ok the reason why this can't work is that the -mkl flag only works with Intel compilers.
we will improve documentation to make it more clear.
since you use the GNU compiler, you should set MATH_ROOT (you have done that correctly)
but NOT use --mkl=sequential.
in short for GNU you have to use MATH_ROOT. for Intel you can either use MATH_ROOT
or mkl flag directly.
good luck!

bast
Posts: 1210
Joined: 26 Aug 2013, 13:22
First name(s): Radovan
Last name(s): Bast
Affiliation: none
Country: Germany

Re: CMake Not Detecting MKL on Systems

Post by bast » 02 Feb 2014, 23:09

more explicitly you should use:

Code: Select all

export MATH_ROOT=/opt/intel/mkl
./setup --mpi
cd build
make

JMartel
Posts: 20
Joined: 02 Feb 2014, 21:49
First name(s): John
Last name(s): Martel
Affiliation: UP
Country: United States

Re: CMake Not Detecting MKL on Systems

Post by JMartel » 03 Feb 2014, 00:47

bast wrote:ok the reason why this can't work is that the -mkl flag only works with Intel compilers.
we will improve documentation to make it more clear.
since you use the GNU compiler, you should set MATH_ROOT (you have done that correctly)
but NOT use --mkl=sequential.
in short for GNU you have to use MATH_ROOT. for Intel you can either use MATH_ROOT
or mkl flag directly.
good luck!
Aha!!!, I have been scratching my head for 2 days. Thanks!

afca
Posts: 19
Joined: 11 Nov 2013, 01:23
First name(s): Antonio
Last name(s): Arapiraca
Affiliation: CEFET/MG
Country: Brazil

Re: CMake Not Detecting MKL on Systems

Post by afca » 08 Mar 2014, 20:09

Thanks, this advices working for me too!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests