Skip to content

Commit

Permalink
fix: circuits should not link openmp with -DMULTITHREADING (#1929)
Browse files Browse the repository at this point in the history
We now have other multithreading paradigms. This aligns with
barretenberg.
  • Loading branch information
ludamad authored Sep 1, 2023
1 parent f09a848 commit cd1a685
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions circuits/cpp/cmake/threading.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
if(MULTITHREADING)
find_package(OpenMP REQUIRED)
message(STATUS "Multithreading is enabled.")
link_libraries(OpenMP::OpenMP_CXX)
add_compile_options(-pthread)
add_link_options(-pthread)
if(WASM)
add_compile_options(--target=wasm32-wasi-threads)
add_link_options(--target=wasm32-wasi-threads)
endif()
#add_compile_options(-fsanitize=thread)
#add_link_options(-fsanitize=thread)
else()
message(STATUS "Multithreading is disabled.")
add_definitions(-DNO_MULTITHREADING -DBOOST_SP_NO_ATOMIC_ACCESS)
add_definitions(-DNO_MULTITHREADING)
set(OMP_MULTITHREADING OFF)
endif()

if(OMP_MULTITHREADING)
find_package(OpenMP REQUIRED)
message(STATUS "OMP multithreading is enabled.")
link_libraries(OpenMP::OpenMP_CXX)
else()
message(STATUS "OMP multithreading is disabled.")
add_definitions(-DNO_OMP_MULTITHREADING)
endif()

if(DISABLE_TBB)
Expand Down

0 comments on commit cd1a685

Please sign in to comment.