[mlpack-svn] r16097 - mlpack/trunk/src/mlpack/core/util
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Jan 3 11:56:41 EST 2014
Author: rcurtin
Date: Fri Jan 3 11:56:41 2014
New Revision: 16097
Log:
Update so that it gets compiled into libmlpack.so.
Added:
mlpack/trunk/src/mlpack/core/util/version.cpp
Modified:
mlpack/trunk/src/mlpack/core/util/CMakeLists.txt
mlpack/trunk/src/mlpack/core/util/version.hpp
Modified: mlpack/trunk/src/mlpack/core/util/CMakeLists.txt
==============================================================================
--- mlpack/trunk/src/mlpack/core/util/CMakeLists.txt (original)
+++ mlpack/trunk/src/mlpack/core/util/CMakeLists.txt Fri Jan 3 11:56:41 2014
@@ -24,6 +24,7 @@
timers.hpp
timers.cpp
version.hpp
+ version.cpp
)
# add directory name to sources
Added: mlpack/trunk/src/mlpack/core/util/version.cpp
==============================================================================
--- (empty file)
+++ mlpack/trunk/src/mlpack/core/util/version.cpp Fri Jan 3 11:56:41 2014
@@ -0,0 +1,21 @@
+/**
+ * @file version.cpp
+ * @author Ryan Curtin
+ *
+ * The implementation of GetVersion().
+ */
+#include "version.hpp"
+
+// If we are not an svn revision, just use the macros to assemble the version
+// name.
+std::string mlpack::util::GetVersion()
+{
+#ifndef __MLPACK_SUBVERSION
+ std::stringstream o;
+ o << "mlpack " << __MLPACK_VERSION_MAJOR << "." << __MLPACK_VERSION_MINOR
+ << "." << __MLPACK_VERSION_PATCH;
+ return o.str();
+#else
+ #include "svnversion.hpp"
+#endif
+}
Modified: mlpack/trunk/src/mlpack/core/util/version.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/util/version.hpp (original)
+++ mlpack/trunk/src/mlpack/core/util/version.hpp Fri Jan 3 11:56:41 2014
@@ -7,6 +7,8 @@
#ifndef __MLPACK_CORE_UTIL_VERSION_HPP
#define __MLPACK_CORE_UTIL_VERSION_HPP
+#include <string>
+
// The version of mlpack. If this is svn trunk, this will be a version with
// higher number than the most recent release.
#define __MLPACK_VERSION_MAJOR 1
@@ -17,7 +19,11 @@
namespace mlpack {
namespace util {
-inline std::string GetVersion() { return "mlpack trunk"; }
+/**
+ * This will return either "mlpack x.y.z" or "mlpack trunk-rXXXXX" depending on
+ * whether or not this is a stable version of mlpack or an svn revision.
+ */
+std::string GetVersion();
}; // namespace util
}; // namespace mlpack
More information about the mlpack-svn
mailing list