From eb1778a15f3ec526dc67a5f474b9aa569824718b Mon Sep 17 00:00:00 2001 From: inabao <37021995+inabao@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:10:46 +0800 Subject: [PATCH] fix the issue of symbols defined in omp not found (#53) * fix the issue of symbols defined in omp not found Signed-off-by: jinjiabao.jjb --- extern/mkl/mkl.cmake | 9 ++++++--- extern/roaringbitmap/roaringbitmap.cmake | 4 +--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extern/mkl/mkl.cmake b/extern/mkl/mkl.cmake index 93e804ad..09c12cb2 100644 --- a/extern/mkl/mkl.cmake +++ b/extern/mkl/mkl.cmake @@ -59,8 +59,11 @@ if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" AND ENABLE_INTEL_MKL) endforeach() message ("enable intel-mkl as blas backend") else () - set (BLAS_LIBRARIES - libopenblas.a - ) + set(BLAS_LIBRARIES libopenblas.a) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + list(PREPEND BLAS_LIBRARIES omp) + else() + list(PREPEND BLAS_LIBRARIES gomp) + endif() message ("enable openblas as blas backend") endif () diff --git a/extern/roaringbitmap/roaringbitmap.cmake b/extern/roaringbitmap/roaringbitmap.cmake index 29ace02b..d4e4c60c 100644 --- a/extern/roaringbitmap/roaringbitmap.cmake +++ b/extern/roaringbitmap/roaringbitmap.cmake @@ -22,12 +22,10 @@ if (DISABLE_AVX512_FORCE OR NOT COMPILER_AVX512_SUPPORTED) set (ROARING_DISABLE_AVX512 ON) endif () -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function") -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") - # exclude roaringbitmap in vsag installation FetchContent_GetProperties(roaringbitmap) if(NOT roaringbitmap_POPULATED) FetchContent_Populate(roaringbitmap) add_subdirectory(${roaringbitmap_SOURCE_DIR} ${roaringbitmap_BINARY_DIR} EXCLUDE_FROM_ALL) + target_compile_options(roaring PRIVATE -Wno-unused-function) endif()