baidu / puck

Puck is a high-performance ANN search engine
Apache License 2.0
329 stars 37 forks source link

docker 环境下mkl无法找到 #18

Closed JankinTian closed 9 months ago

JankinTian commented 10 months ago

错误描述如下: -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5")
-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
CMake Error at /home/app/cmake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find MKL (missing: MKL_LIBRARIES) Call Stack (most recent call first): /home/app/cmake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) cmake/FindMKL.cmake:360 (find_package_handle_standard_args) CMakeLists.txt:28 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/app/puck/build/CMakeFiles/CMakeOutput.log". See also "/home/app/puck/build/CMakeFiles/CMakeError.log".

当我使用 find / -name mkl 时发现可以找到mkl 结果如下: /opt/intel/oneapi/mkl /opt/intel/oneapi/mkl/2023.2.0/lib/cmake/mkl /opt/intel/oneapi/mkl/2023.2.0/modulefiles/mkl /opt/intel/oneapi/mkl/2023.2.0/include/oneapi/mkl /usr/include/boost/numeric/odeint/external/mkl

请问这个问题如何解决?

JankinTian commented 10 months ago

参考https://github.com/baidu/puck/issues/5#issuecomment-1709601280 中的信息,在cmake后添加 -DMKL_LIBRARIES=/opt/intel/oneapi/mkl/latest/lib/*.so 但是在make时出现下面的问题,

make[2]: No rule to make target '/opt/intel/oneapi/mkl/latest/lib/.so', needed by 'tools/build'. Stop. make[2]: ** Waiting for unfinished jobs.... [ 90%] Building CXX object tools/CMakeFiles/build.dir/__/puck/tinker/tinker_index.cpp.o CMakeFiles/Makefile2:354: recipe for target 'tools/CMakeFiles/build.dir/all' failed make[1]: [tools/CMakeFiles/build.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2

请问如何解决?

nk2014yj commented 10 months ago

https://github.com/baidu/puck/blob/main/ann-benchmarks/install/Dockerfile.puck_inmem

Different installation methods of the MKL library have different deployment paths. You can refer to this dockefile, and this installation method is not problematic.