Skip to content

Commit

Permalink
Merge pull request #59 from pysmt/cvc4_prefix_pr
Browse files Browse the repository at this point in the history
CVC4 Prefix
  • Loading branch information
mikand committed Mar 24, 2015
2 parents a94996b + 8089a5e commit 1524d83
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
23 changes: 13 additions & 10 deletions pysmt/cmd/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,24 +231,23 @@ def install_cvc4(options):
archive_name = "%s.tar.gz" % base_name
archive = os.path.join(BASE_DIR, archive_name)
dir_path = os.path.join(BASE_DIR, base_name)
bin_path = os.path.join(BASE_DIR, "CVC4_bin")
patch_name = "dc5f12722b06cf18aa06686921885b9ad9441f9d/cvc4_wrapper.patch"

# Use precompiled version of the solver
if bin_mirror is not None:
bin_archive = os.path.join(bin_mirror, archive_name)
download(bin_archive, archive)
untar(archive, BASE_DIR)
PATHS.append("%s/CVC4_bin/share/pyshared" % BASE_DIR)
PATHS.append("%s/CVC4_bin/lib/pyshared" % BASE_DIR)
return

# Download the cvc4 release if needed
if not os.path.exists(archive):
download(get_cvc4_download_link(git), archive)

# clear the destination directory, if any
if os.path.exists(dir_path):
os.system("rm -rf %s" % dir_path)
if os.path.exists(bin_path):
os.system("rm -rf %s" % bin_path)

# Extract the CVC4 distribution
untar(archive, BASE_DIR)
Expand All @@ -262,15 +261,19 @@ def install_cvc4(options):
# Build ANTLR
os.system("cd %s/contrib; bash get-antlr-3.4;" % dir_path)
# Configure and build CVC4
os.system("cd %s; \
./configure --enable-language-bindings=python \
--with-antlr-dir=%s/antlr-3.4 ANTLR=%s/antlr-3.4/bin/antlr3; make " %\
(dir_path, dir_path, dir_path))
os.system("cd {dir_path}; \
./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=bin_path, dir_path=dir_path))

# Fix the paths of the bindings
os.system("cd %s/builds/src/bindings/python; mv .libs/CVC4.so.3.0.0 ./_CVC4.so" % dir_path)
os.system("cd %s/lib/pyshared; ln -s CVC4.so.3.0.0 _CVC4.so" % bin_path )

# Save the paths
PATHS.append("%s/builds/src/bindings/python" % dir_path)
PATHS.append("%s/share/pyshared" % bin_path)
PATHS.append("%s/lib/pyshared" % bin_path)



Expand Down
3 changes: 2 additions & 1 deletion shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ install:
#
env:
global:
# These variables are used to set mirrors for the solvers
# Source Mirror:
- secure: IzzUEuWb2+h3gzttT0237NDkptzu4UvPN1okinDgm4Rx0uADXVWJy6gvcWaeL8F6tl8KGkpcFvzGHmwj7RGGRk8AAj+OVf+VilSlWwNe1g8SYHwxOPrTgD4ECX3860hleeI3F2DD+yFIo9Hgw3ZiHBsfbombtFGTB5WWwUgezXsENMKuNJ580MN8+c3I4IV44pSXJ179GluJ3O1e/xUkwJ5/nvysWd4q7wqJ6aIz5ZFMFhs/FKAbeEdtmmGODn2FspGJ+iKVyc0IbQpzLJO1MeizBXnGZfN9Ojv7mkPJcgzqFMjvLnpCJAEmZl3BzJFc0j9xxILvrrjHU/TKrlJkSw==
# Binaries Mirror:
- secure: nuGI4WDZOFDezaSxQUKyOP19iqRmQSASv5tpCCsryQ3AtI3in/1dYndDUwmzGYfoVkHTOsf6n4O3XEAruktPpVZzLSlek9zcr8v0IERTfzhoGCWRqqYDrDoCU6Hc2WYyGOhGGEzfldsY1EVMx5+LsVz0JoVZFe75CO6oWvuEYVYRmeJYzKQWLuXXwQMkfYulX1ouF1b5JCdeepbUfwcf4o34RPrd6eLoL7Y1RT4SBsR0uX4lpnWvUB2qqoyOEvu/hXt9Zft57tW4OY2GUdlRlj/Hx/5fPIFGYJmsGu7BM/+Q1cLgZnyyH0mxaHtBkjt8ecMwUc/9PbNJ2alZDmIMyw==
matrix:
- PYSMT_SOLVER="msat"
Expand Down

0 comments on commit 1524d83

Please sign in to comment.