[mathicgb] 228/393: configure now checks whether librt is needed before using it. Also removed a few tabs.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.
commit 72dd7f4765f26e3e80e750818211eca770dceae8
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Wed Apr 10 17:27:29 2013 -0400
configure now checks whether librt is needed before using it. Also removed a few tabs.
---
Makefile.am | 2 +-
configure.ac | 20 +++++++++++++++++++-
src/test/MonoMonoid.cpp | 16 ++++++++--------
3 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 6bfe5e1..f754beb 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,7 +54,7 @@ libmathicgb_la_SOURCES = src/mathicgb/BjarkeGeobucket2.cpp \
src/mathicgb/SigSPairQueue.cpp src/mathicgb/SparseMatrix.hpp \
src/mathicgb/SparseMatrix.cpp src/mathicgb/QuadMatrixBuilder.hpp \
src/mathicgb/QuadMatrixBuilder.cpp src/mathicgb/TypicalReducer.cpp \
- src/mathicgb/TypicalReducer.cpp src/mathicgb/F4Reducer.hpp \
+ src/mathicgb/TypicalReducer.hpp src/mathicgb/F4Reducer.hpp \
src/mathicgb/F4Reducer.cpp src/mathicgb/F4MatrixBuilder.hpp \
src/mathicgb/F4MatrixBuilder.cpp src/mathicgb/QuadMatrix.hpp \
src/mathicgb/QuadMatrix.cpp src/mathicgb/F4MatrixReducer.cpp \
diff --git a/configure.ac b/configure.ac
index 1caae31..5c78b4d 100755
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,24 @@ AC_INIT([mathicgb], [1.0]) # package, version, bug-report-email
PKG_CHECK_MODULES([MEMTAILOR], [memtailor])
PKG_CHECK_MODULES([MATHIC], [mathic])
+AC_LANG([C++])
+dnl the first AC_LINK_IFELSE causes tests for lots of C++ related things,
+dnl and these print out messages. So to avoid those messages appearing
+dnl after "if librt..." and before the result for that test, we do an
+dnl empty AC_LINK_IFELSE. Probably there is a better way.
+AC_LINK_IFELSE([AC_LANG_SOURCE([[]])], [], [])
+
+AC_MSG_CHECKING([if librt is needed on this platform])
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#]include [<]ctime[>]],
+ [[std::clock();]]
+ )],
+ [AC_MSG_RESULT([no]); RT_LIBS=""],
+ [AC_MSG_RESULT([yes]); RT_LIBS="-lrt"]
+)
+
+
dnl ----- The gtest dependency
AC_ARG_WITH([gtest], AS_HELP_STRING(
@@ -75,7 +93,7 @@ AS_IF(
)
DEPS_CFLAGS="$MEMTAILOR_CFLAGS $MATHIC_CFLAGS $TBB_CFLAGS $GTEST_CFLAGS"
-DEPS_LIBS="$MEMTAILOR_LIBS $MATHIC_LIBS $TBB_LIBS $GTEST_LIBS -lrt"
+DEPS_LIBS="$MEMTAILOR_LIBS $MATHIC_LIBS $TBB_LIBS $GTEST_LIBS $RT_LIBS"
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
diff --git a/src/test/MonoMonoid.cpp b/src/test/MonoMonoid.cpp
index 0763d7e..fbc47c0 100755
--- a/src/test/MonoMonoid.cpp
+++ b/src/test/MonoMonoid.cpp
@@ -211,16 +211,16 @@ TYPED_TEST(Monoid, MonoPool) {
auto m2 = pool.alloc();
ASSERT_TRUE(monoid.isIdentity(m2));
for (VarIndex var = 0; var < varCount; ++var) {
- monoid.setExponent(var, 1, m1);
- monoid.setExponent(var, 1, m2);
+ monoid.setExponent(var, 1, m1);
+ monoid.setExponent(var, 1, m2);
}
if (i > 10) {
- using std::swap;
- swap(m2, monos[i - 10]);
+ using std::swap;
+ swap(m2, monos[i - 10]);
}
- monos.push_back(std::move(m1));
+ monos.emplace_back(std::move(m1));
}
-
+
// This ensures that we get to each entry in monos exactly once.
MATHICGB_ASSERT((count % 17) != 0);
int i = 0;
@@ -243,11 +243,11 @@ TYPED_TEST(Monoid, MonoPool) {
monos[i] = pool.alloc();
ASSERT_TRUE(monoid.isIdentity(monos[i]));
for (VarIndex var = 0; var < varCount; ++var)
- monoid.setExponent(var, expect(i, var, varCount), monos[i]);
+ monoid.setExponent(var, expect(i, var, varCount), monos[i]);
}
for (int i = 0; i < count; ++i) {
for (VarIndex var = 0; var < varCount; ++var) {
- ASSERT_EQ(expect(i, var, varCount), monoid.exponent(monos[i], var));
+ ASSERT_EQ(expect(i, var, varCount), monoid.exponent(monos[i], var));
}
}
// everything should be free'd now. Let's do all that again.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git
More information about the debian-science-commits
mailing list