Browse Source

Added -fPIC to Sylvan. Since it is linked into Storm it is necessary for relocation to be possible, hence PIC.

Added includes for cmath at various points. This is a default include on Mac OS but not on any sane systems.
Changed calls to std::abs to std::fabs to resolve ambigious call errors.


Former-commit-id: 4d3da21bce
tempestpy_adaptions
PBerger 9 years ago
parent
commit
be9648fc18
  1. 4
      resources/3rdparty/sylvan/CMakeLists.txt
  2. 4
      src/generator/VariableInformation.cpp
  3. 9
      src/solver/GlpkLpSolver.cpp
  4. 4
      src/storage/dd/DdManager.cpp
  5. 4
      src/storage/dd/cudd/CuddAddIterator.cpp
  6. 4
      src/storage/dd/sylvan/SylvanAddIterator.cpp

4
resources/3rdparty/sylvan/CMakeLists.txt

@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 2.6)
project(sylvan C CXX)
enable_testing()
set(CMAKE_C_FLAGS "-O3 -Wextra -Wall -Werror -fno-strict-aliasing -std=gnu11")
set(CMAKE_CXX_FLAGS "-O3 -Wextra -Wall -Werror -fno-strict-aliasing -Wno-deprecated-register -std=gnu++11")
set(CMAKE_C_FLAGS "-O3 -Wextra -Wall -Werror -fno-strict-aliasing -std=gnu11 -fPIC")
set(CMAKE_CXX_FLAGS "-O3 -Wextra -Wall -Werror -fno-strict-aliasing -Wno-deprecated-register -std=gnu++11 -fPIC")
option(WITH_COVERAGE "Add generation of test coverage" OFF)
if(WITH_COVERAGE)

4
src/generator/VariableInformation.cpp

@ -3,6 +3,8 @@
#include "src/utility/macros.h"
#include "src/exceptions/InvalidArgumentException.h"
#include <cmath>
namespace storm {
namespace generator {
@ -74,4 +76,4 @@ namespace storm {
}
}
}
}

9
src/solver/GlpkLpSolver.cpp

@ -17,6 +17,9 @@
#include "src/settings/modules/DebugSettings.h"
#include "src/settings/modules/GlpkSettings.h"
#include <cmath>
namespace storm {
namespace solver {
GlpkLpSolver::GlpkLpSolver(std::string const& name, OptimizationDirection const& optDir) : LpSolver(optDir), lp(nullptr), variableToIndexMap(), nextVariableIndex(1), nextConstraintIndex(1), modelContainsIntegerVariables(false), isInfeasibleFlag(false), isUnboundedFlag(false), rowIndices(), columnIndices(), coefficientValues() {
@ -298,7 +301,7 @@ namespace storm {
}
// Now check the desired precision was actually achieved.
STORM_LOG_THROW(std::abs(static_cast<int>(value) - value) <= storm::settings::getModule<storm::settings::modules::GlpkSettings>().getIntegerTolerance(), storm::exceptions::InvalidStateException, "Illegal value for integer variable in glpk solution (" << value << ").");
STORM_LOG_THROW(std::fabs(static_cast<int>(value) - value) <= storm::settings::getModule<storm::settings::modules::GlpkSettings>().getIntegerTolerance(), storm::exceptions::InvalidStateException, "Illegal value for integer variable in glpk solution (" << value << ").");
return static_cast<int_fast64_t>(value);
}
@ -320,7 +323,7 @@ namespace storm {
value = glp_get_col_prim(this->lp, static_cast<int>(variableIndexPair->second));
}
STORM_LOG_THROW(std::abs(static_cast<int>(value) - value) <= storm::settings::getModule<storm::settings::modules::GlpkSettings>().getIntegerTolerance(), storm::exceptions::InvalidStateException, "Illegal value for binary variable in glpk solution (" << value << ").");
STORM_LOG_THROW(std::fabs(static_cast<int>(value) - value) <= storm::settings::getModule<storm::settings::modules::GlpkSettings>().getIntegerTolerance(), storm::exceptions::InvalidStateException, "Illegal value for binary variable in glpk solution (" << value << ").");
return static_cast<bool>(value);
}
@ -349,4 +352,4 @@ namespace storm {
}
}
#endif
#endif

4
src/storage/dd/DdManager.cpp

@ -6,6 +6,8 @@
#include "src/utility/constants.h"
#include "src/exceptions/InvalidArgumentException.h"
#include <cmath>
namespace storm {
namespace dd {
template<DdType LibraryType>
@ -349,4 +351,4 @@ namespace storm {
template Add<DdType::Sylvan, double> DdManager<DdType::Sylvan>::getIdentity(storm::expressions::Variable const& variable) const;
template Add<DdType::Sylvan, uint_fast64_t> DdManager<DdType::Sylvan>::getIdentity(storm::expressions::Variable const& variable) const;
}
}
}

4
src/storage/dd/cudd/CuddAddIterator.cpp

@ -4,6 +4,8 @@
#include "src/utility/macros.h"
#include "src/storage/expressions/ExpressionManager.h"
#include <cmath>
namespace storm {
namespace dd {
template<typename ValueType>
@ -184,4 +186,4 @@ namespace storm {
template class AddIterator<DdType::CUDD, double>;
template class AddIterator<DdType::CUDD, uint_fast64_t>;
}
}
}

4
src/storage/dd/sylvan/SylvanAddIterator.cpp

@ -8,6 +8,8 @@
#include "src/utility/macros.h"
#include "src/exceptions/NotImplementedException.h"
#include <cmath>
namespace storm {
namespace dd {
template<typename ValueType>
@ -186,4 +188,4 @@ namespace storm {
template class AddIterator<DdType::Sylvan, double>;
template class AddIterator<DdType::Sylvan, uint_fast64_t>;
}
}
}
Loading…
Cancel
Save