Parcourir la source

Added option for OpenMP, auto-detect was not working properly on OSX (surprise, surprise)

enhancement_3
Trevor Irons il y a 8 ans
Parent
révision
53efa3e30a
1 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 5
    3
      CMakeLists.txt

+ 5
- 3
CMakeLists.txt Voir le fichier

@@ -142,7 +142,7 @@ endif()
142 142
 include(CheckCXXCompilerFlag)
143 143
 CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)
144 144
 CHECK_CXX_COMPILER_FLAG(-std=c++0x COMPILER_SUPPORTS_CXX0X)
145
-CHECK_CXX_COMPILER_FLAG(-fopenmp COMPILER_SUPPORTS_OPENMP)
145
+
146 146
 if(COMPILER_SUPPORTS_CXX11)
147 147
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
148 148
 elseif(COMPILER_SUPPORTS_CXX0X)
@@ -151,8 +151,10 @@ else()
151 151
 	message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
152 152
 endif()
153 153
 
154
-if(COMPILER_SUPPORTS_OPENMP)
155
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
154
+option( LEMMA_USE_OPENMP  "Use OpenMP in Lemma" OFF)
155
+CHECK_CXX_COMPILER_FLAG(-fopenmp COMPILER_SUPPORTS_OPENMP)
156
+if(COMPILER_SUPPORTS_OPENMP AND LEMMA_USE_OPENMP )
157
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -DLEMMAUSEOMP")
156 158
 endif()
157 159
 
158 160
 set(LEMMA_VERSION_MAJOR "0")

Chargement…
Annuler
Enregistrer