• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python base.SolverInstaller类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: download

    def download(self):
        self.complete_version = "%s.%s" % (self.solver_version,
                                           self.pypicosat_minor_version)
        pypi_link = "http://pypi.python.org/pypi/pyPicoSAT/%s/json" % self.complete_version
        response = urllib2.urlopen(pypi_link)
        reader = codecs.getreader("utf-8")
        pypi_json = json.load(reader(response))

        self.native_link = pypi_json["urls"][0]["url"]
        self.archive_name = pypi_json["urls"][0]["filename"]
        self.archive_path = os.path.join(self.base_dir, self.archive_name)
        self.extract_path = os.path.join(self.base_dir, self.archive_name[:-7])

        SolverInstaller.download(self)
开发者ID:agriggio,项目名称:pysmt,代码行数:14,代码来源:pico.py


示例17: compile

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


示例18: __init__

    def __init__(self, install_dir, bindings_dir, solver_version,
                 mirror_link=None):
        archive_name = "mathsat-%s-%s-%s.tar.gz" % (solver_version,
                                                    self.os_name,
                                                    self.architecture)
        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:diasalvatore,项目名称:pysmt,代码行数:14,代码来源:msat.py


示例19: compile

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


示例20: compile

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python environment.get_env函数代码示例发布时间:2022-05-26
下一篇:
Python smi.parserFactory函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap