From 7bb65dbb22f903fec8d5762064667739ae3cab8e Mon Sep 17 00:00:00 2001 From: sjunges Date: Mon, 18 Jul 2016 14:00:22 +0200 Subject: [PATCH] fix a problem with cln used/unused Former-commit-id: 2c6a2447a91a7d947aec1e62bba8ad5c2c8aa4a8 --- CMakeLists.txt | 3 ++- src/adapters/CarlAdapter.h | 14 ++++++++++++-- storm-config.h.in | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e6c2efee..ccaf5ed83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -362,6 +362,7 @@ find_package(CLN QUIET) if(CLN_FOUND) set(STORM_HAVE_CLN ON) + set(STORM_USE_CLN_NUMBERS ON) message(STATUS "StoRM - Linking with CLN ${CLN_VERSION_STRING}") include_directories("${CLN_INCLUDE_DIR}") list(APPEND STORM_LINK_LIBRARIES ${CLN_LIBRARIES}) @@ -782,7 +783,7 @@ configure_file ( "${PROJECT_SOURCE_DIR}/src/utility/storm-version.cpp" ) -set(STORM_GENERATED_SOURCES "${PROJECT_BINARY_DIR}/src/utility/storm-version.cpp") +set(STORM_GENERATED_SOURCES "${PROJECT_SOURCE_DIR}/src/utility/storm-version.cpp") # Add the binary dir include directory for storm-config.h include_directories("${PROJECT_BINARY_DIR}/include") diff --git a/src/adapters/CarlAdapter.h b/src/adapters/CarlAdapter.h index d757ae29a..89bc869a9 100644 --- a/src/adapters/CarlAdapter.h +++ b/src/adapters/CarlAdapter.h @@ -6,6 +6,10 @@ #include +#ifdef STORM_HAVE_CLN +#include +#endif + #ifdef STORM_HAVE_CARL #include @@ -44,7 +48,13 @@ namespace carl { } -#ifdef STORM_HAVE_CLN +inline size_t hash_value(mpq_class const& q) { + std::hash h; + return h(q); +} + + +#if defined STORM_HAVE_CLN && defined STORM_USE_CLN_NUMBERS namespace cln { inline size_t hash_value(cl_RA const& n) { std::hash h; @@ -54,7 +64,7 @@ namespace cln { #endif namespace storm { -#if defined STORM_HAVE_CLN && defined USE_CLN_NUMBERS +#if defined STORM_HAVE_CLN && defined STORM_USE_CLN_NUMBERS typedef cln::cl_RA RationalNumber; #else typedef mpq_class RationalNumber; diff --git a/storm-config.h.in b/storm-config.h.in index 1bc2eac7d..effb49ade 100644 --- a/storm-config.h.in +++ b/storm-config.h.in @@ -44,6 +44,8 @@ // Whether carl is available and to be used. #cmakedefine STORM_HAVE_CARL +#cmakedefine STORM_USE_CLN_NUMBERS + // Whether smtrat is available and to be used. #cmakedefine STORM_HAVE_SMTRAT