[mlpack] 91/149: Better handling of the weird case when includes are needed but the library isn't.
Barak A. Pearlmutter
barak+git at pearlmutter.net
Sat May 2 09:11:13 UTC 2015
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch svn-trunk
in repository mlpack.
commit faee609f874f5aa3e03fb5e22200e9d4fa5fee16
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date: Fri Nov 14 16:44:40 2014 +0000
Better handling of the weird case when includes are needed but the library isn't.
git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17366 9d5b8971-822b-0410-80eb-d18c1038ef23
---
CMake/FindArmadillo.cmake | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/CMake/FindArmadillo.cmake b/CMake/FindArmadillo.cmake
index b2a0127..e794053 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>
# ------------------------------------------------------------------------
@@ -244,6 +243,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 "")
@@ -251,7 +256,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 "
@@ -277,10 +281,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