Issue with OPENMP_RUNTIME set to "COMP"
envgap__OpenNMT__CTranslate2-1015
01 / FAILURE SIGNATURE
As reported upstream
`OpenMP_CXX_FOUND` variable causing the build to failed with error `OpenMP not found`.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
89c69c4d8c0bf7a3eb094b82eee72db5b477fb54- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
OpenNMT/CTranslate2 #1015 · read the original issue
If I set `OPENMP_RUNTIME` to `COMP`, cmake will add `/openmp` flag to msvc, but later on it will be test
`OpenMP_CXX_FOUND` variable causing the build to failed with error `OpenMP not found`.
CMakeLists.txt reference:
```cmake
if(NOT OPENMP_RUNTIME STREQUAL "NONE")
if(WIN32)
add_compile_options("/openmp")
else()
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
add_compile_options(${OpenMP_CXX_FLAGS})
endif()
endif()
if(OPENMP_RUNTIME STREQUAL "INTEL")
# Find Intel libraries.
find_library(IOMP5_LIBRARY iomp5 libiomp5md PATHS
${INTEL_ROOT}/lib
${INTEL_ROOT}/lib/intel64
${INTEL_ROOT}/compiler/lib/intel64
${INTEL_ROOT}/oneAPI/compiler/latest/windows/compiler/lib/intel64_win
${INTEL_ROOT}/oneapi/compiler/latest/linux/compiler/lib/intel64_lin
${INTEL_ROOT}/oneapi/compiler/latest/mac/compiler/lib
)
if(IOMP5_LIBRARY)
list(APPEND LIBRARIES ${IOMP5_LIBRARY})
message(STATUS "Using OpenMP: ${IOMP5_LIBRARY}")
else()
message(FATAL_ERROR "Intel OpenMP runtime libiomp5 not found")
endif()
if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /nodefaultlib:vcomp")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /nodefaultlib:vcomp")
endif()
elseif(OPENMP_RUNTIME STREQUAL "COMP")
if(OpenMP_CXX_FOUND)
list(APPEND LIBRARIES ${OpenMP_CXX_LIBRARIES})
message(STATUS "Using OpenMP: ${OpenMP_CXX_LIBRARIES}")
else()
message(FATAL_ERROR "OpenMP not found")
endif()
else()
message(FATAL_ERROR "Invalid OpenMP runtime ${OPENMP_RUNTIME}")
endif()
endif()
```04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]