Fix OpenMP for osx
This commit is contained in:
parent
a087f7dc8a
commit
635a6c7bcd
@ -35,6 +35,7 @@ Requirements
|
||||
- SSL development libraries (including development headers, e.g. libssl-dev)
|
||||
- libFUSE version >= 2.8.6 (including development headers), on Mac OS X instead install osxfuse from https://osxfuse.github.io/
|
||||
- Python >= 2.7
|
||||
- OpenMP
|
||||
|
||||
You can use the following commands to install these requirements
|
||||
|
||||
@ -45,7 +46,7 @@ You can use the following commands to install these requirements
|
||||
sudo dnf install git gcc-c++ cmake make libcurl-devel boost-devel boost-static openssl-devel fuse-devel python
|
||||
|
||||
# Macintosh
|
||||
brew install cmake boost openssl
|
||||
brew install cmake boost openssl libomp
|
||||
|
||||
Build & Install
|
||||
---------------
|
||||
|
8
vendor/cryptopp/CMakeLists.txt
vendored
8
vendor/cryptopp/CMakeLists.txt
vendored
@ -5,6 +5,13 @@ add_library(cryptopp dummy.cpp)
|
||||
target_include_directories(cryptopp SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(NOT DISABLE_OPENMP)
|
||||
if(APPLE AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0"
|
||||
AND ßCMAKE_VERSION VERSION_LESS "3.8.0")
|
||||
# Workaround because older cmake on apple doesn't support FindOpenMP
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Xclang -fopenmp")
|
||||
target_link_libraries(cryptopp PRIVATE -lomp)
|
||||
else()
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS})
|
||||
@ -12,6 +19,7 @@ if(NOT DISABLE_OPENMP)
|
||||
else(OPENMP_FOUND)
|
||||
message(FATAL_ERROR "Did not find OpenMP. Build with -DDISABLE_OPENMP=ON if you want to allow this and are willing to take the performance hit.")
|
||||
endif(OPENMP_FOUND)
|
||||
endif()
|
||||
endif(NOT DISABLE_OPENMP)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user