Coder Social home page Coder Social logo

Comments (6)

Manamama avatar Manamama commented on September 28, 2024

Disable OpenMP in CmakeList.

Here:

~/downloads/CTranslate2 $ grep OpenMP CMakeLists.txt set(OPENMP_RUNTIME "NONE" CACHE STRING "OpenMP runtime (INTEL, COMP, NONE)")                                  find_package(OpenMP)                                 if(OpenMP_CXX_FOUND)                                   add_compile_options(${OpenMP_CXX_FLAGS})             message(STATUS "Using OpenMP: ${IOMP5_LIBRARY}")

from ctranslate2.

alexlnkp avatar alexlnkp commented on September 28, 2024

Disable OpenMP in CmakeList.

Here:

~/downloads/CTranslate2 $ grep OpenMP CMakeLists.txt set(OPENMP_RUNTIME "NONE" CACHE STRING "OpenMP runtime (INTEL, COMP, NONE)")                                  find_package(OpenMP)                                 if(OpenMP_CXX_FOUND)                                   add_compile_options(${OpenMP_CXX_FLAGS})             message(STATUS "Using OpenMP: ${IOMP5_LIBRARY}")

Does this disable non-CUDA computations completely? I'm not really familiar with OpenMP and such, so i'm not sure whether this is the solution or just a bandaid

The build files generated correctly though, i've managed to install libctranslate2 successfully!

from ctranslate2.

minhthuc2502 avatar minhthuc2502 commented on September 28, 2024

@alexlnkp Can you update full log of cmake? I think you have to review the process of installing oneapi.
Try to set : MKL_ROOT (not MKLROOT) to /opt/intel/oneapi/ . Maybe you could change this line in CMakeLists :

find_library(MKL_CORE_LIBRARY NAMES mkl_core PATHS ${MKL_ROOT}/lib ${MKL_ROOT}/lib/intel64)

to:

find_library(MKL_CORE_LIBRARY NAMES mkl_core HINTS ${MKL_ROOT}/lib ${MKL_ROOT}/lib/intel64)

Otherwise, related to the clean-chroot-build error, I think you don't have the correct version of gcc (14). See this.

from ctranslate2.

alexlnkp avatar alexlnkp commented on September 28, 2024

@alexlnkp Can you update full log of cmake? I think you have to review the process of installing oneapi. Try to set : MKL_ROOT (not MKLROOT) to /opt/intel/oneapi/ .
Didn't seem to help, still the same error Intel OpenMP runtime libiomp5 not found
Even pkgconf can find it without any issues, for some reason.

$ pkgconf --cflags --libs openmp
-I/opt/intel/oneapi/compiler/latest/linux/compiler/include -L/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64/ -liomp5

Maybe you could change this line in CMakeLists :

find_library(MKL_CORE_LIBRARY NAMES mkl_core PATHS ${MKL_ROOT}/lib ${MKL_ROOT}/lib/intel64)

to:

find_library(MKL_CORE_LIBRARY NAMES mkl_core HINTS ${MKL_ROOT}/lib ${MKL_ROOT}/lib/intel64)

Didn't seem to help either... The results were practically the same.
Without changes (MKL_ROOT is set):

-- The C compiler identification is GNU 14.1.1
-- The CXX compiler identification is GNU 14.1.1
-- 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
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Build spdlog: 1.10.0
-- Build type: Release
CMake Deprecation Warning at third_party/cpu_features/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for getauxval
-- Looking for getauxval - found
-- Compiling for multiple CPU ISA and enabling runtime dispatch
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
CMake Error at CMakeLists.txt:280 (message):
  Intel OpenMP runtime libiomp5 not found


-- Configuring incomplete, errors occurred!

With changes (MKL_ROOT is set):

-- The C compiler identification is GNU 14.1.1
-- The CXX compiler identification is GNU 14.1.1
-- 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
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Build spdlog: 1.10.0
-- Build type: Release
CMake Deprecation Warning at third_party/cpu_features/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for getauxval
-- Looking for getauxval - found
-- Compiling for multiple CPU ISA and enabling runtime dispatch
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
CMake Error at CMakeLists.txt:280 (message):
  Intel OpenMP runtime libiomp5 not found


-- Configuring incomplete, errors occurred!

Otherwise, related to the clean-chroot-build error, I think you don't have the correct version of gcc (14). See this.

Didn't seem that way at the time, but I'll look into that.

from ctranslate2.

minhthuc2502 avatar minhthuc2502 commented on September 28, 2024

Try change:
${INTEL_ROOT}/oneapi/compiler/latest/linux/compiler/lib/intel64_lin
To
${INTEL_ROOT}/oneapi/compiler/latest/linux/compiler/lib/intel64
It seems like the path of the libiomp5 is different with others paths defined in CMakeLists.

from ctranslate2.

alexlnkp avatar alexlnkp commented on September 28, 2024

Okay, so i made it work.

@alexlnkp Can you update full log of cmake? I think you have to review the process of installing oneapi. Try to set : MKL_ROOT (not MKLROOT) to /opt/intel/oneapi/

Turns out it's not MKL_ROOT env variable, it's INTELROOT, ONEAPI_ROOT, or MKLROOT. Just doing:

$ export INTELROOT=/opt/intel/

or

$ export MKLROOT=/opt/intel/oneapi

or

$ export ONEAPI_ROOT=/opt/intel/oneapi

Made it work.

As it turns out, by default, MKLROOT env variable is set to /opt/intel/oneapi/mkl/latest. So setting it to /opt/intel/oneapi does, indeed, fix the problem.

Maybe you could change this line in CMakeLists :

find_library(MKL_CORE_LIBRARY NAMES mkl_core PATHS ${MKL_ROOT}/lib ${MKL_ROOT}/lib/intel64)

to:

find_library(MKL_CORE_LIBRARY NAMES mkl_core HINTS ${MKL_ROOT}/lib ${MKL_ROOT}/lib/intel64)

Didn't seem to change anything at all for me. It might be more "correct", though, my issue is not related to this.

I believe that the issue is with the CMakeLists.txt file itself, since it makes sense that the MKLROOT env variable is set to point to the mkl itself, rather than oneapi.

from ctranslate2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.