Permalink
Browse files

* Updated MathSAT to 5.5.0

* Removed patch from installers package, moving the setup.py in the dedicated repo

* Removed Win32 mathsat builds, because from 5.5.0 those are no longer supported.
  • Loading branch information...
mikand committed Dec 10, 2017
1 parent 981e085 commit baf25239fc5120d7eafbd95ad6ad47bf879cfeb9
Showing with 28 additions and 128 deletions.
  1. +14 −45 appveyor.yml
  2. +0 −47 ci/appveyor/run_with_env.cmd
  3. +1 −1 pysmt/cmd/install.py
  4. +13 −35 pysmt/cmd/installers/msat.py
View
@@ -1,10 +1,7 @@
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\appveyor\\run_with_env.cmd"
image:
- Visual Studio 2015
environment:
matrix:
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.x"
@@ -38,46 +35,18 @@ environment:
PYSMT_SOLVER: "z3"
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "32"
PYSMT_SOLVER: "msat"
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "64"
PYSMT_SOLVER: "msat"
# There is a problem with python 3.5+ with the compilation of
# MathSAT on AppVeyor. We need at least VS 2015 to build
# extensions, but it does not work on AppVeyor for some reason.
# see https://wiki.python.org/moin/WindowsCompilers for the
# compiler requirements. I tried several configurations but I am
# not able to force the compilation of the MathSAT wrapper with
# Visual Studio 14, Visual Studio 10 is being used
# instead. However, on my machine where I only have Visual Studio
# 14 this work flawlessly. I am not sure if this is an issue with
# the Windows SDK, the image itself or the presence of multiple
# version of Visual Studio.
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: "32"
PYSMT_SOLVER: "msat"
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x"
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
PYSMT_SOLVER: "msat"
install:
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""
- ECHO "Installed SDKs:"
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
# Install Python (from the official .msi of http://python.org) and pip when
# not already installed.
- ps: "./ci/appveyor/install.ps1"
@@ -88,32 +57,32 @@ install:
- cmd: "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Check that we have the expected version and architecture for Python
- cmd: "%CMD_IN_ENV% python --version"
- cmd: "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\""
- cmd: "python --version"
- cmd: "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- cmd: "%CMD_IN_ENV% pip install -r dev-requirements.txt"
- cmd: "pip install -r dev-requirements.txt"
# Update setputools
- cmd: "%CMD_IN_ENV% pip install --upgrade setuptools"
- cmd: "pip install --upgrade setuptools"
# Install the solvers
- cmd: "%CMD_IN_ENV% python install.py --confirm-agreement"
- cmd: "python install.py --confirm-agreement"
# Set and check the pythonpath
- cmd: "%CMD_IN_ENV% python install.py --env > bindings_path.bat"
- cmd: "python install.py --env > bindings_path.bat"
- cmd: "call ./bindings_path.bat"
- ECHO "PythonPath=%PYTHONPATH%"
- ECHO "Path=%PATH%"
build: false
test_script:
- "%CMD_IN_ENV% python install.py --check"
- "%CMD_IN_ENV% nosetests -v "
- cmd: "python install.py --check"
- cmd: "nosetests -v "
# after_test:
# # If tests are successful, create a whl package for the project.
# - "%CMD_IN_ENV% python setup.py bdist_wheel bdist_wininst"
# - cmd: "python setup.py bdist_wheel bdist_wininst"
# - ps: "ls dist"
# artifacts:

This file was deleted.

Oops, something went wrong.
View
@@ -31,7 +31,7 @@
# Build a list of installers, one for each solver
Installer = namedtuple("Installer", ["InstallerClass", "version", "extra_params"])
INSTALLERS = [Installer(MSatInstaller, "5.3.13", {}),
INSTALLERS = [Installer(MSatInstaller, "5.5.0", {}),
Installer(CVC4Installer, "1.5", {"git_version" : "05663e0d338c2bab30b5f19820de01788ec2b276"}),
Installer(Z3Installer, "4.5.1", {"osx": "10.11", "git_version": "082936bca6fb"}),
Installer(YicesInstaller, "2.5.2", {"yicespy_version": "f0768ffeec15ea310f830d10878971c9998454ac"}),
@@ -17,30 +17,6 @@
from pysmt.cmd.installers.base import SolverInstaller
# A patched version of setup.py for the Windows platform
WIN_PATCHED_SETUP_PY = """#!/usr/bin/env python
import os, sys
from setuptools import setup, Extension
MATHSAT_DIR = '..'
libraries = ['mathsat', 'psapi', 'mpir']
setup(name='mathsat', version='0.1',
description='MathSAT API',
ext_modules=[Extension('_mathsat', ['mathsat_python_wrap.c'],
define_macros=[('SWIG','1')],
include_dirs=[os.path.join(MATHSAT_DIR,
'include')],
library_dirs=[os.path.join(MATHSAT_DIR, 'lib')],
extra_compile_args=[],
extra_link_args=[],
libraries=libraries,
language='c++',
)]
)
"""
class MSatInstaller(SolverInstaller):
@@ -85,8 +61,7 @@ def compile(self):
# array that is malloc'd is freed with a call to msat_free
# instead of a plain free(). This issue has been fixed
# upstream, and this patching can be removed when we will
# upgrade the version of MathSAT to be greater (but not equal) to
# 5.4.1.
# upgrade the version of MathSAT
key = "if (arg2) msat_free(arg2);"
subst = "if (arg2) free(arg2);"
c_body = None
@@ -99,17 +74,19 @@ 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://raw.githubusercontent.com/mikand/tamer-windows-deps/master/gmp/include/gmp.h"
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
with open(os.path.join(self.python_bindings_dir, "setup.py"), "w") as f:
f.write(WIN_PATCHED_SETUP_PY)
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
SolverInstaller.run_python("./setup.py build", self.python_bindings_dir)
@@ -119,18 +96,19 @@ 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)
# Under windows we also need the DLLs of mathsat and mpir in the PATH
if self.os_name == "windows":
libdir = os.path.join(self.python_bindings_dir, "../lib")
SolverInstaller.mv(os.path.join(libdir, "mathsat.dll"), self.bindings_dir)
SolverInstaller.mv(os.path.join(libdir, "mpir.dll"), 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)
def get_installed_version(self):
return self.get_installed_version_script(self.bindings_dir, "msat")

0 comments on commit baf2523

Please sign in to comment.