omp.h still required when invoking -DOPENMP=FALSE in CMake build
Closed this issue · 1 comments
rlorigro commented
Hi,
Not sure if this is just something weird about my linking/building method, but when I do the following:
ExternalProject_Add(project_wfa
URL https://github.com/smarco/WFA2-lib/archive/refs/tags/v2.3.5.tar.gz
TIMEOUT 5
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/external/wfa2 -DCMAKE_BUILD_TYPE=Release -DOPENMP=FALSE -DCMAKE_INSTALL_RPATH=${CMAKE_SOURCE_DIR}/external/wfa2/lib/
INSTALL_COMMAND make install
)
add_library(wfa2 SHARED IMPORTED)
set_property(TARGET wfa2
PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/external/wfa2/lib/libwfa2cpp.${LIB_SUFFIX})
add_dependencies(wfa2 project_wfa)
add_dependencies(sv_merge wfa2)
# Specify include dir
include_directories(
${CMAKE_SOURCE_DIR}/external/wfa2/include/wfa2lib
)
I get the error:
[ 73%] Built target wfa2cpp
[ 74%] Built target wfa2cpp_static
[ 75%] Building C object CMakeFiles/align_benchmark.dir/tools/align_benchmark/align_benchmark.c.o
/Users/rlorigro/code/sv_merge/build/project_wfa-prefix/src/project_wfa/tools/align_benchmark/align_benchmark.c:32:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
make[5]: *** [CMakeFiles/align_benchmark.dir/tools/align_benchmark/align_benchmark.c.o] Error 1
make[4]: *** [CMakeFiles/align_benchmark.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [project_wfa-prefix/src/project_wfa-stamp/project_wfa-build] Error 2
make[1]: *** [CMakeFiles/project_wfa.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
On a MacOS M1 .
Ideally the USEOPENMP=FALSE flag would remove the dependency on the omp.h header, right? Or even the CMAKE_BUILD_TYPE=Release could disable tests/benchmarks?
Thanks
smarco commented
Thanks!