Browse Source

Arguments for cmake and make in setup.py possible now

Former-commit-id: a3ab0f7a6a
tempestpy_adaptions
Mavo 9 years ago
parent
commit
64f7f9f8ad
  1. 2
      install.sh
  2. 77
      setup.py

2
install.sh

@ -0,0 +1,2 @@
#!/bin/bash
pip install -ve . --install-option="--cmake=" --install-option="--make="

77
setup.py

@ -51,35 +51,72 @@ class MyEggInfo(egg_info):
class MyInstall(install): class MyInstall(install):
user_options = install.user_options + [
('cmake=', None, 'Additional cmake arguments'),
('make=', None, 'Additional make arguments'),
]
def initialize_options(self):
install.initialize_options(self)
self.cmake = ""
self.make = ""
def run(self): def run(self):
ret = call(["cmake", "-DSTORM_PYTHON=ON", "-DUSE_BOOST_STATIC_LIBRARIES=OFF", "-DPYTHON_LIBRARY="+PYTHONLIB, "-DPYTHON_INCLUDE_DIR="+PYTHONINC, os.path.abspath(os.path.dirname(os.path.realpath(__file__)))], cwd=d)
# Call cmake
cmake_args = ["cmake", "-DSTORM_PYTHON=ON", "-DUSE_BOOST_STATIC_LIBRARIES=OFF", "-DPYTHON_LIBRARY="+PYTHONLIB, "-DPYTHON_INCLUDE_DIR="+PYTHONINC]
cmake_args.extend(self.cmake.split())
cmake_args.append(os.path.abspath(os.path.dirname(os.path.realpath(__file__))))
ret = call(cmake_args, cwd=d)
if ret != 0: if ret != 0:
raise RuntimeError("Cmake exited with return code {}".format(ret)) raise RuntimeError("Cmake exited with return code {}".format(ret))
ret = call(["make", "stormpy", "-j"+str(NO_COMPILE_CORES)], cwd=d)
# Call make
make_args = ["make", "stormpy", "-j"+str(NO_COMPILE_CORES)]
make_args.extend(self.make.split())
ret = call(make_args, cwd=d)
if ret != 0: if ret != 0:
raise RuntimeError("Make exited with return code {}".format(ret)) raise RuntimeError("Make exited with return code {}".format(ret))
install.run(self) install.run(self)
class MyDevelop(develop): class MyDevelop(develop):
user_options = develop.user_options + [
('cmake=', None, 'Additional cmake arguments'),
('make=', None, 'Additional make arguments'),
]
def initialize_options(self):
develop.initialize_options(self)
self.cmake = ""
self.make = ""
def run(self): def run(self):
ret = call(["cmake", "-DSTORM_PYTHON=ON","-DUSE_BOOST_STATIC_LIBRARIES=OFF", "-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", "-j"+str(NO_COMPILE_CORES)], cwd=d)
if ret != 0:
raise RuntimeError("Make exited with return code {}".format(ret))
develop.run(self)
# Call cmake
cmake_args = ["cmake", "-DSTORM_PYTHON=ON", "-DUSE_BOOST_STATIC_LIBRARIES=OFF", "-DPYTHON_LIBRARY="+PYTHONLIB, "-DPYTHON_INCLUDE_DIR="+PYTHONINC]
cmake_args.extend(self.cmake.split())
cmake_args.append(os.path.abspath(os.path.dirname(os.path.realpath(__file__))))
ret = call(cmake_args, cwd=d)
if ret != 0:
raise RuntimeError("Cmake exited with return code {}".format(ret))
# Call make
make_args = ["make", "stormpy", "-j"+str(NO_COMPILE_CORES)]
make_args.extend(self.make.split())
ret = call(make_args, 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}, setup(cmdclass={'install': MyInstall, 'develop': MyDevelop, 'egg_info': MyEggInfo},
name="stormpy",
version="0.2",
description="Stormpy - Python Bindings for Storm",
package_dir={'':d},
packages=['stormpy', 'stormpy.core', 'stormpy.info', 'stormpy.logic', 'stormpy.expressions'],
package_data={'stormpy.core': ['_core.so'],
'stormpy.logic': ['_logic.so'],
'stormpy.info' : ['_info.so'] ,
'stormpy.expressions' : ['_expressions.so'],
'stormpy': ['*.so', '*.dylib', '*.a']},
name="stormpy",
version="0.2",
description="Stormpy - Python Bindings for Storm",
package_dir={'':d},
packages=['stormpy', 'stormpy.core', 'stormpy.info', 'stormpy.logic', 'stormpy.expressions'],
package_data={'stormpy.core': ['_core.so'],
'stormpy.logic': ['_logic.so'],
'stormpy.info' : ['_info.so'] ,
'stormpy.expressions' : ['_expressions.so'],
'stormpy': ['*.so', '*.dylib', '*.a']},
include_package_data=True)
include_package_data=True)
Loading…
Cancel
Save