Skip to content

Commit

Permalink
fix: Pass brew omp location via LDFLAGS and CPPFLAGS (AztecProtocol/b…
Browse files Browse the repository at this point in the history
  • Loading branch information
phated authored Feb 9, 2023
1 parent 3c447b8 commit c1130b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
3 changes: 3 additions & 0 deletions circuits/cpp/barretenberg/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
if [ "$ARCH" = "aarch64" ]; then
TOOLCHAIN=aarch64-linux-clang
Expand Down
17 changes: 0 additions & 17 deletions circuits/cpp/barretenberg/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

0 comments on commit c1130b0

Please sign in to comment.