Commit 2c0e28a3 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

SuperBuild: update shark patch

parent 46d96922
diff -burN Shark.orig/CMakeLists.txt Shark/CMakeLists.txt
--- Shark.orig/CMakeLists.txt 2016-09-02 17:04:54.000000000 +0200
+++ Shark/CMakeLists.txt 2017-07-31 16:41:18.563473752 +0200
@@ -194,6 +194,8 @@
#####################################################################
# HDF5 configuration
#####################################################################
+option(ENABLE_HDF5 "Use HDF5" ON)
+if(ENABLE_HDF5)
find_package(HDF5 COMPONENTS C CXX HL QUIET)
mark_as_advanced(HDF5_DIR)
if(HDF5_FOUND)
@@ -215,7 +217,7 @@
else()
message(STATUS "HDF5 not found, skip")
endif()
-
+endif() #ENABLE_HDF5
#####################################################################
# ATLAS configuration
#####################################################################
diff --git a/CMakeLists.txt b/CMakeLists.txt
index df8be65..c6c3020 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -191,29 +191,32 @@ endif()
#####################################################################
# HDF5 configuration
#####################################################################
-find_package(HDF5 COMPONENTS C CXX HL QUIET)
-mark_as_advanced(HDF5_DIR)
-if(HDF5_FOUND)
- if(HDF5_C_COMPILER_EXECUTABLE AND HDF5_CXX_COMPILER_EXECUTABLE)
- message(STATUS "Checking HDF5 installation: HDF5 installation seems ok.")
- include_directories( ${HDF5_INCLUDE_DIR} )
- link_directories( ${HDF5_LIBRARY_DIR} )
- list(APPEND LINK_LIBRARIES ${HDF5_LIBRARIES})
- else()
- message(STATUS "Checking HDF5 installation:HDF5 package might be broken.")
- if(NOT( HDF5_C_COMPILER_EXECUTABLE))
- message(STATUS " C Compiler Extension not found.")
- endif()
- if(NOT( HDF5_CXX_COMPILER_EXECUTABLE))
- message(STATUS " CXX Compiler Extension not found.")
- endif()
- message(STATUS "Disabling HDF5.")
- unset( HDF5_FOUND )
- endif()
-else()
- message(STATUS "HDF5 not found, skip")
+option(ENABLE_HDF5 "Use HDF5" ON)
+
+if(ENABLE_HDF5)
+ find_package(HDF5 COMPONENTS C CXX HL QUIET)
+ mark_as_advanced(HDF5_DIR)
+ if(HDF5_FOUND)
+ if(HDF5_C_COMPILER_EXECUTABLE AND HDF5_CXX_COMPILER_EXECUTABLE)
+ message(STATUS "Checking HDF5 installation: HDF5 installation seems ok.")
+ include_directories( ${HDF5_INCLUDE_DIR} )
+ link_directories( ${HDF5_LIBRARY_DIR} )
+ list(APPEND LINK_LIBRARIES ${HDF5_LIBRARIES})
+ else()
+ message(STATUS "Checking HDF5 installation:HDF5 package might be broken.")
+ if(NOT( HDF5_C_COMPILER_EXECUTABLE))
+ message(STATUS " C Compiler Extension not found.")
+ endif()
+ if(NOT( HDF5_CXX_COMPILER_EXECUTABLE))
+ message(STATUS " CXX Compiler Extension not found.")
+ endif()
+ message(STATUS "Disabling HDF5.")
+ unset( HDF5_FOUND )
+ endif()
+ else()
+ message(STATUS "HDF5 not found, skip")
+ endif()
endif()
-
#####################################################################
# ATLAS configuration
#####################################################################
@@ -222,104 +225,104 @@ endif()
option( ENABLE_CBLAS "Use Installed Linear Algebra Library" ON )
if( ENABLE_CBLAS )
- set(CBLAS_VENDOR FALSE)
- if( APPLE )
- set(CBLAS_VENDOR "Accelerate")
- set(CBLAS_INCLUDES "")
- set(CBLAS_LIBRARIES "-framework Accelerate" )
- else()
- #todo: do a propper vendor check
- find_library(OPENBLAS_LIBRARY openblas
- HINTS ${CBLAS_ROOT}/lib /opt/local/lib
- )
- find_library(CBLAS_LIBRARY cblas
- HINTS ${ATLAS_ROOT}/lib ${CBLAS_ROOT}/lib /opt/local/lib /usr/lib64/atlas/
- )
- find_library(CLAPACK_LIBRARY lapack
- HINTS ${ATLAS_ROOT}/lib ${CBLAS_ROOT}/lib /opt/local/lib /usr/lib64/atlas/
- )
- find_library(ATLAS_LIBRARY atlas
- HINTS ${ATLAS_ROOT}/lib ${CBLAS_ROOT}/lib /opt/local/lib /usr/lib64/atlas/
- )
- mark_as_advanced(
- OPENBLAS_LIBRARY
- CBLAS_LIBRARY
- CLAPACK_LIBRARY
- ATLAS_LIBRARY
- )
- #find the cblas.h include path
- if(CBLAS_LIBRARY )
- get_filename_component(CBLAS_LIB_PATH ${CBLAS_LIBRARY} PATH )
- elseif( OPENBLAS_LIBRARY)
- get_filename_component(CBLAS_LIB_PATH ${OPENBLAS_LIBRARY} PATH )
- endif()
- if(CBLAS_LIB_PATH)
- find_file(CBLAS_INCLUDES cblas.h
- PATHS ${CBLAS_LIB_PATH} ${CBLAS_LIB_PATH}/../include
- )
- get_filename_component(CBLAS_INCLUDES ${CBLAS_INCLUDES} PATH )
- endif()
- if(ATLAS_LIBRARY)
- get_filename_component(ATLAS_LIBRARY_PATH ${ATLAS_LIBRARY} PATH )
- find_file(CLAPACK_INCLUDES clapack.h
- PATHS
- ${ATLAS_LIBRARY_PATH}
- ${ATLAS_LIBRARY_PATH}/../include
- ${ATLAS_LIBRARY_PATH}/../include/atlas
- ${ATLAS_LIBRARY_PATH}/../../include/atlas
- )
- get_filename_component(CLAPACK_INCLUDES ${CLAPACK_INCLUDES} PATH )
- set(CBLAS_INCLUDES ${CBLAS_INCLUDES} ${CLAPACK_INCLUDES})
- endif()
-
- if( OPENBLAS_LIBRARY AND CBLAS_INCLUDES)
- set(CBLAS_VENDOR "OpenBLAS")
- set(CBLAS_LIBRARIES ${OPENBLAS_LIBRARY})
- elseif( CBLAS_LIBRARY AND CLAPACK_LIBRARY AND ATLAS_LIBRARY AND CBLAS_INCLUDES)
- set(CBLAS_VENDOR "ATLAS")
- set(CBLAS_LIBRARIES ${CLAPACK_LIBRARY} ${CBLAS_LIBRARY} ${ATLAS_LIBRARY})
- elseif( CBLAS_LIBRARY AND CBLAS_INCLUDES)
- #check that we can compile a basic program with the libraries we have found
- #vendor versions might come with additional libraries which would be bad.
- try_compile(CBLAS_COMPILE
- "${PROJECT_BINARY_DIR}/cBlasCheck"
- "${CMAKE_SOURCE_DIR}/cBlasCheck.cpp"
- CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CBLAS_INCLUDES}"
- LINK_LIBRARIES ${CBLAS_LIBRARY}
- )
- if(CBLAS_COMPILE)
- set(CBLAS_VENDOR "GENERIC")
- set(CBLAS_LIBRARIES ${CBLAS_LIBRARY})
- else()
- message(WARNING "Unknown CBLAS. Can not use it")
- endif()
- endif()
- endif()
+ set(CBLAS_VENDOR FALSE)
+ if( APPLE )
+ set(CBLAS_VENDOR "Accelerate")
+ set(CBLAS_INCLUDES "")
+ set(CBLAS_LIBRARIES "-framework Accelerate" )
+ else()
+ #todo: do a propper vendor check
+ find_library(OPENBLAS_LIBRARY openblas
+ HINTS ${CBLAS_ROOT}/lib /opt/local/lib
+ )
+ find_library(CBLAS_LIBRARY cblas
+ HINTS ${ATLAS_ROOT}/lib ${CBLAS_ROOT}/lib /opt/local/lib /usr/lib64/atlas/
+ )
+ find_library(CLAPACK_LIBRARY lapack
+ HINTS ${ATLAS_ROOT}/lib ${CBLAS_ROOT}/lib /opt/local/lib /usr/lib64/atlas/
+ )
+ find_library(ATLAS_LIBRARY atlas
+ HINTS ${ATLAS_ROOT}/lib ${CBLAS_ROOT}/lib /opt/local/lib /usr/lib64/atlas/
+ )
+ mark_as_advanced(
+ OPENBLAS_LIBRARY
+ CBLAS_LIBRARY
+ CLAPACK_LIBRARY
+ ATLAS_LIBRARY
+ )
+ #find the cblas.h include path
+ if(CBLAS_LIBRARY )
+ get_filename_component(CBLAS_LIB_PATH ${CBLAS_LIBRARY} PATH )
+ elseif( OPENBLAS_LIBRARY)
+ get_filename_component(CBLAS_LIB_PATH ${OPENBLAS_LIBRARY} PATH )
+ endif()
+ if(CBLAS_LIB_PATH)
+ find_file(CBLAS_INCLUDES cblas.h
+ PATHS ${CBLAS_LIB_PATH} ${CBLAS_LIB_PATH}/../include
+ )
+ get_filename_component(CBLAS_INCLUDES ${CBLAS_INCLUDES} PATH )
+ endif()
+ if(ATLAS_LIBRARY)
+ get_filename_component(ATLAS_LIBRARY_PATH ${ATLAS_LIBRARY} PATH )
+ find_file(CLAPACK_INCLUDES clapack.h
+ PATHS
+ ${ATLAS_LIBRARY_PATH}
+ ${ATLAS_LIBRARY_PATH}/../include
+ ${ATLAS_LIBRARY_PATH}/../include/atlas
+ ${ATLAS_LIBRARY_PATH}/../../include/atlas
+ )
+ get_filename_component(CLAPACK_INCLUDES ${CLAPACK_INCLUDES} PATH )
+ set(CBLAS_INCLUDES ${CBLAS_INCLUDES} ${CLAPACK_INCLUDES})
+ endif()
+
+ if( OPENBLAS_LIBRARY AND CBLAS_INCLUDES)
+ set(CBLAS_VENDOR "OpenBLAS")
+ set(CBLAS_LIBRARIES ${OPENBLAS_LIBRARY})
+ elseif( CBLAS_LIBRARY AND CLAPACK_LIBRARY AND ATLAS_LIBRARY AND CBLAS_INCLUDES)
+ set(CBLAS_VENDOR "ATLAS")
+ set(CBLAS_LIBRARIES ${CLAPACK_LIBRARY} ${CBLAS_LIBRARY} ${ATLAS_LIBRARY})
+ elseif( CBLAS_LIBRARY AND CBLAS_INCLUDES)
+ #check that we can compile a basic program with the libraries we have found
+ #vendor versions might come with additional libraries which would be bad.
+ try_compile(CBLAS_COMPILE
+ "${PROJECT_BINARY_DIR}/cBlasCheck"
+ "${CMAKE_SOURCE_DIR}/cBlasCheck.cpp"
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CBLAS_INCLUDES}"
+ LINK_LIBRARIES ${CBLAS_LIBRARY}
+ )
+ if(CBLAS_COMPILE)
+ set(CBLAS_VENDOR "GENERIC")
+ set(CBLAS_LIBRARIES ${CBLAS_LIBRARY})
+ else()
+ message(WARNING "Unknown CBLAS. Can not use it")
+ endif()
+ endif()
+ endif()
- if(CBLAS_VENDOR)
- message(STATUS "CBLAS FOUND: " ${CBLAS_VENDOR} " with include directory " ${CBLAS_INCLUDES} )
- set(SHARK_USE_CBLAS 1)
- list(APPEND EXTRA_INCLUDE_DIRECTORIES ${CBLAS_INCLUDES} )
- list(APPEND LINK_LIBRARIES ${CBLAS_LIBRARIES})
- include_directories ( ${CBLAS_INCLUDES} )
- else()
- message(STATUS "No usable CBLAS Library found. No fast linear Algebra used.")
- endif()
+ if(CBLAS_VENDOR)
+ message(STATUS "CBLAS FOUND: " ${CBLAS_VENDOR} " with include directory " ${CBLAS_INCLUDES} )
+ set(SHARK_USE_CBLAS 1)
+ list(APPEND EXTRA_INCLUDE_DIRECTORIES ${CBLAS_INCLUDES} )
+ list(APPEND LINK_LIBRARIES ${CBLAS_LIBRARIES})
+ include_directories ( ${CBLAS_INCLUDES} )
+ else()
+ message(STATUS "No usable CBLAS Library found. No fast linear Algebra used.")
+ endif()
- #Special setup for ATLAS
- if( CBLAS_VENDOR MATCHES "ATLAS" )
- set( SHARK_USE_ATLAS_LAPACK 1) # ATLAS always contains some LAPACK methods that we can use
+ #Special setup for ATLAS
+ if( CBLAS_VENDOR MATCHES "ATLAS" )
+ set( SHARK_USE_ATLAS_LAPACK 1) # ATLAS always contains some LAPACK methods that we can use
- #check for full lapack
- set(CMAKE_REQUIRE_QUIET 1)
- set(CMAKE_REQUIRED_LIBRARIES ${CBLAS_LIBRARIES})
- check_function_exists(dsyev_ ATLAS_FULL_LAPACK)
+ #check for full lapack
+ set(CMAKE_REQUIRE_QUIET 1)
+ set(CMAKE_REQUIRED_LIBRARIES ${CBLAS_LIBRARIES})
+ check_function_exists(dsyev_ ATLAS_FULL_LAPACK)
- if( ATLAS_FULL_LAPACK )
- set( SHARK_USE_LAPACK 1)
- message(STATUS "Detected ATLAS with full LAPACK package. Using it!")
- endif()
- endif()
+ if( ATLAS_FULL_LAPACK )
+ set( SHARK_USE_LAPACK 1)
+ message(STATUS "Detected ATLAS with full LAPACK package. Using it!")
+ endif()
+ endif()
endif()
#####################################################################
# Static Code Analysis
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment