diff options
author | dkazanc <dkazanc@hotmail.com> | 2018-02-08 16:12:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-08 16:12:10 +0000 |
commit | eb2633a1cd839a3cc9af23b95c0257648ad7e4d5 (patch) | |
tree | 3c4f115f8b6ef9100d46d5dd4e535fee293d2bc2 | |
parent | 24675d1f2ef13356697a2b99dfdaf07f0ce13ff7 (diff) | |
parent | 7854e3486d23cf1b30832de0efa94583200d379d (diff) | |
download | regularization-eb2633a1cd839a3cc9af23b95c0257648ad7e4d5.tar.gz regularization-eb2633a1cd839a3cc9af23b95c0257648ad7e4d5.tar.bz2 regularization-eb2633a1cd839a3cc9af23b95c0257648ad7e4d5.tar.xz regularization-eb2633a1cd839a3cc9af23b95c0257648ad7e4d5.zip |
Merge pull request #30 from vais-ral/openmp
Openmp
-rw-r--r-- | Core/CMakeLists.txt | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 070b45c..fec49da 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -33,7 +33,14 @@ if (Boost_FOUND) message("Boost library dir " ${Boost_LIBRARY_DIRS}) message("Boost libraries " ${Boost_LIBRARIES}) endif() - + +find_package(OpenMP) +if (OPENMP_FOUND) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") +endif() + ## Build the regularizers package as a library message("Creating Regularizers as shared library") @@ -42,7 +49,9 @@ message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") set(CMAKE_BUILD_TYPE "Release") if(WIN32) - set (FLAGS "/DWIN32 /EHsc /DBOOST_ALL_NO_LIB /openmp /DCCPiCore_EXPORTS") + set (FLAGS "/DWIN32 /EHsc /DBOOST_ALL_NO_LIB /DCCPiCore_EXPORTS /openmp") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT.lib") set (EXTRA_LIBRARIES @@ -53,14 +62,20 @@ if(WIN32) message("library lib: ${LIBRARY_LIB}") elseif(UNIX) - set (FLAGS "-fopenmp -O2 -funsigned-char -Wall -Wl,--no-undefined -DCCPiReconstructionIterative_EXPORTS -std=c++0x") + set (FLAGS "-O2 -funsigned-char -Wall -Wl,--no-undefined -DCCPiReconstructionIterative_EXPORTS ") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") + set (EXTRA_LIBRARIES ${Boost_LIBRARIES} #"tiff" "gomp" + "m" ) endif() +message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") + ## Build the regularizers package as a library message("Adding regularizers as shared library") |