Browse Source

fix a problem with cln used/unused

Former-commit-id: 2c6a2447a9
tempestpy_adaptions
sjunges 9 years ago
parent
commit
7bb65dbb22
  1. 3
      CMakeLists.txt
  2. 14
      src/adapters/CarlAdapter.h
  3. 2
      storm-config.h.in

3
CMakeLists.txt

@ -362,6 +362,7 @@ find_package(CLN QUIET)
if(CLN_FOUND) if(CLN_FOUND)
set(STORM_HAVE_CLN ON) set(STORM_HAVE_CLN ON)
set(STORM_USE_CLN_NUMBERS ON)
message(STATUS "StoRM - Linking with CLN ${CLN_VERSION_STRING}") message(STATUS "StoRM - Linking with CLN ${CLN_VERSION_STRING}")
include_directories("${CLN_INCLUDE_DIR}") include_directories("${CLN_INCLUDE_DIR}")
list(APPEND STORM_LINK_LIBRARIES ${CLN_LIBRARIES}) list(APPEND STORM_LINK_LIBRARIES ${CLN_LIBRARIES})
@ -782,7 +783,7 @@ configure_file (
"${PROJECT_SOURCE_DIR}/src/utility/storm-version.cpp" "${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 # Add the binary dir include directory for storm-config.h
include_directories("${PROJECT_BINARY_DIR}/include") include_directories("${PROJECT_BINARY_DIR}/include")

14
src/adapters/CarlAdapter.h

@ -6,6 +6,10 @@
#include <boost/multiprecision/gmp.hpp> #include <boost/multiprecision/gmp.hpp>
#ifdef STORM_HAVE_CLN
#include <cln/cln.h>
#endif
#ifdef STORM_HAVE_CARL #ifdef STORM_HAVE_CARL
#include <carl/numbers/numbers.h> #include <carl/numbers/numbers.h>
@ -44,7 +48,13 @@ namespace carl {
} }
#ifdef STORM_HAVE_CLN
inline size_t hash_value(mpq_class const& q) {
std::hash<mpq_class> h;
return h(q);
}
#if defined STORM_HAVE_CLN && defined STORM_USE_CLN_NUMBERS
namespace cln { namespace cln {
inline size_t hash_value(cl_RA const& n) { inline size_t hash_value(cl_RA const& n) {
std::hash<cln::cl_RA> h; std::hash<cln::cl_RA> h;
@ -54,7 +64,7 @@ namespace cln {
#endif #endif
namespace storm { 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; typedef cln::cl_RA RationalNumber;
#else #else
typedef mpq_class RationalNumber; typedef mpq_class RationalNumber;

2
storm-config.h.in

@ -44,6 +44,8 @@
// Whether carl is available and to be used. // Whether carl is available and to be used.
#cmakedefine STORM_HAVE_CARL #cmakedefine STORM_HAVE_CARL
#cmakedefine STORM_USE_CLN_NUMBERS
// Whether smtrat is available and to be used. // Whether smtrat is available and to be used.
#cmakedefine STORM_HAVE_SMTRAT #cmakedefine STORM_HAVE_SMTRAT

Loading…
Cancel
Save