[mlpack-svn] r13874 - mlpack/trunk/src/mlpack/bindings/matlab
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Nov 15 22:10:00 EST 2012
Author: rcurtin
Date: 2012-11-15 22:10:00 -0500 (Thu, 15 Nov 2012)
New Revision: 13874
Modified:
mlpack/trunk/src/mlpack/bindings/matlab/CMakeLists.txt
Log:
No need to warn if the MATLAB mex compiler is using a newer glibc than the
system.
Modified: mlpack/trunk/src/mlpack/bindings/matlab/CMakeLists.txt
===================================================================
--- mlpack/trunk/src/mlpack/bindings/matlab/CMakeLists.txt 2012-11-16 02:36:21 UTC (rev 13873)
+++ mlpack/trunk/src/mlpack/bindings/matlab/CMakeLists.txt 2012-11-16 03:10:00 UTC (rev 13874)
@@ -25,17 +25,44 @@
string(REGEX MATCH "Warning: You are using" MEX_WARNING "${MEX_OUTPUT}")
if(MEX_WARNING)
- message(WARNING "The MATLAB runtime glibc is different than the system "
- " glibc. This can (and probably will) cause the MLPACK bindings "
- "generated by this build script to fail with odd GLIBCXX_a_b_c version "
- "complaints when they are run. Assuming that the system glibc is "
- "newer than the MATLAB-provided version, the MATLAB version can "
- "probably be deleted (always save a copy in case this is wrong!).\n"
- "For more information on this confusing issue, see\n"
- "http://dovgalecs.com/blog/matlab-glibcxx_3-4-11-not-found/\nand for an"
- " overly-detailed dissertation/rant on why it is not possible to work "
- "around this issue in any way, see\n"
- "http://www.mlpack.org/trac/ticket/253 for more information.")
+ # We have to find the old compiler version and the new compiler version; if
+ # the MATLAB version is newer, then we don't need to worry. If this step
+ # fails somehow, we will just issue the warning anyway (just in case).
+ string(REGEX REPLACE
+ ".*using [a-zA-Z]* version \"([0-9.]*)[^\"]*\".*"
+ "\\1" OTHER_COMPILER_VERSION "${MEX_OUTPUT}")
+ string(REGEX REPLACE
+ ".*currently supported with MEX is \"([0-9.]*)[^\"]*\".*"
+ "\\1" MEX_COMPILER_VERSION "${MEX_OUTPUT}")
+
+ # If MEX_COMPILER_VERSION is greater than OTHER_COMPILER_VERSION, we don't
+ # need to issue a warning.
+ set(NEED_TO_WARN 1)
+ if(MEX_COMPILER_VERSION AND OTHER_COMPILER_VERSION)
+ # We seem to have read two valid version strings. So we can compare
+ # them, and maybe we don't need to issue the warning.
+ if(NOT ("${MEX_COMPILER_VERSION}" VERSION_LESS
+ "${OTHER_COMPILER_VERSION}"))
+ # The mex compiler is newer than our version. So no warning is
+ # needed.
+ set(NEED_TO_WARN 0)
+ endif(NOT ("${MEX_COMPILER_VERSION}" VERSION_LESS
+ "${OTHER_COMPILER_VERSION}"))
+ endif(MEX_COMPILER_VERSION AND OTHER_COMPILER_VERSION)
+
+ if(NEED_TO_WARN EQUAL 1)
+ message(WARNING "The MATLAB runtime glibc is different than the system "
+ " glibc. This can (and probably will) cause the MLPACK bindings "
+ "generated by this build script to fail with odd GLIBCXX_a_b_c "
+ "version complaints when they are run. Assuming that the system "
+ "glibc is newer than the MATLAB-provided version, the MATLAB version "
+ "can probably be deleted (always save a copy in case this is wrong!)."
+ "\nFor more information on this confusing issue, see\n"
+ "http://dovgalecs.com/blog/matlab-glibcxx_3-4-11-not-found/\nand for "
+ "an overly-detailed dissertation/rant on why it is not possible to "
+ "work around this issue in any way, see\n"
+ "http://www.mlpack.org/trac/ticket/253 for more information.")
+ endif(NEED_TO_WARN EQUAL 1)
endif(MEX_WARNING)
endif(UNIX)
More information about the mlpack-svn
mailing list