From 6618109c0a8e191a25e80abe7596af538066c25a Mon Sep 17 00:00:00 2001 From: Mavo Date: Fri, 22 Jan 2016 14:43:16 +0100 Subject: [PATCH] Multi-core make Former-commit-id: b19df56a6ff9cbe3f62024155d7c463bafeefde4 --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index d0db28312..67e1ea4b0 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ import tempfile import glob import shutil import distutils +import multiprocessing print(os.getcwd()) @@ -20,7 +21,7 @@ PYTHONLIBS = glob.glob(os.path.join(PYTHONLIBDIR, "*.dylib")) PYTHONLIBS.extend(glob.glob(os.path.join(PYTHONLIBDIR, "*.so"))) PYTHONLIB = PYTHONLIBS[0] - +NO_COMPILE_CORES = multiprocessing.cpu_count() #print(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))) #print(PYTHONINC) #print(PYTHONLIB) @@ -54,7 +55,7 @@ class MyInstall(install): 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"], cwd=d) + ret = call(["make", "stormpy", "-j"+str(NO_COMPILE_CORES)], cwd=d) if ret != 0: raise RuntimeError("Make exited with return code {}".format(ret)) install.run(self) @@ -63,7 +64,7 @@ class MyDevelop(develop): 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"], cwd=d) + 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) @@ -81,4 +82,4 @@ setup(cmdclass={'install': MyInstall, 'develop': MyDevelop, 'egg_info': MyEggInf 'stormpy.expressions' : ['_expressions.so'], 'stormpy': ['*.so', '*.dylib', '*.a']}, - include_package_data=True) \ No newline at end of file + include_package_data=True)