Browse Source

Link with iomp5 on Apple instead of libomp for better interopreability with Anaconda

master
Trevor Irons 5 years ago
parent
commit
b059847017
3 changed files with 30 additions and 16 deletions
  1. 5
    1
      CMake/SuperBuild.cmake
  2. 17
    13
      CMakeLists.txt
  3. 8
    2
      Modules/DCIP/CMakeLists.txt

+ 5
- 1
CMake/SuperBuild.cmake View File

21
     message( STATUS "YAML-CPP was found ${yaml-cpp_FOUND}" )
21
     message( STATUS "YAML-CPP was found ${yaml-cpp_FOUND}" )
22
 else()
22
 else()
23
     message( STATUS "YAML-CPP WAS NOT FOUND, BUILDING" )
23
     message( STATUS "YAML-CPP WAS NOT FOUND, BUILDING" )
24
+
24
     ExternalProject_Add(YAML_CPP
25
     ExternalProject_Add(YAML_CPP
25
         GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
26
         GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
26
-        GIT_TAG "master" # "yaml-cpp-0.6.2", # "master" 
27
+        GIT_TAG "yaml-cpp-0.6.3"  # "master" 
27
         UPDATE_COMMAND ""
28
         UPDATE_COMMAND ""
28
         PATCH_COMMAND ""
29
         PATCH_COMMAND ""
29
         PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
30
         PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
34
                    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
35
                    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
35
                    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
36
                    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
36
                    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
37
                    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
38
+                   -DCMAKE_CXX_STANDARD=14
39
+                   -DCMAKE_CXX_STANDARD_REQUIRED=ON
40
+                   -DCMAKE_CXX_EXTENSIONS=OFF
37
     )
41
     )
38
 endif()
42
 endif()
39
 
43
 

+ 17
- 13
CMakeLists.txt View File

281
 if (LEMMA_USE_OPENMP)
281
 if (LEMMA_USE_OPENMP)
282
 
282
 
283
     if(APPLE)
283
     if(APPLE)
284
-        if(CMAKE_C_COMPILER_ID MATCHES "Clang")
285
-            set(OpenMP_C "${CMAKE_C_COMPILER}")
286
-            set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
287
-            set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
288
-            set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
289
-            set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
290
-            set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
291
-        endif()
284
+        #if(CMAKE_C_COMPILER_ID MATCHES "Clang")
285
+        #    set(OpenMP_C "${CMAKE_C_COMPILER}")
286
+        #    set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
287
+        #    set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
288
+        #    set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
289
+        #    set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
290
+        #    set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
291
+        #endif()
292
         if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
292
         if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
293
+            find_library( libiomp5 NAMES  libiomp5.dylib PATHS "/anaconda3/lib/" REQUIRED )
293
             set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
294
             set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
294
-            set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
295
-            set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
296
-            set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
297
-            set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
298
-            set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
295
+            set(OpenMP_CXX_FLAGS "-fopenmp=libiomp5 -Wno-unused-command-line-argument")
296
+            set(OpenMP_CXX_LIB_NAMES "libiomp5") #"libomp" "libgomp" "libiomp5")
297
+            #set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
298
+            #set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
299
+            set(OpenMP_libiomp5_LIBRARY libiomp5 )# ${OpenMP_CXX_LIB_NAMES})
300
+            set(OpenMP_LIBRARIES  libiomp5)
301
+            link_directories("/anaconda3/lib")
302
+    #        find_package(OpenMP REQUIRED)
299
     #         set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include")
303
     #         set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include")
300
     #         " -DOpenMP_CXX_LIB_NAMES=\"omp\" -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib ")
304
     #         " -DOpenMP_CXX_LIB_NAMES=\"omp\" -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib ")
301
     #         set(OpenMP_CXX_LIB_NAMES "omp") # "libgomp" "libiomp5")
305
     #         set(OpenMP_CXX_LIB_NAMES "omp") # "libgomp" "libiomp5")

+ 8
- 2
Modules/DCIP/CMakeLists.txt View File

1
-# Configure EMSchur3D 
1
+option ( LEMMA_MODULE_DCIP TRUE )
2
+
3
+if (LEMMA_MODULE_DCIP)
4
+
5
+# Configure DCIP 
2
 set(DCIP_VERSION_MAJOR "0")
6
 set(DCIP_VERSION_MAJOR "0")
3
 set(DCIP_VERSION_MINOR "0")
7
 set(DCIP_VERSION_MINOR "0")
4
 set(DCIP_VERSION_PATCH "1")
8
 set(DCIP_VERSION_PATCH "1")
5
 set(DCIP_VERSION "\"${DCIP_VERSION_MAJOR}.${DCIP_VERSION_MINOR}.${DCIP_VERSION_PATCH}\"")
9
 set(DCIP_VERSION "\"${DCIP_VERSION_MAJOR}.${DCIP_VERSION_MINOR}.${DCIP_VERSION_PATCH}\"")
6
 set(DCIP_VERSION_NOQUOTES "${DCIP_VERSION_MAJOR}.${DCIP_VERSION_MINOR}.${DCIP_VERSION_PATCH}")
10
 set(DCIP_VERSION_NOQUOTES "${DCIP_VERSION_MAJOR}.${DCIP_VERSION_MINOR}.${DCIP_VERSION_PATCH}")
7
 
11
 
8
-option ( LEMMA_MODULE_DCIP TRUE )
12
+
9
 
13
 
10
 configure_file (
14
 configure_file (
11
 	"${CMAKE_CURRENT_SOURCE_DIR}/config/DCIPConfig.h.in"
15
 	"${CMAKE_CURRENT_SOURCE_DIR}/config/DCIPConfig.h.in"
48
 	#if (LEMMA_BUILD_EXAMPLES)
52
 	#if (LEMMA_BUILD_EXAMPLES)
49
 	#	add_subdirectory(examples)
53
 	#	add_subdirectory(examples)
50
 	#endif()
54
 	#endif()
55
+
56
+endif()

Loading…
Cancel
Save