Doesn't build without docker. libiomp5 not found
alexlnkp opened this issue · comments
Getting Intel OpenMP runtime libiomp5 not found
error, even though i DO have libiomp5.
System info:
OS: Arch Linux x86_64
Kernel: Linux 6.8.9-arch1-2
WM: Hyprland (Wayland)
CPU: 12th Gen Intel(R) Core(TM) i5-12400F (12) @ 4.40 GHz
GPU: NVIDIA GeForce RTX 3060 Lite Hash Rate [Discrete]
Env vars:
$ printenv | grep intel
MKLROOT=/opt/intel/oneapi/mkl/latest
Location of libiomp5.so and libiomp5_db.so: /opt/intel/oneapi/lib/intel64/libiomp5*.so
Tried setting MKLROOT to paths like /opt/intel/mkl/
and /opt/intel/
, nothing.
I installed mkl as a package using pacman, here are all the intel-related packages i have:
intel-oneapi-common 2023.2.0-1
intel-oneapi-compiler-dpcpp-cpp-runtime 2023.2.0-1
intel-oneapi-compiler-dpcpp-cpp-runtime-libs 2023.2.0-1
intel-oneapi-compiler-shared-runtime 2023.2.0-1
intel-oneapi-compiler-shared-runtime-libs 2023.2.0-1
intel-oneapi-mkl 2023.2.0_49495-2
intel-oneapi-openmp 2023.2.0-1
intel-oneapi-tbb 2021.10.0-3
intel-ucode 20240514-1
CMake and stuff:
cmake 3.29.3-1
extra-cmake-modules 6.2.0-1
Tried building on master branch and few latest tags, none of those worked.
Tried using a package on AUR of arch, ctranslate2
Didn't work regularly, tried to build in a clean chroot but to not avail either.
Here's the error message for the clean-chroot-build error, just in case:
[ 37%] Building NVCC (Device) object CMakeFiles/ctranslate2.dir/src/ops/flash-attention/ctranslate2_generated_flash_fwd_split_hdim96_fp16_sm80.cu.o
nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used
nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used
/usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/c++config.h(827): error: user-defined literal operator not found
typedef __decltype(0.0bf16) __bfloat16_t;
^
/usr/include/c++/14.1.1/type_traits(529): error: type name is not allowed
: public __bool_constant<__is_array(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(529): error: identifier "__is_array" is undefined
: public __bool_constant<__is_array(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(581): error: type name is not allowed
: public __bool_constant<__is_member_object_pointer(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(581): error: identifier "__is_member_object_pointer" is undefined
: public __bool_constant<__is_member_object_pointer(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(603): error: type name is not allowed
: public __bool_constant<__is_member_function_pointer(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(603): error: identifier "__is_member_function_pointer" is undefined
: public __bool_constant<__is_member_function_pointer(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(695): error: type name is not allowed
: public __bool_constant<__is_reference(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(695): error: identifier "__is_reference" is undefined
: public __bool_constant<__is_reference(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(731): error: type name is not allowed
: public __bool_constant<__is_object(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(731): error: identifier "__is_object" is undefined
: public __bool_constant<__is_object(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(760): error: type name is not allowed
: public __bool_constant<__is_member_pointer(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(760): error: identifier "__is_member_pointer" is undefined
: public __bool_constant<__is_member_pointer(_Tp)>
^
/usr/include/c++/14.1.1/type_traits(3247): error: type name is not allowed
inline constexpr bool is_array_v = __is_array(_Tp);
^
/usr/include/c++/14.1.1/type_traits(3271): error: type name is not allowed
__is_member_object_pointer(_Tp);
^
/usr/include/c++/14.1.1/type_traits(3281): error: type name is not allowed
__is_member_function_pointer(_Tp);
^
/usr/include/c++/14.1.1/type_traits(3298): error: type name is not allowed
inline constexpr bool is_reference_v = __is_reference(_Tp);
^
/usr/include/c++/14.1.1/type_traits(3315): error: type name is not allowed
inline constexpr bool is_object_v = __is_object(_Tp);
^
/usr/include/c++/14.1.1/type_traits(3328): error: type name is not allowed
inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
^
/usr/include/c++/14.1.1/bits/utility.h(237): error: __type_pack_element is not a template
{ using type = __type_pack_element<_Np, _Types...>; };
^
/usr/include/c++/14.1.1/type_traits(138): error: class "std::enable_if<<error-constant>, void>" has no member "type"
using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
^
detected during:
instantiation of type "std::__enable_if_t<<error-constant>, void>" at line 176
instantiation of "std::__detail::__or_fn" based on template arguments <std::is_reference<std::_Any_data>, std::is_function<std::_Any_data>, std::is_void<std::_Any_data>, std::__is_array_unknown_bounds<std::_Any_data>> at line 194
instantiation of class "std::__or_<_Bn...> [with _Bn=<std::is_reference<std::_Any_data>, std::is_function<std::_Any_data>, std::is_void<std::_Any_data>, std::__is_array_unknown_bounds<std::_Any_data>>]" at line 1171
instantiation of class "std::is_move_constructible<_Tp> [with _Tp=std::_Any_data]" at line 199
instantiation of class "std::__and_<_Bn...> [with _Bn=<std::__not_<std::__is_tuple_like<std::_Any_data>>, std::is_move_constructible<std::_Any_data>, std::is_move_assignable<std::_Any_data>>]" at line 558 of /usr/include/c++/14.1.1/bits/std_function.h
21 errors detected in the compilation of "/build/ctranslate2/src/CTranslate2/src/ops/flash-attention/flash_fwd_split_hdim96_fp16_sm80.cu".
CMake Error at ctranslate2_generated_flash_fwd_split_hdim96_fp16_sm80.cu.o.Release.cmake:280 (message):
Error generating file
/build/ctranslate2/src/build/CMakeFiles/ctranslate2.dir/src/ops/flash-attention/./ctranslate2_generated_flash_fwd_split_hdim96_fp16_sm80.cu.o
make[2]: *** [CMakeFiles/ctranslate2.dir/build.make:371: CMakeFiles/ctranslate2.dir/src/ops/flash-attention/ctranslate2_generated_flash_fwd_split_hdim96_fp16_sm80.cu.o] Error 1
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}")
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!
@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.
@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 errorIntel 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.
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.
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.