[mlpack] 14/44: Backport r17366.
Barak A. Pearlmutter
barak+git at pearlmutter.net
Mon Feb 15 19:35:53 UTC 2016
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to tag mlpack-1.0.11
in repository mlpack.
commit e4c96cbc70ed6d310b376557db1bd01c388c8861
Author: Ryan Curtin <ryan at ratml.org>
Date: Sun Dec 7 19:32:26 2014 +0000
Backport r17366.
---
CMake/FindArmadillo.cmake | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/CMake/FindArmadillo.cmake b/CMake/FindArmadillo.cmake
index 9c7bffb..9db6c73 100644
--- a/CMake/FindArmadillo.cmake
+++ b/CMake/FindArmadillo.cmake
@@ -37,7 +37,6 @@ find_path(ARMADILLO_INCLUDE_DIR
if(ARMADILLO_INCLUDE_DIR)
-
# ------------------------------------------------------------------------
# Extract version information from <armadillo>
# ------------------------------------------------------------------------
@@ -243,6 +242,12 @@ if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp")
endif()
endif()
+ if(NOT HDF5_FOUND)
+ # We tried but didn't find it.
+ message(FATAL_ERROR "Armadillo HDF5 support is enabled, but HDF5 "
+ "cannot be found on the system. Consider disabling HDF5 support.")
+ endif()
+
set(SUPPORT_INCLUDE_DIRS "${SUPPORT_INCLUDE_DIRS}" "${HDF5_INCLUDE_DIRS}")
set(SUPPORT_LIBRARIES "${SUPPORT_LIBRARIES}" "${HDF5_LIBRARIES}")
endif (NOT "${ARMA_USE_HDF5}" STREQUAL "")
@@ -250,7 +255,6 @@ if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp")
else("${ARMA_USE_WRAPPER}" STREQUAL "")
# Some older versions still require linking against HDF5 since they did not
# wrap libhdf5. This was true for versions older than 4.300.
-
if(NOT "${ARMA_USE_HDF5}" STREQUAL "" AND
"${ARMADILLO_VERSION_STRING}" VERSION_LESS "4.300.0")
message(STATUS "Armadillo HDF5 support is enabled and manual linking is "
@@ -276,10 +280,45 @@ if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/config.hpp")
link_directories("${HDF5_LIBRARY_DIRS}")
endif()
endif()
+ endif()
+
+ if(NOT HDF5_FOUND)
+ # We tried but didn't find it.
+ message(FATAL_ERROR "Armadillo HDF5 support is enabled, but HDF5 "
+ "cannot be found on the system. Consider disabling HDF5 support.")
+ endif()
+
+ set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
+ set(SUPPORT_LIBRARIES "${HDF5_LIBRARIES}")
+ endif()
+
+ # Versions between 4.300 and 4.500 did successfully wrap HDF5, but didn't have good support for setting the include directory correctly.
+ if(NOT "${ARMA_USE_HDF5}" STREQUAL "" AND
+ "${ARMADILLO_VERSION_STRING}" VERSION_GREATER "4.299.0" AND
+ "${ARMADILLO_VERSION_STRING}" VERSION_LESS "4.450.0")
+ message(STATUS "Armadillo HDF5 support is enabled and include "
+ "directories must be found.")
+ find_package(HDF5)
- set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
- set(SUPPORT_LIBRARIES "${HDF5_LIBRARIES}")
+ if(NOT HDF5_FOUND)
+ # On Debian systems, the HDF5 package has been split into multiple
+ # packages so that it is co-installable. But this may mean that the
+ # include files are hidden somewhere very odd that the FindHDF5.cmake
+ # script will not find. Thus, we'll also quickly check pkgconfig to see
+ # if there is information on what to use there.
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(HDF5 hdf5)
+ endif()
+ endif()
+
+ if(NOT HDF5_FOUND)
+ # We tried but didn't find it.
+ message(FATAL_ERROR "Armadillo HDF5 support is enabled, but HDF5 "
+ "cannot be found on the system. Consider disabling HDF5 support.")
endif()
+
+ set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
endif()
endif("${ARMA_USE_WRAPPER}" STREQUAL "")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list