Example #1
0
    def compile(self):
        # Override default Python library, include, and interpreter
        # path into Boolector's CMake because CMake can get confused
        # if multiple interpreters are available, especially python 2
        # vs python 3.
        import distutils.sysconfig as sysconfig
        import sys
        PYTHON_LIBRARY = os.environ.get('PYSMT_PYTHON_LIBDIR')
        if not PYTHON_LIBRARY:
            PYTHON_LIBRARY = sysconfig.get_config_var('LIBDIR')
        PYTHON_INCLUDE_DIR = sysconfig.get_python_inc()
        PYTHON_EXECUTABLE = sys.executable
        CMAKE_OPTS = ' -DPYTHON_LIBRARY=' + PYTHON_LIBRARY
        CMAKE_OPTS += ' -DPYTHON_INCLUDE_DIR=' + PYTHON_INCLUDE_DIR
        CMAKE_OPTS += ' -DPYTHON_EXECUTABLE=' + PYTHON_EXECUTABLE

        # 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)

        # 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"))
Example #2
0
    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"))
Example #3
0
    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()
        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)

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

        SolverInstaller.run("make -j2",
                            directory=os.path.join(self.extract_path, "build"))
Example #4
0
File: btor.py Project: pysmt/pysmt
    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"))
Example #5
0
    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})
Example #6
0
File: yices.py Project: pysmt/pysmt
    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)
Example #7
0
    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)