From 49bcdcbb11637effef38f10c05baf0ef8d9c6dda Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Tue, 7 Feb 2023 12:16:14 -0700 Subject: [PATCH] fix: Pass brew omp location via LDFLAGS and CPPFLAGS --- cpp/bootstrap.sh | 3 +++ cpp/cmake/threading.cmake | 17 ----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/cpp/bootstrap.sh b/cpp/bootstrap.sh index 42cf25f6fc..8b1396d947 100755 --- a/cpp/bootstrap.sh +++ b/cpp/bootstrap.sh @@ -45,6 +45,9 @@ if [ "$OS" == "macos" ]; then else TOOLCHAIN=x86_64-apple-clang fi + + export LDFLAGS="-L$BREW_PREFIX/opt/libomp/lib" + export CPPFLAGS="-I$BREW_PREFIX/opt/libomp/include" else TOOLCHAIN=x86_64-linux-clang fi diff --git a/cpp/cmake/threading.cmake b/cpp/cmake/threading.cmake index f91b86b385..bf9508c003 100644 --- a/cpp/cmake/threading.cmake +++ b/cpp/cmake/threading.cmake @@ -1,20 +1,3 @@ -if(APPLE) - if(CMAKE_C_COMPILER_ID MATCHES "Clang") - set(OpenMP_C_FLAGS "-fopenmp") - set(OpenMP_C_FLAGS_WORK "-fopenmp") - set(OpenMP_C_LIB_NAMES "libomp") - set(OpenMP_C_LIB_NAMES_WORK "libomp") - set(OpenMP_libomp_LIBRARY "$ENV{BREW_PREFIX}/opt/libomp/lib/libomp.dylib") - endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(OpenMP_CXX_FLAGS "-fopenmp") - set(OpenMP_CXX_FLAGS_WORK "-fopenmp") - set(OpenMP_CXX_LIB_NAMES "libomp") - set(OpenMP_CXX_LIB_NAMES_WORK "libomp") - set(OpenMP_libomp_LIBRARY "$ENV{BREW_PREFIX}/opt/libomp/lib/libomp.dylib") - endif() -endif() - if(MULTITHREADING) find_package(OpenMP REQUIRED) message(STATUS "Multithreading is enabled.")