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


Python SolverInstaller.run方法代码示例

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


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

示例1: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Patch the distribution to avoid a known problem
        patch_name = "cvc4_wrapper.patch"
        plink = "https://raw.githubusercontent.com/pysmt/solvers_patches/master/%s" % patch_name
        SolverInstaller.do_download(plink, os.path.join(self.extract_path, patch_name))

        # Apply patch
        SolverInstaller.run("patch -p1 -i %s" % patch_name,
                            directory=self.extract_path)

        # Prepare the building system
        SolverInstaller.run("bash autogen.sh", 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 = "./configure --prefix={bin_path} \
                              --enable-language-bindings=python \
                              --with-antlr-dir={dir_path}/antlr-3.4 ANTLR={dir_path}/antlr-3.4/bin/antlr3;\
                  make; \
                  make install ".format(bin_path=self.bin_path, dir_path=self.extract_path)
        SolverInstaller.run(config, directory=self.extract_path)

        # Fix the paths of the bindings
        SolverInstaller.run("cp CVC4.so.3.0.0 _CVC4.so",
                            directory=os.path.join(self.bin_path, "lib/pyshared"))
开发者ID:diasalvatore,项目名称:pysmt,代码行数:30,代码来源:cvc4.py

示例2: move

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

示例3: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [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: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Select the correct Makefile to be used
        makefile = "Makefile"
        if self.architecture == "x86_64":
            makefile = "Makefile_64bit"

        # Find python-config
        command = self.find_python_config()
        if command is None:
            raise OSError("No installation of python-config found on this system."
                          " Please install python-config for this version of python.")
        print("Found python-config in %s" % command)

        # Build the pycudd
        prefix = None
        p = subprocess.Popen([command, '--includes'], stdout=subprocess.PIPE, stderr=None)
        prefix = p.stdout.read()
        if PY2:
            pass # Prefix is already a string
        else:
            # > PY3 Prefix is binary data
            prefix = prefix.decode()

        if not prefix or len(prefix) == 0:
            prefix = "/usr"

        SolverInstaller.run("make -C %s -f %s PYTHON_INCL=%s" %
                            (self.extract_path, makefile, prefix))
开发者ID:mpreiner,项目名称:pysmt,代码行数:30,代码来源:bdd.py

示例5: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Prepare an empty folder for installing yices
        SolverInstaller.clean_dir(self.yices_path)

        SolverInstaller.run("bash ./install-yices %s" % self.yices_path,
                            directory=self.extract_path)

        self.install_yicespy()
开发者ID:0Chuzz,项目名称:pysmt,代码行数:10,代码来源:yices.py

示例6: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Select the correct Makefile to be used
        makefile = "Makefile"
        if self.architecture == "x86_64":
            makefile = "Makefile_64bit"

        import distutils.sysconfig as sysconfig
        PYTHON_INCLUDE_DIR = sysconfig.get_python_inc()
        SolverInstaller.run("make -C %s -f %s PYTHON_INCL=-I%s" %
                            (self.extract_path, makefile, PYTHON_INCLUDE_DIR))
开发者ID:pysmt,项目名称:pysmt,代码行数:12,代码来源:bdd.py

示例7: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [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

示例8: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # First build
        SolverInstaller.run("make", directory=self.extract_path)

        # Reconfigure and build python bindings
        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"))

        SolverInstaller.run("bash ./configure -python",
                          directory=os.path.join(self.extract_path, "boolector"))
        SolverInstaller.run("make",
                          directory=os.path.join(self.extract_path, "boolector"))
开发者ID:satyauppalapati,项目名称:pysmt,代码行数:16,代码来源:btor.py

示例9: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Unpack
        SolverInstaller.untar(os.path.join(self.base_dir, self.archive_name),
                              self.extract_path)

        # Build lingeling
        SolverInstaller.run("bash ./contrib/setup-lingeling.sh",
                            directory=self.extract_path)

        # Build Btor
        SolverInstaller.run("bash ./contrib/setup-btor2tools.sh",
                            directory=self.extract_path)

        # Inject Python library and include paths into CMake because Boolector
        # search system can be fooled in some systems
        import distutils.sysconfig as sysconfig
        PYTHON_LIBRARY = sysconfig.get_config_var('LIBDIR')
        PYTHON_INCLUDE_DIR = sysconfig.get_python_inc()
        CMAKE_OPTS = ' -DPYTHON_LIBRARY=' + PYTHON_LIBRARY
        CMAKE_OPTS += ' -DPYTHON_INCLUDE_DIR=' + PYTHON_INCLUDE_DIR

        # Build Boolector Solver
        SolverInstaller.run("bash ./configure.sh --python",
                            directory=self.extract_path,
                            env_variables={"CMAKE_OPTS": CMAKE_OPTS})

        SolverInstaller.run("make -j2",
                            directory=os.path.join(self.extract_path, "build"))
开发者ID:pysmt,项目名称:pysmt,代码行数:30,代码来源:btor.py

示例10: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Prepare the building system
        SolverInstaller.run("bash autogen.sh", 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 = "./configure --prefix={bin_path} \
                              --enable-language-bindings=python \
                              --with-antlr-dir={dir_path}/antlr-3.4 ANTLR={dir_path}/antlr-3.4/bin/antlr3;\
                  make; \
                  make install ".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,
                            directory=self.extract_path,
                            env_variables=pyconfig)

        # Fix the paths of the bindings
        SolverInstaller.run("cp CVC4.so.3.0.0 _CVC4.so",
                            directory=os.path.join(self.bin_path, "lib/pyshared"))
开发者ID:agriggio,项目名称:pysmt,代码行数:27,代码来源:cvc4.py

示例11: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Build ANTLR
        SolverInstaller.run("bash get-antlr-3.4",
                            directory=os.path.join(self.extract_path, "contrib"))

        # Build ABC
        # SolverInstaller.run("bash get-abc",
        #                     directory=os.path.join(self.extract_path, "contrib"))
        # Build GLPK
        # We could configure with --gpl --best, but this takes forever to build

        # Inject Python library and include paths into CMake because CVC4 search
        # system can be fooled in some systems
        import distutils.sysconfig as sysconfig
        PYTHON_LIBRARY = sysconfig.get_config_var('LIBDIR')
        PYTHON_INCLUDE_DIR = sysconfig.get_python_inc()
        SolverInstaller.run(['sed', '-i',
                             's|cmake_opts=""|cmake_opts="-DPYTHON_LIBRARY=' + PYTHON_LIBRARY + ' -DPYTHON_INCLUDE_DIR=' + PYTHON_INCLUDE_DIR + '"|g',
                             './configure.sh'], directory=self.extract_path)

        # Configure and build CVC4
        config_cmd = "./configure.sh --language-bindings=python \
                                     --python%s" % self.python_version[0]

        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.build_path,
                            env_variables=pyconfig)
开发者ID:pysmt,项目名称:pysmt,代码行数:35,代码来源:cvc4.py

示例12: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Select the correct Makefile to be used
        makefile = "Makefile"
        if self.architecture == "x86_64":
            makefile = "Makefile_64bit"

        # Build the pycudd
        command = ['python%s-config' % self.python_version, '--prefix']
        p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None)
        prefix = p.stdout.read()

        if not prefix or len(prefix) == 0:
            prefix = "/usr"

        SolverInstaller.run("make -C %s -f %s PYTHON_VER=python%s" \
                            " PYTHON_LOC=%s" % (self.extract_path, makefile,
                                                self.python_version, prefix))
开发者ID:diasalvatore,项目名称:pysmt,代码行数:19,代码来源:bdd.py

示例13: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Select the correct Makefile to be used
        makefile = "Makefile"
        if self.architecture == "x86_64":
            makefile = "Makefile_64bit"

        # Build the pycudd
        command = ['python%s-config' % self.python_version, '--includes']
        p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None)
        prefix = p.stdout.read()
        if PY2:
            pass # Prefix is already a string
        else:
            # > PY3 Prefix is binary data
            prefix = prefix.decode()

        if not prefix or len(prefix) == 0:
            prefix = "/usr"

        SolverInstaller.run("make -C %s -f %s PYTHON_INCL=%s" %
                            (self.extract_path, makefile, prefix))
开发者ID:agriggio,项目名称:pysmt,代码行数:23,代码来源:bdd.py

示例14: compile

# 需要导入模块: from pysmt.cmd.installers.base import SolverInstaller [as 别名]
# 或者: from pysmt.cmd.installers.base.SolverInstaller import run [as 别名]
    def compile(self):
        # Prepare an empty folder for installing yices
        SolverInstaller.clean_dir(self.yices_path)

        if self.needs_compilation:
            SolverInstaller.run("bash configure --prefix %s" % self.yices_path,
                                directory=self.extract_path)
            SolverInstaller.run("make", directory=self.extract_path)
            SolverInstaller.run("make install", directory=self.extract_path)
        else:
            SolverInstaller.run("bash ./install-yices %s" % self.yices_path,
                                directory=self.extract_path)

        self.install_yicespy()
开发者ID:pysmt,项目名称:pysmt,代码行数:16,代码来源:yices.py


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