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. 45
      setup.py

2
install.sh

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

45
setup.py

@ -51,20 +51,57 @@ class MyEggInfo(egg_info):
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):
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:
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:
raise RuntimeError("Make exited with return code {}".format(ret))
install.run(self)
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):
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:
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:
raise RuntimeError("Make exited with return code {}".format(ret))
develop.run(self)

Loading…
Cancel
Save