Building harminv with Intel® MKL and Intel® Compilers

We tried to build harminv with Intel software tools and thought; it would be useful to our users and so sharing the steps.

harminv is a free program (and accompanying library) to solve the problem of harmonic inversion — given a discrete-time, finite-length signal that consists of a sum of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it determines the frequencies, decay constants, amplitudes, and phases of those sinusoids. (ref: Wikipedia)

Follow these steps to set some of the environment variables such as compilers as Intel compilers, library paths for Intel® MKL, and OpenMP.

  $export CC=icc

  $export CXX=icpc

  $export F77=ifort

  $MKL_LIB_PATH=/opt/intel/composer_xe_2013_sp1/mkl/lib/intel64

  $OMP_LIB_PATH=/opt/intel/lib/intel64

  $export LD_LIBRARY_PATH=${MKL_LIB_PATH}:${OMP_LIB_PATH}

  $MKL=" -L${MKL_LIB_PATH} -L${OMP_LIB_PATH} -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core  -liomp5 -lpthread"

$./configure --with-blas="$MKL" --with-lapack="$MKL"

 

Check the configure output to cofirm MKL is used for BLAS and LAPACK.

………………..

checking for sgemm_ in  -L/opt/intel/composer_xe_2013_sp1/mkl/lib/intel64 -L/opt/intel/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core  -liomp5 -lpthread... yes

checking for cheev_ in  -L/opt/intel/composer_xe_2013_sp1/mkl/lib/intel64 -L/opt/intel/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core  -liomp5 -lpthread... yes

………………………

You can see sgemm from BLAS and cheev from LAPACK are found from MKL libraries, as yes.

 

Now, we can go ahead and run the make to build the harminv.

$make

Make sure that we did everything allright and MKL and Intel compilers are linked by checking with ldd.

 

$ldd harminv

        linux-vdso.so.1 =>  (0x00007fff0fbff000)

        libmkl_intel_lp64.so => /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007fdc5e4b7000)

        libmkl_intel_thread.so => /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_intel_thread.so (0x00007fdc5d4f9000)

        libmkl_core.so => /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_core.so (0x00007fdc5be3b000)

        libiomp5.so => /opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libiomp5.so (0x00007fdc5bb20000)

        libifport.so.5 => /opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libifport.so.5 (0x00007fdc5b8f0000)

        libifcore.so.5 => /opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libifcore.so.5 (0x00007fdc5b5b0000)

        libimf.so => /opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libimf.so (0x00007fdc5b0e9000)

        libsvml.so => /opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libsvml.so (0x00007fdc5a4f1000)

        libm.so.6 => /lib64/libm.so.6 (0x0000003d08c00000)

        libirc.so => /opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libirc.so (0x00007fdc5a285000)

        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003d09400000)

        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003d14400000)

        libdl.so.2 => /lib64/libdl.so.2 (0x0000003d09000000)

        libc.so.6 => /lib64/libc.so.6 (0x0000003d08800000)

        /lib64/ld-linux-x86-64.so.2 (0x0000003d08000000)

        libintlc.so.5 => /opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libintlc.so.5 (0x00007fdc5a02d000)

 

Installation of harminv is done by switching to root and running make install.

$make install

 

For more complete information about compiler optimizations, see our Optimization Notice.