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


Python base.SolverInstaller类代码示例

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


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

示例1: __init__

    def __init__(self, install_dir, bindings_dir, solver_version,
                 mirror_link=None, yicespy_version='HEAD'):

        self.needs_compilation = False
        if self.os_name == "darwin" or self.needs_compilation:
            sysctl = self.run("sysctl -a", get_output=True, suppress_stderr=True)
            if 'hw.optional.avx2_0: 1' in sysctl:
                # No need to compile, see http://yices.csl.sri.com/faq.html
                pack = "x86_64-apple-darwin16.7.0-static-gmp"
            else:
                self.needs_compilation = True
                pack = "src"
        else:
            pack = "x86_64-pc-linux-gnu-static-gmp"

        archive_name = "yices-%s-%s.tar.gz" % (solver_version, pack)
        native_link = "http://yices.csl.sri.com/releases/{solver_version}/{archive_name}"
        SolverInstaller.__init__(self, install_dir=install_dir,
                                 bindings_dir=bindings_dir,
                                 solver_version=solver_version,
                                 archive_name=archive_name,
                                 native_link=native_link,
                                 mirror_link=mirror_link)

        self.extract_path = os.path.join(self.base_dir, "yices-%s" % self.solver_version)
        self.yices_path = os.path.join(self.bindings_dir, "yices_bin")
        self.yicespy_git_version = yicespy_version
开发者ID:pysmt,项目名称:pysmt,代码行数:27,代码来源:yices.py

示例2: __init__

    def __init__(self, install_dir, bindings_dir, solver_version,
                 mirror_link=None):

        # Getting the right archive name
        os_name = self.os_name
        arch = self.architecture
        ext = "tar.gz"
        if os_name == "windows":
            ext = "zip"
            arch = "msvc"
            if self.architecture == "x86_64":
                os_name = "win64"
            else:
                os_name = "win32"
        elif os_name == "darwin":
            os_name = "darwin-libcxx"

        archive_name = "mathsat-%s-%s-%s.%s" % (solver_version, os_name,
                                                arch, ext)

        native_link = "http://mathsat.fbk.eu/download.php?file={archive_name}"

        SolverInstaller.__init__(self, install_dir=install_dir,
                                 bindings_dir=bindings_dir,
                                 solver_version=solver_version,
                                 archive_name=archive_name,
                                 native_link = native_link,
                                 mirror_link=mirror_link)

        self.python_bindings_dir = os.path.join(self.extract_path, "python")
开发者ID:mpreiner,项目名称:pysmt,代码行数:30,代码来源:msat.py

示例3: compile

    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,代码行数:28,代码来源:bdd.py

示例4: compile

    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,代码行数:28,代码来源:btor.py

示例5: __init__

    def __init__(self, install_dir, bindings_dir, solver_version,
                 mirror_link=None, osx=None, git_version=None, commit=None):
        arch = self.architecture
        if arch == "x86_64":
            arch = "x64"

        system = self.os_name
        if system == "linux":
            system = "ubuntu-14.04"
        elif system == "darwin":
            system = "osx-%s" % osx
        elif system == "windows":
            system = "win"

        if git_version is None:
            # Stable versions template
            archive_name = "z3-%s.%s-%s-%s.zip" % (solver_version, commit, arch, system)
            native_link = "https://github.com/Z3Prover/z3/releases/download/z3-" + solver_version + "/{archive_name}"
            # print(native_link)
        else:
            # Nightly build template
            archive_name = "z3-%s.%s-%s-%s.zip" % (solver_version, git_version, arch, system)
            native_link = "https://github.com/pysmt/Z3bin/blob/master/nightly/{archive_name}?raw=true"

        SolverInstaller.__init__(self, install_dir=install_dir,
                                 bindings_dir=bindings_dir,
                                 solver_version=solver_version,
                                 archive_name=archive_name,
                                 native_link=native_link,
                                 mirror_link=mirror_link)
开发者ID:pysmt,项目名称:pysmt,代码行数:30,代码来源:z3.py

示例6: compile

    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,代码行数:8,代码来源:yices.py

示例7: __init__

 def __init__(self, install_dir, bindings_dir, solver_version, mirror_link=None):
     SolverInstaller.__init__(
         self,
         install_dir=install_dir,
         bindings_dir=bindings_dir,
         solver_version=solver_version,
         mirror_link=mirror_link,
     )
开发者ID:diasalvatore,项目名称:pysmt,代码行数:8,代码来源:pico.py

示例8: __init__

 def __init__(self, install_dir, bindings_dir, solver_version,
              mirror_link=None):
     archive_name = "boolector-%s-with-lingeling-b85.tar.bz2" % solver_version
     native_link = "http://fmv.jku.at/boolector/{archive_name}"
     SolverInstaller.__init__(self, install_dir=install_dir,
                              bindings_dir=bindings_dir,
                              solver_version=solver_version,
                              archive_name=archive_name,
                              native_link=native_link,
                              mirror_link=mirror_link)
开发者ID:diasalvatore,项目名称:pysmt,代码行数:10,代码来源:btor.py

示例9: __init__

 def __init__(self, install_dir, bindings_dir, solver_version,
              pypicosat_minor_version, mirror_link=None):
     self.pypicosat_minor_version = pypicosat_minor_version
     self.complete_version = None
     SolverInstaller.__init__(self, install_dir=install_dir,
                              bindings_dir=bindings_dir,
                              solver_version=solver_version,
                              mirror_link=mirror_link,
                              native_link=None,
                              archive_name=None)
开发者ID:agriggio,项目名称:pysmt,代码行数:10,代码来源:pico.py

示例10: move

    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)
开发者ID:fontealpina,项目名称:pysmt,代码行数:10,代码来源:pico.py

示例11: compile

    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,代码行数:10,代码来源:bdd.py

示例12: __init__

 def __init__(self, install_dir, bindings_dir, solver_version,
              mirror_link=None, git_version='HEAD'):
     archive_name = "repycudd-%s.tar.gz" % git_version
     native_link = "https://codeload.github.com/pysmt/repycudd/tar.gz/%s" % git_version
     SolverInstaller.__init__(self, install_dir=install_dir,
                              bindings_dir=bindings_dir,
                              solver_version=solver_version,
                              archive_name=archive_name,
                              native_link=native_link,
                              mirror_link=mirror_link)
     self.git_version = git_version
开发者ID:diasalvatore,项目名称:pysmt,代码行数:11,代码来源:bdd.py

示例13: __init__

 def __init__(self, install_dir, bindings_dir, solver_version,
              mirror_link=None, git_version='HEAD'):
     archive_name = "CVC4-%s.tar.gz" % git_version
     native_link = "https://codeload.github.com/CVC4/CVC4/tar.gz/%s" % (git_version)
     SolverInstaller.__init__(self, install_dir=install_dir,
                              bindings_dir=bindings_dir,
                              solver_version=solver_version,
                              archive_name=archive_name,
                              native_link=native_link,
                              mirror_link=mirror_link)
     self.git_version = git_version
     self.bin_path = os.path.join(self.bindings_dir, "CVC4_bin")
开发者ID:diasalvatore,项目名称:pysmt,代码行数:12,代码来源:cvc4.py

示例14: __init__

    def __init__(self, install_dir, bindings_dir, solver_version,
                 mirror_link=None):
        pack = "x86_64-unknown-linux-gnu-static-gmp"
        archive_name = "yices-%s-%s.tar.gz" % (solver_version, pack)
        native_link = "http://yices.csl.sri.com/cgi-bin/yices2-newnewdownload.cgi?file={archive_name}&accept=I+Agree"
        SolverInstaller.__init__(self, install_dir=install_dir,
                                 bindings_dir=bindings_dir,
                                 solver_version=solver_version,
                                 archive_name=archive_name,
                                 native_link=native_link,
                                 mirror_link=mirror_link)

        self.extract_path = os.path.join(self.base_dir, "yices-%s" % self.solver_version)
        self.yices_path = os.path.join(self.bindings_dir, "yices_bin")
开发者ID:diasalvatore,项目名称:pysmt,代码行数:14,代码来源:yices.py

示例15: move

    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)
开发者ID:agriggio,项目名称:pysmt,代码行数:14,代码来源:msat.py


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