[mlpack-svn] r14066 - mlpack/trunk

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jan 2 17:21:48 EST 2013


Author: rcurtin
Date: 2013-01-02 17:21:48 -0500 (Wed, 02 Jan 2013)
New Revision: 14066

Modified:
   mlpack/trunk/CMakeLists.txt
Log:
Issue a warning (not a fatal error) if Armadillo's configuration file does not
exist.  The presence of that condition will probably cause errors later on,
though.


Modified: mlpack/trunk/CMakeLists.txt
===================================================================
--- mlpack/trunk/CMakeLists.txt	2013-01-02 20:48:10 UTC (rev 14065)
+++ mlpack/trunk/CMakeLists.txt	2013-01-02 22:21:48 UTC (rev 14066)
@@ -63,22 +63,28 @@
 # system (where size_t will be 64 bits), suggest to the user that they should
 # compile Armadillo with 64-bit words.
 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  # We are on a 64-bit system.  Does Armadillo have ARMA_64BIT_WORD enabled?
-  file(READ "${ARMADILLO_INCLUDE_DIRS}/armadillo_bits/config.hpp" ARMA_CONFIG)
-  string(REGEX MATCH
-      "[\r\n][ ]*#define ARMA_64BIT_WORD"
-      ARMA_HAS_64BIT_WORD_PRE
-      "${ARMA_CONFIG}")
+  # Can we open the configuration file?  If not, issue a warning.
+  if(NOT EXISTS "${ARMADILLO_INCLUDE_DIRS}/armadillo_bits/config.hpp")
+    message(WARNING "Armadillo configuration file "
+        "(${ARMADILLO_INCLUDE_DIRS}/armadillo_bits/config.hpp) does not exist!")
+  else(NOT EXISTS "${ARMADILLO_INCLUDE_DIRS}/armadillo_bits/config.hpp")
+    # We are on a 64-bit system.  Does Armadillo have ARMA_64BIT_WORD enabled?
+    file(READ "${ARMADILLO_INCLUDE_DIRS}/armadillo_bits/config.hpp" ARMA_CONFIG)
+    string(REGEX MATCH
+        "[\r\n][ ]*#define ARMA_64BIT_WORD"
+        ARMA_HAS_64BIT_WORD_PRE
+        "${ARMA_CONFIG}")
 
-  string(LENGTH "${ARMA_HAS_64BIT_WORD_PRE}" ARMA_HAS_64BIT_WORD)
+    string(LENGTH "${ARMA_HAS_64BIT_WORD_PRE}" ARMA_HAS_64BIT_WORD)
 
-  if(ARMA_HAS_64BIT_WORD EQUAL 0)
-    message(WARNING "This is a 64-bit system, but Armadillo was compiled "
-        "without 64-bit index support.  Consider recompiling Armadillo with "
-        "ARMA_64BIT_WORD to enable 64-bit indices (large matrix support). "
-        "MLPACK will still work without ARMA_64BIT_WORD defined, but will not "
-        "scale to matrices with more than 4 billion elements.")
-  endif(ARMA_HAS_64BIT_WORD EQUAL 0)
+    if(ARMA_HAS_64BIT_WORD EQUAL 0)
+      message(WARNING "This is a 64-bit system, but Armadillo was compiled "
+          "without 64-bit index support.  Consider recompiling Armadillo with "
+          "ARMA_64BIT_WORD to enable 64-bit indices (large matrix support). "
+          "MLPACK will still work without ARMA_64BIT_WORD defined, but will not "
+          "scale to matrices with more than 4 billion elements.")
+    endif(ARMA_HAS_64BIT_WORD EQUAL 0)
+  endif(NOT EXISTS "${ARMADILLO_INCLUDE_DIRS}/armadillo_bits/config.hpp")
 endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 # On Windows, Armadillo should be using LAPACK and BLAS but we still need to




More information about the mlpack-svn mailing list