[Git][debian-gis-team/otb][upstream] New upstream version 6.6.0~rc4+dfsg

Bas Couwenberg gitlab at salsa.debian.org
Tue Jun 12 12:41:48 BST 2018


Bas Couwenberg pushed to branch upstream at Debian GIS Project / otb


Commits:
b88b1862 by Bas Couwenberg at 2018-06-12T09:59:43+02:00
New upstream version 6.6.0~rc4+dfsg
- - - - -


3 changed files:

- CMake/FindShark.cmake
- CMakeLists.txt
- Modules/ThirdParty/Shark/otb-module-init.cmake


Changes:

=====================================
CMake/FindShark.cmake
=====================================
--- a/CMake/FindShark.cmake
+++ b/CMake/FindShark.cmake
@@ -97,11 +97,24 @@ if(SHARK_CONFIG_FILE)
   "${SHARK_VERSION_MAJOR}.${SHARK_VERSION_MINOR}.${SHARK_VERSION_PATCH}")
 endif()
 
+# reset required flags
+set(SHARK_REQUIRED_C_FLAGS "")
+set(SHARK_REQUIRED_CXX_FLAGS "")
+set(SHARK_REQUIRED_LINK_FLAGS "")
+
 # Check if Shark was built with OpenMP, CBLAS, DYNLIB, ...
 file(STRINGS "${SHARK_INCLUDE_DIR}/shark/Core/Shark.h" SHARK_H_CONTENTS)
 
 if(SHARK_H_CONTENTS MATCHES "#define.SHARK_USE_OPENMP")
   set(SHARK_USE_OPENMP 1)
+  find_package(OpenMP QUIET)
+  if(OPENMP_FOUND)
+    set(SHARK_REQUIRED_C_FLAGS "${SHARK_REQUIRED_C_FLAGS} ${OpenMP_C_FLAGS}")
+    set(SHARK_REQUIRED_CXX_FLAGS "${SHARK_REQUIRED_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+    if(OpenMP_EXE_LINKER_FLAGS)
+      set(SHARK_REQUIRED_LINK_FLAGS "${SHARK_REQUIRED_LINK_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+    endif()
+  endif()
 else()
   set(SHARK_USE_OPENMP 0)
 endif()


=====================================
CMakeLists.txt
=====================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -233,7 +233,14 @@ endif()
 option(OTB_USE_DEPRECATED "Turn on the use and test of deprecated classes" OFF)
 mark_as_advanced(OTB_USE_DEPRECATED)
 
+# Although the OpenMP option looks like a 3rd party module, it is NOT. This option
+# is handled with other compilation flags in file OTBSetStandardCompilerFlags.cmake
+# before any module is parsed or enabled (see OTBModuleEnablement.cmake later on
+# during configure). Trying to modify this option from any module is
+# useless. Any 3rd party module dragging OpenMP should append
+# the corresponding flags to CMAKE_CXX_FLAGS, CMAKE_EXE_LINKER_FLAGS, and so on.
 option(OTB_USE_OPENMP "Add openmp compiler and linker flags" OFF)
+
 option(OTB_USE_SSE_FLAGS "Enable SIMD optimizations (hardware dependent)." ON)
 
 include(OTBSetStandardCompilerFlags)


=====================================
Modules/ThirdParty/Shark/otb-module-init.cmake
=====================================
--- a/Modules/ThirdParty/Shark/otb-module-init.cmake
+++ b/Modules/ThirdParty/Shark/otb-module-init.cmake
@@ -22,8 +22,13 @@ find_package ( Shark REQUIRED )
 
 if ( SHARK_USE_OPENMP AND NOT OTB_USE_OPENMP )
   message(WARNING "Shark library is built with OpenMP and you have OTB_USE_OPENMP set to OFF.\
-   It will be turned to ON to allow compilation.")
-  set( OTB_USE_OPENMP "ON" CACHE BOOL "Add openmp compiler and linker flags" FORCE )
+   It will be enabled anyway to allow compilation.")
 endif()
 
+#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SHARK_REQUIRED_C_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SHARK_REQUIRED_CXX_FLAGS}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SHARK_REQUIRED_LINK_FLAGS}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SHARK_REQUIRED_LINK_FLAGS}")
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${SHARK_REQUIRED_LINK_FLAGS}")
+
 mark_as_advanced( Shark_DIR )



View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/commit/b88b1862076e9841d9b4ff92ecd32bf39da426e5

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/commit/b88b1862076e9841d9b4ff92ecd32bf39da426e5
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20180612/b06760cf/attachment-0001.html>


More information about the Pkg-grass-devel mailing list