Browse Source

error when build fails during setup, as well as some extensions to the python interface

Former-commit-id: 804cf37d8c
tempestpy_adaptions
sjunges 9 years ago
parent
commit
9f61f75231
  1. 18
      setup.py
  2. 8
      src/python/storm-core.cpp

18
setup.py

@ -51,14 +51,22 @@ class MyEggInfo(egg_info):
class MyInstall(install):
def run(self):
call(["cmake", "-DSTORM_PYTHON=ON", "-DPYTHON_LIBRARY="+PYTHONLIB, "-DPYTHON_INCLUDE_DIR="+PYTHONINC, os.path.abspath(os.path.dirname(os.path.realpath(__file__)))], cwd=d)
call(["make", "stormpy"], cwd=d)
ret = call(["cmake", "-DSTORM_PYTHON=ON", "-DPYTHON_LIBRARY="+PYTHONLIB, "-DPYTHON_INCLUDE_DIR="+PYTHONINC, os.path.abspath(os.path.dirname(os.path.realpath(__file__)))], cwd=d)
if ret != 0:
raise RuntimeError("Cmake exited with return code {}".format(ret))
ret = call(["make", "stormpy"], cwd=d)
if ret != 0:
raise RuntimeError("Make exited with return code {}".format(ret))
install.run(self)
class MyDevelop(develop):
def run(self):
call(["cmake", "-DSTORM_PYTHON=ON", "-DPYTHON_LIBRARY="+PYTHONLIB, "-DPYTHON_INCLUDE_DIR="+PYTHONINC, os.path.abspath(os.path.dirname(os.path.realpath(__file__)))], cwd=d)
call(["make", "stormpy"], cwd=d)
develop.run(self)
ret = call(["cmake", "-DSTORM_PYTHON=ON", "-DPYTHON_LIBRARY="+PYTHONLIB, "-DPYTHON_INCLUDE_DIR="+PYTHONINC, os.path.abspath(os.path.dirname(os.path.realpath(__file__)))], cwd=d)
if ret != 0:
raise RuntimeError("Cmake exited with return code {}".format(ret))
ret = call(["make", "stormpy"], cwd=d)
if ret != 0:
raise RuntimeError("Make exited with return code {}".format(ret))
develop.run(self)
setup(cmdclass={'install': MyInstall, 'develop': MyDevelop, 'egg_info': MyEggInfo},

8
src/python/storm-core.cpp

@ -44,9 +44,11 @@ BOOST_PYTHON_MODULE(_core)
////////////////////////////////////////////
class_<storm::models::ModelBase, std::shared_ptr<storm::models::ModelBase>, boost::noncopyable>("ModelBase", no_init)
.add_property("nrStates", &storm::models::ModelBase::getNumberOfStates)
.add_property("nrTransitions", &storm::models::ModelBase::getNumberOfTransitions);
.add_property("nrTransitions", &storm::models::ModelBase::getNumberOfTransitions)
class_<storm::models::sparse::Model<storm::RationalFunction>, std::shared_ptr<storm::models::sparse::Model<storm::RationalFunction>>, boost::noncopyable, bases<storm::models::ModelBase>>("SparseParametricModel", no_init);
class_<storm::models::sparse::Model<double>, std::shared_ptr<storm::models::sparse::Model<double>>, boost::noncopyable, bases<storm::models::ModelBase>>("SparseModel", no_init);
def("parseFormulae", storm::parseFormulasForProgram);
def("parseProgram", storm::parseProgram);
@ -56,6 +58,10 @@ BOOST_PYTHON_MODULE(_core)
//////////////////////////////////////////////
// Model Checking
//////////////////////////////////////////////
class_<storm::storage::ModelProgramPair>("ModelProgramPair", no_init)
.add_property("model", &storm::storage::ModelProgramPair::model)
.add_property("program", &storm::storage::ModelProgramPair::program)
;
def("performStateElimination", storm::verifySparseModel<storm::RationalFunction>);
Loading…
Cancel
Save