Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pass brew omp location via LDFLAGS and CPPFLAGS #126

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cpp/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions cpp/cmake/threading.cmake
Original file line number Diff line number Diff line change
@@ -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.")
Expand Down