当前位置: 首页>>代码示例>>Python>>正文


Python SolverInstaller.run_python方法代码示例

本文整理汇总了Python中pysmt.cmd.installers.base.SolverInstaller.run_python方法的典型用法代码示例。如果您正苦于以下问题:Python SolverInstaller.run_python方法的具体用法?Python SolverInstaller.run_python怎么用?Python SolverInstaller.run_python使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pysmt.cmd.installers.base.SolverInstaller的用法示例。


在下文中一共展示了SolverInstaller.run_python方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run_python [as 别名]
    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"))
开发者ID:mpreiner,项目名称:pysmt,代码行数:34,代码来源:btor.py

示例2: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run_python [as 别名]
    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)
开发者ID:mpreiner,项目名称:pysmt,代码行数:28,代码来源:msat.py

示例3: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run_python [as 别名]
 def compile(self):
     picosat_dir = os.path.join(self.extract_path, "picosat-%s" % self.solver_version)
     SolverInstaller.run('bash configure', directory=picosat_dir,
                         env_variables={"CFLAGS": " -fPIC"})
     SolverInstaller.run('make', directory=picosat_dir,
                         env_variables={"CFLAGS": " -fPIC"})
     SolverInstaller.run_python("setup.py build", directory=self.extract_path)
开发者ID:fontealpina,项目名称:pysmt,代码行数:9,代码来源:pico.py

示例4: install_pyices

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run_python [as 别名]
    def install_pyices(self):
        pyices_git = "aa0b91c39aa00c19c2160e83aad822dc468ce328"
        pyices_base_name =  "pyices-%s" % pyices_git
        pyices_archive_name = "%s.tar.gz" % pyices_base_name
        pyices_archive = os.path.join(self.base_dir, pyices_archive_name)
        pyices_dir_path = os.path.join(self.base_dir, pyices_base_name)

        pyices_download_link = \
            "https://codeload.github.com/cheshire/pyices/tar.gz/%s" % pyices_git
        SolverInstaller.do_download(pyices_download_link, pyices_archive)

        SolverInstaller.clean_dir(pyices_dir_path)

        SolverInstaller.untar(pyices_archive, self.base_dir)
        # Build pyices
        SolverInstaller.run_python("setup.py install --prefix=%s" % self.install_dir,
                                   directory=pyices_dir_path,
                                   env_variables={"YICES_PATH" : self.yices_path})
开发者ID:diasalvatore,项目名称:pysmt,代码行数:20,代码来源:yices.py

示例5: install_yicespy

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run_python [as 别名]
    def install_yicespy(self):
        yicespy_git_version = self.yicespy_git_version
        yicespy_base_name =  "yicespy"
        yicespy_archive_name = "%s.tar.gz" % yicespy_base_name
        yicespy_archive = os.path.join(self.base_dir, yicespy_archive_name)
        yicespy_dir_path = os.path.join(self.base_dir,
                                        yicespy_base_name + "-" + yicespy_git_version)

        yicespy_download_link = "https://codeload.github.com/pysmt/yicespy/tar.gz/%s" % (yicespy_git_version)
        SolverInstaller.do_download(yicespy_download_link, yicespy_archive)

        SolverInstaller.clean_dir(yicespy_dir_path)

        SolverInstaller.untar(yicespy_archive, self.base_dir)
        # Build yicespy
        SolverInstaller.run_python("setup.py --yices-dir=%s -- build_ext bdist_wheel --dist-dir=%s " % (self.yices_path, self.base_dir),
                                   directory=yicespy_dir_path)
        wheel_file = glob.glob(os.path.join(self.base_dir, "yicespy") + "*.whl")[0]
        SolverInstaller.unzip(wheel_file, self.bindings_dir)
开发者ID:pysmt,项目名称:pysmt,代码行数:21,代码来源:yices.py

示例6: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run_python [as 别名]
 def compile(self):
     SolverInstaller.run_python("./setup.py build", self.python_bindings_dir)
开发者ID:diasalvatore,项目名称:pysmt,代码行数:4,代码来源:msat.py


注:本文中的pysmt.cmd.installers.base.SolverInstaller.run_python方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。