Parcourir la source

Compile work for MSVC, OpenMP is not found by CMake on test box

submodule
John Daily il y a 6 ans
Parent
révision
4173863a14
2 fichiers modifiés avec 15 ajouts et 6 suppressions
  1. 14
    6
      CMakeLists.txt
  2. 1
    0
      Modules/FDEM1D/src/GQChave.cpp

+ 14
- 6
CMakeLists.txt Voir le fichier

@@ -70,7 +70,11 @@ ExternalProject_Add(YAML-CPP
70 70
 	PATCH_COMMAND ""
71 71
     PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
72 72
     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
73
-		-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
73
+ 	       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
74
+	       -DYAML_CPP_BUILD_TESTS=OFF 
75
+	       #-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /  
76
+	       #-DCXX_STANDARD=11 /
77
+	       #-DCXX_STANDARD_REQUIRED=ON 
74 78
 )
75 79
 add_compile_options(-DHAVE_YAMLCPP) 
76 80
 
@@ -217,11 +221,15 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
217 221
 option( LEMMA_BUILD_EXAMPLES "Compile example Lemma applications" OFF )
218 222
 
219 223
 option( LEMMA_USE_OPENMP  "Use OpenMP in Lemma" OFF)
220
-find_package(OpenMP)
221
-if (OPENMP_FOUND AND LEMMA_USE_OPENMP)
222
-    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
223
-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
224
-    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
224
+if (LEMMA_USE_OPENMP)
225
+    find_package(OpenMP)
226
+    if (OPENMP_FOUND)
227
+        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
228
+        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
229
+        set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
230
+    else()
231
+	message (FATAL ERROR "OpenMP cannot be found, but was specified!")
232
+    endif()
225 233
 endif()
226 234
 
227 235
 set(LEMMA_VERSION_MAJOR "0")

+ 1
- 0
Modules/FDEM1D/src/GQChave.cpp Voir le fichier

@@ -1135,6 +1135,7 @@ namespace Lemma{
1135 1135
 #else
1136 1136
     Real GQChave::Jbess(const Real &x, const int &IORDER) {
1137 1137
         std::cerr << "GQChave requires boost special functions module";
1138
+        return 0;
1138 1139
     }
1139 1140
 #endif
1140 1141
     //////////////////////////////////////////////////////

Chargement…
Annuler
Enregistrer