Browse Source

This commit fixes issue #5 related to Gurobi not being linked properly when requested.

tempestpy_adaptions
dehnert 7 years ago
parent
commit
de2646b082
  1. 4
      resources/3rdparty/CMakeLists.txt
  2. 2
      src/storm/solver/GurobiLpSolver.cpp

4
resources/3rdparty/CMakeLists.txt

@ -178,8 +178,8 @@ if (STORM_USE_GUROBI)
set(STORM_HAVE_GUROBI ${GUROBI_FOUND})
if (GUROBI_FOUND)
message (STATUS "Storm - Linking with Gurobi.")
add_imported_library(Gurobi "" ${GUROBI_LIBRARY} ${GUROBI_INCLUDE_DIRS})
list(APPEND STORM_DEP_TARGETS Gurobi)
add_imported_library(Gurobi SHARED ${GUROBI_LIBRARY} ${GUROBI_INCLUDE_DIRS})
list(APPEND STORM_DEP_TARGETS Gurobi_SHARED)
endif()
else()
set(STORM_HAVE_GUROBI OFF)

2
src/storm/solver/GurobiLpSolver.cpp

@ -65,7 +65,7 @@ namespace storm {
// Enable the following line to only print the output of Gurobi if the debug flag is set.
toggleOutput(storm::settings::getModule<storm::settings::modules::DebugSettings>().isDebugSet() || storm::settings::getModule<storm::settings::modules::GurobiSettings>().isOutputSet());
// Enable the following line to restrict Gurobi to one thread only.
error = GRBsetintparam(env, "Threads", storm::settings::getModule<storm::settings::modules::GurobisSettings>().getNumberOfThreads());
error = GRBsetintparam(env, "Threads", storm::settings::getModule<storm::settings::modules::GurobiSettings>().getNumberOfThreads());
STORM_LOG_THROW(error == 0, storm::exceptions::InvalidStateException, "Unable to set Gurobi Parameter Threads (" << GRBgeterrormsg(env) << ", error code " << error << ").");
// Enable the following line to force Gurobi to be as precise about the binary variables as required by the given precision option.

Loading…
Cancel
Save