CrayLabs / SmartSim

SmartSim Infrastructure Library.
BSD 2-Clause "Simplified" License
235 stars 37 forks source link

Cannot specify link libraries for target "caffe2::mkl" which is not built by this project. #734

Closed p3jitnath closed 1 month ago

p3jitnath commented 1 month ago

Description

Looks like the MKL linking issue is still happening.

CMake Error at /home/users/USERNAME/miniconda3/envs/venv/lib/python3.11/site-packages/smartsim/_core/build/RedisAI/package/libtorch/share/cmake/Caffe2/public/mkl.cmake:8 (target_include_directories):
  Cannot specify include directories for imported target "caffe2::mkl".
Call Stack (most recent call first):
  /home/users/USERNAME/miniconda3/envs/venv/lib/python3.11/site-packages/smartsim/_core/build/RedisAI/package/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:113 (include)
  /home/users/USERNAME/miniconda3/envs/venv/lib/python3.11/site-packages/smartsim/_core/build/RedisAI/package/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
  CMakeLists.txt:184 (FIND_PACKAGE)

CMake Error at /home/users/USERNAME/miniconda3/envs/venv/lib/python3.11/site-packages/smartsim/_core/build/RedisAI/package/libtorch/share/cmake/Caffe2/public/mkl.cmake:9 (target_link_libraries):
  Cannot specify link libraries for target "caffe2::mkl" which is not built
  by this project.
Call Stack (most recent call first):
  /home/users/USERNAME/miniconda3/envs/venv/lib/python3.11/site-packages/smartsim/_core/build/RedisAI/package/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:113 (include)
  /home/users/USERNAME/miniconda3/envs/venv/lib/python3.11/site-packages/smartsim/_core/build/RedisAI/package/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
  CMakeLists.txt:184 (FIND_PACKAGE)

How to reproduce

smart clean && smart build --device=cuda-11 --skip-tensorflow --skip-onnx -v

System

ashao commented 1 month ago

@p3jitnath Thanks for unconvering this for us. This was indeed a regression and I'll be putting up a fix for it very shortly.

ashao commented 1 month ago

@p3jitnath I was trying to reproduce this problem in a brand new Ubuntu install (without MKL installed). Diving into it it looks like the Caffe2 shipped with PyTorch 2.3.1 should work just fine if it fails to find MKL. I'm wondering if this behaviour is CMake version dependent; which version are you using? Also if you have the time, you can contact me at andrew dot shao at hpe dot com (replacing 'dot' and 'at' with their equivalent symbols) and we can try to troubleshoot this together.

p3jitnath commented 1 month ago

Thanks ... updating CMake to 3.26.4 solved it.