0

I am having some issues after installing the MKL library on my Linux Intel machine (Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz). When I run cmake, I get the following error:

[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:90 ] _MKL_TEST_VERSIONS = 2011
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:92 ] MKL_ADDITIONAL_VERSIONS = 
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:94 ] MKL_USE_STATIC_LIBS = 
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:96 ] MKL_ROOT = /opt/intel/oneapi/mkl/2022.0.2
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:98 ] INTEL_ROOT = 
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:117 ] _MKL_ROOT_SEARCH_DIRS = /opt/intel/oneapi/mkl/2022.0.2;/opt/intel/composerxe-2011/mkl
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:130 ] location of mkl.h: /opt/intel/oneapi/mkl/2022.0.2/include/mkl.h
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:158 ] _INTEL_LIBRARY_DIR_SUFFIXES = lib;lib/intel64
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:160 ] _MKL_LIBRARY_SEARCH_DIRS = /opt/intel/oneapi/mkl/2022.0.2;/opt/intel/composerxe-2011/mkl;/opt/intel/oneapi/mkl/2022.0.2/include/..
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:205 ] Found mkl_rt: /opt/intel/oneapi/mkl/2022.0.2/lib/intel64/libmkl_rt.so
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:227 ] _INTEL_LIBRARY_SEARCH_DIRS = /compiler;/opt/intel/oneapi/mkl/2022.0.2/..;/opt/intel/oneapi/mkl/2022.0.2/../compiler;/opt/intel/composerxe-2011/mkl/..;/opt/intel/composerxe-2011/mkl/../compiler
[ /home/278926k/GSM/molecularGSM/cmake/FindMKL.cmake:313 ] MKL not found - the following libraries are missing: IOMP5;MATH

CMake Error at cmake/FindMKL.cmake:330 (message):
  Intel(R) MKL could not be found.
Call Stack (most recent call first):
  GSM/CMakeLists.txt:69 (find_package)

Section referred to in FindMKL.cmake:

set(MKL_FOUND TRUE)
if (NOT MKL_INCLUDE_DIR)
    set(MKL_FOUND FALSE)
    if (MKL_FIND_DEBUG)
        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
                       "MKL not found - MKL_INCLUDE_DIR was empty")
    endif()
elseif (_MKL_MISSING_LIBRARIES)
    set(MKL_FOUND FALSE)
    if (MKL_FIND_DEBUG)
        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
                       "MKL not found - the following libraries are missing: "
                       "${_MKL_MISSING_LIBRARIES}")
    endif()
endif()

if (MKL_FOUND)
    if (NOT MKL_FIND_QUIETLY OR MKL_FIND_DEBUG)
        message(STATUS
            "Intel(R) MKL was found:\n"
            "  MKL_INCLUDE_DIRS: ${MKL_INCLUDE_DIRS}\n"
            "  MKL_LIBRARY_DIRS: ${MKL_LIBRARY_DIRS}\n"
            "  MKL_LIBRARIES: ${MKL_LIBRARIES}"
        )
    endif()
else()
    if (MKL_FIND_REQUIRED)
        message(SEND_ERROR "Intel(R) MKL could not be found.")
    else()
        message(STATUS "Intel(R) MKL could not be found.")
    endif()
endif()

I am missing the IOMP5 and MATH libraries. Would this be an environment variable or installation issue on my end (e.g. I did not select the right options). Been at this for hours, still reading up on it, but posting here for help from those experienced with using MKL.

8
  • Did you run the setvars.sh script which is present in the default location? you can do it using the command -- source /opt/intel/oneapi/setvars.sh. This script sets the environmental variables for you when you source it. intel.com/content/www/us/en/develop/documentation/… Commented Mar 28, 2022 at 7:52
  • @Vidyalatha_Intel Yes I have sourced the setvars.sh file and recompiled but still end up with the same error. It seems that the IOMP5 and MATH libraries are particularly missing. Do you know a way to check for these in particular? Commented Mar 29, 2022 at 13:15
  • Ok, did you install oneAPI HPC Toolkit? Commented Mar 31, 2022 at 8:21
  • Could please check under this location regarding the missing files /opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin Commented Mar 31, 2022 at 16:34
  • @Vidyalatha_Intel yes confirming I am using OneAPI Toolkit - 'MKL_ROOT = /opt/intel/oneapi/mkl/2022.0.2' My current directory: '/opt/intel/oneapi/mkl/2022.0.2/lib/intel64' The content in this directory (ls) - link Is this what is expected? Seems different to the path you suggested. Commented Mar 31, 2022 at 21:35

1 Answer 1

1

Thanks for the details. I've tried to execute the installation instructions and could reproduce the issue which you are getting as missing libraries, well in my case it is just only MATH library. I've gone through the FindMKL.cmake file to understand what causes the issue. I found that the "this script has only been tested with Intel(R) Parallel Studio XE 2011".

As we are working with the oneMKL from oneAPI toolkits we need to set up the environment variables accordingly.

I've identified this piece of code in the FindMKL.cmake file

## Find OpenMP, pthread and math libraries
set(_INTEL_LIBRARY_SEARCH_DIRS
  ${INTEL_ROOT}
  ${INTEL_ROOT}/compiler

and thought of setting the INTELROOT environment variable as follows (this is the same path that I've mentioned in the comment section).

export INTELROOT=/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin

Another point to be noted is to load intel compilers as stated in step 2 of the instructions which can be done by running setvars script and using them during the cmake step.

Here I would like to clarify about types of Intel compilers.

Since you have mentioned that you just installed only oneAPI Base Toolkit, you will get only oneAPI C++/DPC++ compilers which can be invoked as icx & icpx (C and C++ compilers respectively).

cmake -D GSM_ENABLE_QCHEM=1 -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ../

If you install oneAPI HPC Toolkit (which i would encourage you to install this as well), you will get Intel classic compilers (icc & icpc)

cmake -D GSM_ENABLE_QCHEM=1 -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc ../

Now I could see that build is successful without any such missing libraries errors.

Here are the screenshots(done by using intel classic compilers icc/icpc, you can also use icx/icpx compilers but I observed there are just some warnings whereas with icc/icpc there are no warnings) for your reference.

output screen after cmake step enter image description here

output screen after make step enter image description here

As it worked successfully from my end I hope the same should happen for you as well.

Sign up to request clarification or add additional context in comments.

6 Comments

Thank you for giving this a try and for the best practice to install OneAPI HPC. I've followed your process but I still get the same missing IOMP5 and MATH libraries. For the IOMP5, I have traced its location to '/home/278926k/MKL/benchmarks_2022.0.2/linux/compiler/intel64', should I manually move this to the bin folder so it is included in $PATH? (I can see yours is in the bin folder) Thought that the script 'l_BaseKit_p_2022.1.2.146.sh' should have placed it in the appropriate location? Secondly, could you try GSM_ENABLE_GAUSSIAN=1 instead of GSM_ENABLE_QCHEM? Also works well? Thank you.
I checked with GSM_ENABLE_GAUSSIAN=1 option but could not see any errors and it is working fine.
@learner254 The path which I have set to INTELROOT contains version 2022.0.1, for your case, it should be 2022.0.2 I guess (as your MKL also comes from 2022.0.2.) Did you try changing the path accordingly?
Confirming I can now locate the IOMP_5 library after moving it to the bin folder which is great news. Still having trouble with the math library. This is the variable I've specified on my .bashrc file: export INTEL_ROOT=/opt/intel/oneapi/compiler/2022.0.2/linux/compiler/lib/intel64_lin. Yet when running cmake, I notice the variable is not specified: -- [ /home/278926k/GSM/Cgsm/molecularGSM/cmake/FindMKL.cmake:98 ] INTEL_ROOT = I have run 'source .bashrc' before using cmake and this still happens. Would you know what is causing this? Only this step left to go. Appreciate your help.
Hey, good to know that. Just try with INTELROOT not INTEL_ROOT, because in the FindMKL.cmake INTEL_ROOT is set to ENV{$INTELROOT}. So just try exporting the path with "INTELROOT". (you can find the same in my answer as well)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.