def compile(self): if self.os_name == "windows": libdir = os.path.join(self.python_bindings_dir, "../lib") incdir = os.path.join(self.python_bindings_dir, "../include") gmp_h_url = "https://github.com/mikand/tamer-windows-deps/raw/master/gmp/include/gmp.h" mpir_dll_url = "https://github.com/Legrandin/mpir-windows-builds/blob/master/mpir-2.6.0_VS2015_%s/mpir.dll?raw=true" % self.bits mpir_lib_url = "https://github.com/Legrandin/mpir-windows-builds/blob/master/mpir-2.6.0_VS2015_%s/mpir.lib?raw=true" % self.bits setup_py_win_url = "https://github.com/pysmt/solvers_patches/raw/master/mathsat/setup-win.py" SolverInstaller.do_download(gmp_h_url, os.path.join(incdir, "gmp.h")) SolverInstaller.do_download(mpir_dll_url, os.path.join(libdir, "mpir.dll")) SolverInstaller.do_download(mpir_lib_url, os.path.join(libdir, "mpir.lib")) # Overwrite setup.py with the patched version setup_py = os.path.join(self.python_bindings_dir, "setup.py") SolverInstaller.mv(setup_py, setup_py + ".original") SolverInstaller.do_download(setup_py_win_url, setup_py) # Run setup.py to compile the bindings if self.os_name == "windows": SolverInstaller.run_python("./setup.py build_ext", self.python_bindings_dir) else: # NB: -R adds --rpath=$ORIGIN to link step, which makes shared library object # searched for in the extension's directory (no need for LD_LIBRARY_PATH) # (note: this is the default behavior for DLL discovery on Windows) SolverInstaller.run_python("./setup.py build_ext -R $ORIGIN", self.python_bindings_dir)
def compile(self): if self.os_name == "windows": libdir = os.path.join(self.python_bindings_dir, "../lib") incdir = os.path.join(self.python_bindings_dir, "../include") gmp_h_url = "https://github.com/mikand/tamer-windows-deps/raw/master/gmp/include/gmp.h" mpir_dll_url = "https://github.com/Legrandin/mpir-windows-builds/blob/master/mpir-2.6.0_VS2015_%s/mpir.dll?raw=true" % self.bits mpir_lib_url = "https://github.com/Legrandin/mpir-windows-builds/blob/master/mpir-2.6.0_VS2015_%s/mpir.lib?raw=true" % self.bits setup_py_win_url = "https://github.com/pysmt/solvers_patches/raw/master/mathsat/setup-win.py" SolverInstaller.do_download(gmp_h_url, os.path.join(incdir, "gmp.h")) SolverInstaller.do_download(mpir_dll_url, os.path.join(libdir, "mpir.dll")) SolverInstaller.do_download(mpir_lib_url, os.path.join(libdir, "mpir.lib")) # Overwrite setup.py with the patched version setup_py = os.path.join(self.python_bindings_dir, "setup.py") SolverInstaller.mv(setup_py, setup_py + ".original") SolverInstaller.do_download(setup_py_win_url, setup_py) # Run setup.py to compile the bindings if self.os_name in {"windows", "darwin"}: SolverInstaller.run_python("./setup.py build_ext", self.python_bindings_dir) else: # NB: -R adds --rpath=$ORIGIN to link step, which makes shared library object # searched for in the extension's directory (no need for LD_LIBRARY_PATH) # (note: this is the default behavior for DLL discovery on Windows) SolverInstaller.run_python("./setup.py build_ext -R $ORIGIN", self.python_bindings_dir)
def compile(self): import glob # Build lingeling lingeling_archive = glob.glob(os.path.join(self.extract_path, "archives", "lingeling-*.tar.gz"))[0] SolverInstaller.untar(lingeling_archive, self.extract_path) lingeling_dir = glob.glob(os.path.join(self.extract_path, "lingeling*"))[0] SolverInstaller.mv(lingeling_dir, os.path.join(self.extract_path, "lingeling")) SolverInstaller.run("bash ./configure.sh -fPIC", directory=os.path.join(self.extract_path, "lingeling")) SolverInstaller.run("make", directory=os.path.join(self.extract_path, "lingeling")) # Build Btor boolector_archive = glob.glob(os.path.join(self.extract_path, "archives", "boolector-*.tar.gz"))[0] SolverInstaller.untar(boolector_archive, self.extract_path) boolector_dir = glob.glob(os.path.join(self.extract_path, "boolector*"))[0] SolverInstaller.mv(boolector_dir, os.path.join(self.extract_path, "boolector")) SolverInstaller.run("bash ./configure.sh -python", directory=os.path.join(self.extract_path, "boolector")) SolverInstaller.run("make", directory=os.path.join(self.extract_path, "boolector")) # Redo this step to make sure the correct version of python is used SolverInstaller.run_python("setup.py build_ext -b build -t build/api/python/tmp", directory=os.path.join(self.extract_path, "boolector"))
def move(self): SolverInstaller.mv( os.path.join(self.bin_path, "share/pyshared/CVC4.py"), self.bindings_dir) SolverInstaller.mv( os.path.join(self.bin_path, "lib/pyshared/_CVC4.so"), self.bindings_dir)
def move(self): libdir = "lib.%s-%s-%s" % (self.os_name, self.architecture, self.python_version) bdir = os.path.join(self.extract_path, "build") sodir = os.path.join(bdir, libdir) for f in os.listdir(sodir): if f.endswith(".so"): SolverInstaller.mv(os.path.join(sodir, f), self.bindings_dir) SolverInstaller.mv(os.path.join(self.extract_path, "picosat.py"), self.bindings_dir)
def move(self): bpath = os.path.join(self.extract_path, "bin") files = ["python/z3"] if self.os_name == "linux": files += ["libz3.so"] elif self.os_name == "darwin": files += ["libz3.a", "libz3.dylib"] elif self.os_name == "windows": files += ["libz3.dll", "libz3.lib"] for f in files: SolverInstaller.mv(os.path.join(bpath, f), self.bindings_dir)
def move(self): bpath = os.path.join(self.extract_path, "bin") files = [ "z3consts.py", "z3core.py", "z3num.py", "z3poly.py", "z3printer.py", "z3.py", "z3rcf.py", "z3test.py", "z3types.py", "z3util.py" ] if self.os_name == "linux": files += ["libz3.so"] elif self.os_name == "darwin": files += ["libz3.a", "libz3.dylib"] for f in files: SolverInstaller.mv(os.path.join(bpath, f), self.bindings_dir)
def move(self): libdir = "lib.%s-%s-%s" % (self.os_name, self.architecture, self.python_version) if self.os_name == "darwin": osx_version = ".".join(platform.mac_ver()[0].split(".")[:2]) libdir = libdir.replace("darwin", "macosx-%s" % osx_version) pdir = self.python_bindings_dir bdir = os.path.join(pdir, "build") sodir = os.path.join(bdir, libdir) for f in os.listdir(sodir): if f.endswith(".so"): SolverInstaller.mv(os.path.join(sodir, f), self.bindings_dir) SolverInstaller.mv(os.path.join(pdir, "mathsat.py"), self.bindings_dir)
def move(self): bpath = os.path.join(self.extract_path, "bin") files = [os.path.join(bpath, "python/z3")] if self.os_name == "linux": files += glob.glob(bpath + '/*.so') elif self.os_name == "darwin": files += glob.glob(bpath + '/*.a') files += glob.glob(bpath + '/*.dylib') elif self.os_name == "windows": files += glob.glob(bpath + '/*.dll') files += glob.glob(bpath + '/*.lib') for f in files: SolverInstaller.mv(f, self.bindings_dir)
def move(self): bpath = os.path.join(self.extract_path, "bin") files = [ "libz3.so", "z3consts.py", "z3core.py", "z3num.py", "z3poly.py", "z3printer.py", "z3.py", "z3rcf.py", "z3test.py", "z3types.py", "z3util.py", ] for f in files: SolverInstaller.mv(os.path.join(bpath, f), self.bindings_dir)
def compile(self): # Prepare the building system SolverInstaller.run("bash autogen.sh", directory=self.extract_path) # Fix url of ANTLR SolverInstaller.run( "sed -i .bak s/http/https/g ./contrib/get-antlr-3.4", directory=self.extract_path) # Build ANTLR SolverInstaller.run("bash get-antlr-3.4", directory=os.path.join(self.extract_path, "contrib")) # Configure and build CVC4 config_cmd = "./configure --prefix={bin_path} \ --enable-language-bindings=python \ --with-antlr-dir={dir_path}/antlr-3.4 ANTLR={dir_path}/antlr-3.4/bin/antlr3 \ --disable-dependency-tracking" config_cmd = config_cmd.format(bin_path=self.bin_path, dir_path=self.extract_path) if os.path.exists(sys.executable + "-config"): pyconfig = {"PYTHON_CONFIG": sys.executable + "-config"} else: pyconfig = {} SolverInstaller.run(config_cmd, directory=self.extract_path, env_variables=pyconfig) SolverInstaller.run("make", directory=self.extract_path, env_variables=pyconfig) SolverInstaller.run("make install", directory=self.extract_path, env_variables=pyconfig) # Fix the paths of the bindings SolverInstaller.mv( os.path.join(self.bin_path, "lib/pyshared/CVC4.so.4.0.0"), os.path.join(self.bin_path, "lib/pyshared/_CVC4.so"))
def compile(self): if self.os_name == "windows": libdir = os.path.join(self.python_bindings_dir, "../lib") incdir = os.path.join(self.python_bindings_dir, "../include") gmp_h_url = "https://github.com/mikand/tamer-windows-deps/raw/master/gmp/include/gmp.h" mpir_dll_url = "https://github.com/Legrandin/mpir-windows-builds/blob/master/mpir-2.6.0_VS2015_%s/mpir.dll?raw=true" % self.bits mpir_lib_url = "https://github.com/Legrandin/mpir-windows-builds/blob/master/mpir-2.6.0_VS2015_%s/mpir.lib?raw=true" % self.bits setup_py_win_url = "https://github.com/pysmt/solvers_patches/raw/master/mathsat/setup-win.py" SolverInstaller.do_download(gmp_h_url, os.path.join(incdir, "gmp.h")) SolverInstaller.do_download(mpir_dll_url, os.path.join(libdir, "mpir.dll")) SolverInstaller.do_download(mpir_lib_url, os.path.join(libdir, "mpir.lib")) # Overwrite setup.py with the patched version setup_py = os.path.join(self.python_bindings_dir, "setup.py") SolverInstaller.mv(setup_py, setup_py + ".original") SolverInstaller.do_download(setup_py_win_url, setup_py) # Run setup.py to compile the bindings SolverInstaller.run_python("./setup.py build", self.python_bindings_dir)
def move(self): bpath = os.path.join(self.extract_path, "bin") files = ["z3consts.py", "z3core.py", "z3num.py", "z3poly.py", "z3printer.py", "z3.py", "z3rcf.py", "z3test.py", "z3types.py", "z3util.py"] if self.os_name == "linux": files += [ "libz3.so" ] elif self.os_name == "darwin": files += [ "libz3.a", "libz3.dylib" ] elif self.os_name == "windows": files += [ "libz3.dll", "libz3.lib" ] for f in files: SolverInstaller.mv(os.path.join(bpath, f), self.bindings_dir)
def move(self): pdir = self.python_bindings_dir bdir = os.path.join(pdir, "build") sodir = glob.glob(bdir + "/lib.*")[0] libdir = os.path.join(self.python_bindings_dir, "../lib") # First, we need the SWIG-generated wrapper for f in os.listdir(sodir): if f.endswith(".so") or f.endswith(".pyd"): SolverInstaller.mv(os.path.join(sodir, f), self.bindings_dir) SolverInstaller.mv(os.path.join(pdir, "mathsat.py"), self.bindings_dir) # Since MathSAT 5.5.0 we also need the SO/DLL/DYLIB of mathsat in the PATH # Under Windows, we also need the DLLs of MPIR in the PATH for f in os.listdir(libdir): if f.endswith(".so") or f.endswith(".dll") or f.endswith(".dylib"): SolverInstaller.mv(os.path.join(libdir, f), self.bindings_dir) # Fix issue in MathSAT 5.5.1 linking to incorrect directory on OSX if self.os_name == "darwin": soname = glob.glob(self.bindings_dir + "/_mathsat*.so")[0] old_path = "/Users/griggio/Documents/src/mathsat_release/build/libmathsat.dylib" new_path = "%s/libmathsat.dylib" % self.bindings_dir SolverInstaller.run("install_name_tool -change %s %s %s" % (old_path, new_path, soname))
def move(self): bpath = os.path.join(self.extract_path, "bin") libfiles = [] if self.os_name == "linux": libfiles += glob.glob(bpath + '/*.so') elif self.os_name == "darwin": libfiles += glob.glob(bpath + '/*.a') libfiles += glob.glob(bpath + '/*.dylib') elif self.os_name == "windows": libfiles += glob.glob(bpath + '/*.dll') libfiles += glob.glob(bpath + '/*.lib') SolverInstaller.mv(os.path.join(bpath, "python/z3"), self.bindings_dir) # z3 will check for shared libraries in z3/lib, before builtins.Z3_LIB_DIRS, # and Z3_LIBRARY_PATH env var lookup (or OS-level LD_LIBRARY_PATH) # (see z3/z3core.py) libpath = os.path.join(self.bindings_dir, "z3/lib/") if not os.path.exists(libpath): os.mkdir(libpath) for f in libfiles: SolverInstaller.mv(f, libpath)
def move(self): pdir = self.python_bindings_dir bdir = os.path.join(pdir, "build") sodir = glob.glob(bdir + "/lib.*")[0] libdir = os.path.join(self.python_bindings_dir, "../lib") # First, we need the SWIG-generated wrapper for f in os.listdir(sodir): if f.endswith(".so") or f.endswith(".pyd"): SolverInstaller.mv(os.path.join(sodir, f), self.bindings_dir) SolverInstaller.mv(os.path.join(pdir, "mathsat.py"), self.bindings_dir) # Since MathSAT 5.5.0 we also need the SO/DLL/DYLIB of mathsat in the PATH # Under Windows, we also need the DLLs of MPIR in the PATH for f in os.listdir(libdir): if f.endswith(".so") or f.endswith(".dll") or f.endswith(".dylib"): SolverInstaller.mv(os.path.join(libdir, f), self.bindings_dir)
def move(self): SolverInstaller.mv(os.path.join(self.bin_path, "share/pyshared/CVC4.py"), self.bindings_dir) SolverInstaller.mv(os.path.join(self.bin_path, "lib/pyshared/_CVC4.so"), self.bindings_dir)
def move(self): CVC4_py = os.path.join(self.bin_path, "CVC4.py") CVC4_so = os.path.join(self.bin_path, "_CVC4.so") SolverInstaller.mv(CVC4_py, self.bindings_dir) SolverInstaller.mv(CVC4_so, self.bindings_dir)
def move(self): bdir = os.path.join(self.extract_path, "boolector/build") for f in os.listdir(bdir): if f.startswith("boolector") and f.endswith(".so"): SolverInstaller.mv(os.path.join(bdir, f), self.bindings_dir)
def move(self): sub = "lib/python%s/site-packages/pyices" % self.python_version SolverInstaller.mv(os.path.join(self.install_dir, sub), self.bindings_dir)
def move(self): SolverInstaller.mv(os.path.join(self.extract_path, "repycudd.py"), self.bindings_dir) SolverInstaller.mv(os.path.join(self.extract_path, "_repycudd.so"), self.bindings_dir)