Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6980 Discussions

OneMKL CMakelists.txt is incompatible with shipped CMake version in Docker image

sudoLife
New Contributor I
1,388 Views

I am using intel/oneapi:latest image. I tried compiling a simple hello world project with the following CMakeLists.txt:

 

cmake_minimum_required(VERSION 3.10)
project(dockertest)

set(CMAKE_CXX_STANDARD 17)

find_package(MKL)

add_executable(dockertest main.cpp)

 

The CMake version is 3.10.2.

 

 

/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /tmp/dockertest
-- MKL_ARCH: intel64
-- MKL_LINK: dynamic
-- MKL_INTERFACE_FULL: intel_ilp64
-- MKL_THREADING: intel_thread
-- MKL_MPI: intelmpi
-- Found MKL: intelmpi  
-- Found MKL: /opt/intel/oneapi/mkl/2022.0.1  
-- Found MKL: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_intel_ilp64.so  
-- Found MKL: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_core.so  
-- Found MKL: /opt/intel/oneapi/mkl/2022.0.1/lib/intel64/libmkl_intel_thread.so  
-- Found MKL: /opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64/libiomp5.so  
-- Configuring incomplete, errors occurred!
See also "/tmp/dockertest/cmake-build-debug-docker/CMakeFiles/CMakeOutput.log".
CMake Error at /usr/local/lib/cmake/mkl-2022.0.1/MKLConfig.cmake:448 (list):
  list does not recognize sub-command PREPEND
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


CMake Error at /usr/local/lib/cmake/mkl-2022.0.1/MKLConfig.cmake:449 (list):
  list does not recognize sub-command PREPEND
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


CMake Error at /usr/local/lib/cmake/mkl-2022.0.1/MKLConfig.cmake:450 (list):
  list does not recognize sub-command PREPEND
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


CMake Error at /usr/local/lib/cmake/mkl-2022.0.1/MKLConfig.cmake:729 (target_compile_options):
  Cannot specify compile options for imported target "MKL::MKL".
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


CMake Error at /usr/local/lib/cmake/mkl-2022.0.1/MKLConfig.cmake:738 (target_include_directories):
  Cannot specify include directories for imported target "MKL::MKL".
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)

 

 

As I understand, CMake added PREPEND in 3.15, so the current version has no clue what it is.

 

UPDATE: The reason this happened was, there is an old cmake in /usr/bin/cmake and a new one in /usr/local/bin/cmake, so all I had to do was use the new path. Why are there two of them?

0 Kudos
1 Solution
ShanmukhS_Intel
Moderator
1,349 Views

Hi,

 

Thanks for posting on Intel Communities.

 

>>UPDATE: The reason this happened was, there is an old cmake in /usr/bin/cmake and a new one in /usr/local/bin/cmake, so all I had to do was use the new path. Why are there two of them?

Could you please elaborate what do you mean by old cmake and new cmake as mentioned here.

 

Regarding the Cmake under the new path which was mentioned by you,

 

If you want to integrate oneMKL into your CMake projects, starting with the Intel® oneAPI Math Kernel Library (oneMKL) 2021.3 release, MKLConfig.cmake is provided as part of the package and installation. MKLConfig.cmake supports all oneMKL configurations, compilers, and runtimes, as the oneMKL product itself. Help/usage is provided in the top section of MKLConfig.cmake.

For more information about MKLConfig.cmake, kindly refer to below link.

 

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/getting-started/cmake-config-for-onemkl.html

 

We have tried executing with the provided CMakeLists.txt using /usr/bin/cmake as mentioned by you and we could see that configuration has been done successfully without any issue. 

cmake version used is 3.21.2.

Attached the screenshot for your reference.

ShanmukhS_Intel_0-1642507458015.png

 

Best Regards,

Shanmukh.SS

 

 

View solution in original post

0 Kudos
5 Replies
ShanmukhS_Intel
Moderator
1,350 Views

Hi,

 

Thanks for posting on Intel Communities.

 

>>UPDATE: The reason this happened was, there is an old cmake in /usr/bin/cmake and a new one in /usr/local/bin/cmake, so all I had to do was use the new path. Why are there two of them?

Could you please elaborate what do you mean by old cmake and new cmake as mentioned here.

 

Regarding the Cmake under the new path which was mentioned by you,

 

If you want to integrate oneMKL into your CMake projects, starting with the Intel® oneAPI Math Kernel Library (oneMKL) 2021.3 release, MKLConfig.cmake is provided as part of the package and installation. MKLConfig.cmake supports all oneMKL configurations, compilers, and runtimes, as the oneMKL product itself. Help/usage is provided in the top section of MKLConfig.cmake.

For more information about MKLConfig.cmake, kindly refer to below link.

 

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/getting-started/cmake-config-for-onemkl.html

 

We have tried executing with the provided CMakeLists.txt using /usr/bin/cmake as mentioned by you and we could see that configuration has been done successfully without any issue. 

cmake version used is 3.21.2.

Attached the screenshot for your reference.

ShanmukhS_Intel_0-1642507458015.png

 

Best Regards,

Shanmukh.SS

 

 

0 Kudos
sudoLife
New Contributor I
1,333 Views

Hi,

Thanks for the config link, I somehow missed it.


@ShanmukhS_Intel wrote:

Could you please elaborate what do you mean by old cmake and new cmake as mentioned here.

Here's what I mean. There are two cmakes.

root@4ecc5c5ba9d9:/# /usr/bin/cmake --version
cmake version 3.10.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
root@4ecc5c5ba9d9:/# /usr/local/bin/cmake --version
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
root@4ecc5c5ba9d9:/# 

 In bash, the default CMake picked up is the new one (/usr/local/bin/cmake), so everything works fine. However, CLion automatically picks the old CMake's path (/usr/bin/cmake), and that was the reason for my problem.

 

The question now is, why are there two CMakes installed in the first place?

0 Kudos
ShanmukhS_Intel
Moderator
1,332 Views

Hi,


Thank you for accepting our solution. If you need any additional information, please submit a new question as this thread will no longer be monitored.


Best Regards,

Shanmukh.SS


0 Kudos
mecej4
Honored Contributor III
1,326 Views

@sudoLife said, ".. there is an old cmake in /usr/bin/cmake and a new one in /usr/local/bin/cmake, so all I had to do was use the new path. Why are there two of them?"

Because you, or an administrator, or the installer of some other package, installed a newer version of cmake in the /usr/local tree. I think that there is a reason why add-ons should go into /usr/local rather than overwrite the original cmake in /usr/bin. Other users of the system, or even the Linux OS itself, may become unstable if experimental versions are allowed to replace the versions that the system came with.

I did this to myself once many years ago. A package that I was installing complained that the libc.so.6 that I had was too old for the new package to work. I obtained a newer version of libc.so.6, and replaced the existing version with this. The result of this careless action was that I had to reinstall Linux, because even commands such as ls stopped to work, as most of the system utilities depend on libc.so.6.

sudoLife
New Contributor I
1,321 Views

Yep you're right, intel installation must have depended on the new CMake, and so it was installed.

0 Kudos
Reply