Skip to content

Commit c4ee2b2

Browse files
authored
Merge pull request #544 from sosy-lab/503-update-mathsat-5-6-12
#503: update MathSAT5 to version 5.6.12
2 parents a79e105 + cdca9fa commit c4ee2b2

File tree

12 files changed

+171
-22
lines changed

12 files changed

+171
-22
lines changed

build/build-publish-solvers/solver-mathsat.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file is part of JavaSMT,
55
an API wrapper for a collection of SMT solvers:
66
https://github.com/sosy-lab/java-smt
77
8-
SPDX-FileCopyrightText: 2024 Dirk Beyer <https://www.sosy-lab.org>
8+
SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
99
1010
SPDX-License-Identifier: Apache-2.0
1111
-->
@@ -73,7 +73,7 @@ SPDX-License-Identifier: Apache-2.0
7373
<copy file="lib/native/source/libmathsat5j/libmathsat5j-arm64.so" tofile="${mathsat.dist.dir}/arm64/libmathsat5j-${mathsat.version}.so"/>
7474
<copy file="lib/native/source/libmathsat5j/mathsat5j.dll" tofile="${mathsat.dist.dir}/x64/mathsat5j-${mathsat.version}.dll"/>
7575
<copy file="${mathsat-windows-x64.path}/lib/mathsat.dll" tofile="${mathsat.dist.dir}/x64/mathsat-${mathsat.version}.dll"/>
76-
<copy file="${mathsat-windows-x64.path}/bin/mpir.dll" tofile="${mathsat.dist.dir}/x64/mpir-${mathsat.version}.dll"/>
76+
<copy file="${mathsat-windows-x64.path}/bin/gmp.dll" tofile="${mathsat.dist.dir}/x64/gmp-${mathsat.version}.dll"/>
7777
<copy file="${gmp-windows-x64.path}/.libs/libgmp-10.dll" tofile="${mathsat.dist.dir}/x64/gmp-${mathsat.version}.dll"/>
7878

7979
<ivy:resolve conf="solver-mathsat" file="solvers_ivy_conf/ivy_mathsat.xml"/>

doc/Developers-How-to-Release-into-Ivy.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,9 @@ but in the normal system environment, where some testing can be applied by the d
271271
We publish MathSAT for Linux (x64 and arm64) and Windows (x64) systems at once.
272272
The build process can fully be done on a Linux system,
273273
and requires several dependencies, such as gcc, x86_64-w64-mingw32-gcc, and aarch64-linux-gnu-gcc.
274-
We prefer to use the Docker container based on Ubuntu 22.04 (better use Ubuntu 18.04 for older GLIBC!)
274+
We prefer to use the Docker container based on Ubuntu 24.04
275275
for compiling the dependencies and assembling the libraries.
276+
Since MathSAT5 5.6.12, using Ubuntu 18.04 or 22.04 with older GLIBC no longer works!
276277

277278
First, [download the (reentrant!) Linux and Windows64 binary release](http://mathsat.fbk.eu/download.html) in the same version, unpack them.
278279
Then provide the necessary dependencies (GMP/JDK for Linux (x64 and arm64) and GMP/JDK for Windows (x64))
@@ -295,15 +296,15 @@ ant publish-mathsat \
295296
Example:
296297
```
297298
ant publish-mathsat \
298-
-Dmathsat-linux-x64.path=/workspace/solvers/mathsat/mathsat-5.6.11-linux-x86_64-reentrant \
299+
-Dmathsat-linux-x64.path=/workspace/solvers/mathsat/mathsat-5.6.12-linux-x86_64 \
299300
-Dgmp-linux-x64.path=/workspace/solvers/gmp/gmp-6.3.0-linux-x64 \
300-
-Dmathsat-windows-x64.path=/workspace/solvers/mathsat/mathsat-5.6.11-win64-msvc \
301+
-Dmathsat-windows-x64.path=/workspace/solvers/mathsat/mathsat-5.6.12-win64 \
301302
-Djdk-windows-x64.path=/workspace/solvers/jdk/openjdk-17.0.2_windows-x64_bin/jdk-17.0.2 \
302303
-Dgmp-windows-x64.path=/workspace/solvers/gmp/gmp-6.3.0-win-x64 \
303-
-Dmathsat-linux-arm64.path=/workspace/solvers/mathsat/mathsat-5.6.11-linux-aarch64-reentrant \
304+
-Dmathsat-linux-arm64.path=/workspace/solvers/mathsat/mathsat-5.6.12-linux-aarch64 \
304305
-Dgmp-linux-arm64.path=/workspace/solvers/gmp/gmp-6.3.0-linux-arm64 \
305306
-Djdk-linux-arm64.path=/workspace/solvers/jdk/openjdk-17.0.2_linux-aarch64_bin/jdk-17.0.2 \
306-
-Dmathsat.version=5.6.11
307+
-Dmathsat.version=5.6.12
307308
```
308309
Finally, follow the instructions shown in the message at the end.
309310

docker/buildUbuntu2404.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# This file is part of JavaSMT,
4+
# an API wrapper for a collection of SMT solvers:
5+
# https://github.com/sosy-lab/java-smt
6+
#
7+
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
8+
#
9+
# SPDX-License-Identifier: Apache-2.0
10+
11+
podman build \
12+
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
13+
-t registry.gitlab.com/sosy-lab/software/java-smt/develop:ubuntu2404 - < ubuntu2404.Dockerfile
14+
15+
# For pushing to Gitlab registry, please create your personal access token:
16+
# https://gitlab.com/-/user_settings/personal_access_tokens
17+
# with read and write rights to the Gitlab registry (full API access is not required)
18+
#
19+
# Please use the following commands to push the build image to Gitlab:
20+
# podman login registry.gitlab.com
21+
# podman push registry.gitlab.com/sosy-lab/software/java-smt/develop:ubuntu2404

docker/runUbuntu2404.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# This file is part of JavaSMT,
4+
# an API wrapper for a collection of SMT solvers:
5+
# https://github.com/sosy-lab/java-smt
6+
#
7+
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
8+
#
9+
# SPDX-License-Identifier: Apache-2.0
10+
11+
# JavaSMT and all solver files are located in the directory WORKSPACE.
12+
# Derive WORKSPACE from the script's location (two directories up from current)
13+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14+
WORKSPACE="$(realpath "${SCRIPT_DIR}/../..")"
15+
16+
podman run -it \
17+
--mount type=bind,source=${WORKSPACE},target=/workspace \
18+
--workdir /workspace/java-smt \
19+
registry.gitlab.com/sosy-lab/software/java-smt/develop:ubuntu2404

docker/ubuntu2404.Dockerfile

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# This file is part of JavaSMT,
2+
# an API wrapper for a collection of SMT solvers:
3+
# https://github.com/sosy-lab/java-smt
4+
#
5+
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
6+
#
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
FROM ubuntu:24.04
10+
11+
# set default locale
12+
RUN apt-get update \
13+
&& DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
14+
tzdata locales locales-all \
15+
&& apt-get clean
16+
ENV LC_ALL=en_US.UTF-8
17+
ENV LANG=en_US.UTF-8
18+
ENV LANGUAGE=en_US.UTF-8
19+
20+
# Install basic packages for building several solvers
21+
RUN apt-get update \
22+
&& apt-get install -y \
23+
wget curl git build-essential cmake patchelf unzip \
24+
openjdk-11-jdk ant maven \
25+
gcc-mingw-w64-x86-64-posix g++-mingw-w64-x86-64-posix \
26+
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
27+
binutils-aarch64-linux-gnu libc6-dev-arm64-cross \
28+
zlib1g-dev m4 \
29+
&& apt-get clean
30+
31+
# Yices2 requires some dependencies
32+
RUN apt-get update \
33+
&& apt-get install -y \
34+
autoconf gperf \
35+
&& apt-get clean
36+
37+
# Bitwuzla requires Ninja and Meson (updated version from pip), and uses SWIG >4.0 from dependencies.
38+
# GMP >6.3.0 is automatically downloaded and build within Bitwuzla.
39+
RUN apt-get update \
40+
&& apt-get install -y \
41+
ninja-build python3-pip meson \
42+
&& apt-get clean
43+
44+
# OpenSMT requires swig, gmp, flex and bison
45+
# - swig v4.1 or newer for unique_ptr support
46+
# - libpcre2-dev is a dependency of swig
47+
# - gmp needs to be recompiled to generate PIC code (see below)
48+
# - lzip is required to unpack the gmp tar ball
49+
RUN apt-get update \
50+
&& apt-get install -y \
51+
cmake flex bison libpcre2-dev lzip swig \
52+
&& apt-get clean
53+
54+
WORKDIR /dependencies
55+
56+
# Install GMP for linux on x64 and arm64
57+
# We could add another build for windows when needed
58+
RUN wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz \
59+
&& tar xf gmp-6.2.1.tar.lz \
60+
&& rm gmp-6.2.1.tar.lz \
61+
&& cd gmp-6.2.1 \
62+
&& ./configure \
63+
--enable-cxx \
64+
--with-pic \
65+
--disable-shared \
66+
--enable-fat \
67+
--prefix=/dependencies/gmp-6.2.1/install/x64-linux \
68+
&& make -j4 \
69+
&& make install \
70+
&& make clean \
71+
&& ./configure \
72+
--enable-cxx \
73+
--with-pic \
74+
--disable-shared \
75+
--enable-fat \
76+
--host=aarch64-linux-gnu \
77+
--prefix=/dependencies/gmp-6.2.1/install/arm64-linux \
78+
&& CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ LD=aarch64-linux-gnu-ld make -j4 \
79+
&& make install \
80+
&& make clean
81+
82+
# Install the Jdk for Windows x64
83+
RUN wget https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_windows-x64_bin.zip \
84+
&& unzip openjdk-11+28_windows-x64_bin.zip \
85+
&& mv jdk-11 jdk11-windows-x64 \
86+
&& rm openjdk-11+28_windows-x64_bin.zip
87+
88+
# Install the Jdk for Linux arm64
89+
RUN wget https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-aarch64_bin.tar.gz \
90+
&& tar -xzf openjdk-17.0.2_linux-aarch64_bin.tar.gz \
91+
&& mv jdk-17.0.2 jdk17-linux-aarch64 \
92+
&& rm openjdk-17.0.2_linux-aarch64_bin.tar.gz
93+
94+
# JNI is not found when compiling Boolector in the image, so we need to set JAVA_HOME
95+
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
96+
97+
# set labels for the image
98+
ARG BUILD_DATE
99+
LABEL org.opencontainers.image.created="${BUILD_DATE}"
100+
LABEL org.opencontainers.image.title="JavaSMT solver development"
101+
LABEL org.opencontainers.image.description="Ubuntu 24.04-based image for JavaSMT solver development"
102+
LABEL org.opencontainers.image.source="https://github.com/sosy-lab/java-smt"
103+
LABEL org.opencontainers.image.licenses="Apache-2.0"
104+
105+
# Podman-Specific Label for Auto-Update
106+
LABEL io.containers.autoupdate=registry
107+

lib/ivy.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ SPDX-License-Identifier: Apache-2.0
188188
<dependency org="edu.tum.cs" name="java-cup" rev="11b-20160615" conf="runtime-princess->runtime"/>
189189

190190
<!-- Solver Binaries -->
191-
<dependency org="org.sosy_lab" name="javasmt-solver-mathsat" rev="5.6.11-sosy1" conf="runtime-mathsat-x64->solver-mathsat-x64; runtime-mathsat-arm64->solver-mathsat-arm64" />
191+
<dependency org="org.sosy_lab" name="javasmt-solver-mathsat" rev="5.6.12" conf="runtime-mathsat-x64->solver-mathsat-x64; runtime-mathsat-arm64->solver-mathsat-arm64" />
192192
<dependency org="org.sosy_lab" name="javasmt-solver-z3" rev="4.15.2" conf="runtime-z3-x64->solver-z3-x64; runtime-z3-arm64->solver-z3-arm64; contrib->sources,javadoc" />
193193
<dependency org="org.sosy_lab" name="javasmt-solver-opensmt" rev="2.9.0-gef441e1c" conf="runtime-opensmt-x64->solver-opensmt-x64; runtime-opensmt-arm64->solver-opensmt-arm64; contrib->sources,javadoc"/>
194194
<dependency org="org.sosy_lab" name="javasmt-solver-optimathsat" rev="1.7.3-sosy1" conf="runtime-optimathsat->solver-optimathsat" />

lib/native/source/libmathsat5j/compileForWindows.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# an API wrapper for a collection of SMT solvers:
55
# https://github.com/sosy-lab/java-smt
66
#
7-
# SPDX-FileCopyrightText: 2024 Dirk Beyer <https://www.sosy-lab.org>
7+
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
88
#
99
# SPDX-License-Identifier: Apache-2.0
1010

@@ -20,8 +20,9 @@
2020
# There are the following dependencies:
2121
# - MinGW (install Ubuntu package: `mingw-w64`)
2222
# - The MathSAT5 library for Windows64 as can be downloaded from http://mathsat.fbk.eu/download.html
23-
# - MathSAT5 is linked against MPIR which aims to be compatible to GMP.
24-
# Since 2017, MPIR is no longer developed. We use the precompiled `mpir.dll` from the MathSAT5 archive.
23+
# - MathSAT5 is linked against GMP. We use the precompiled `gmp.dll` from the MathSAT5 archive.
24+
# Previously, MathSAT5 used MPIR which aimed to be compatible to GMP.
25+
# Since 2017, MPIR was no longer developed, and since 2022, MPIR officially dead.
2526
# When compiling our bindings, we use the header files from GMP.
2627
# We do not actually need to compile it. However, this is a nice test, whether our build system works as expected.
2728
# To build GMP, download GMP 6.3.0 from http://gmplib.org/ and run
@@ -87,7 +88,7 @@ $CC -g -std=gnu99 -Wall -Wextra -Wpedantic -Wno-return-type -Wno-unused-paramete
8788
-o $OUT_FILE -shared -Wl,-soname,$OUT_FILE \
8889
-D_JNI_IMPLEMENTATION_ -Wl,--kill-at \
8990
$JNI_HEADERS -I$MSAT_SRC_DIR -I$GMP_DIR -L$MSAT_LIB_DIR $SRC_FILES \
90-
-lmathsat $MSAT_BIN_DIR/mpir.dll -lstdc++ -lpsapi
91+
-lmathsat $MSAT_BIN_DIR/gmp.dll -lstdc++ -lpsapi
9192

9293
echo "Compilation Done"
9394
echo "Reducing file size by dropping unused symbols..."

lib/native/x86_64-windows/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This file is part of JavaSMT,
33
an API wrapper for a collection of SMT solvers:
44
https://github.com/sosy-lab/java-smt
55
6-
SPDX-FileCopyrightText: 2020 Dirk Beyer <https://www.sosy-lab.org>
6+
SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
77
88
SPDX-License-Identifier: Apache-2.0
99
-->
@@ -32,7 +32,7 @@ For Z3:
3232
- `mklink libz3java.dll ..\..\java\runtime-z3\x64\libz3java.dll`
3333

3434
For MathSAT5:
35-
- `mklink mpir.dll ..\..\java\runtime-mathsat\x64\mpir.dll`
35+
- `mklink gmp.dll ..\..\java\runtime-mathsat\x64\gmp.dll`
3636
- `mklink mathsat.dll ..\..\java\runtime-mathsat\x64\mathsat.dll`
3737
- `mklink mathsat5j.dll ..\..\java\runtime-mathsat\x64\mathsat5j.dll`
3838

@@ -54,7 +54,7 @@ For Z3:
5454
- `copy ..\..\java\runtime-z3\x64\libz3java.dll libz3java.dll`
5555

5656
For MathSAT5:
57-
- `copy ..\..\java\runtime-mathsat\x64\mpir.dll mpir.dll`
57+
- `copy ..\..\java\runtime-mathsat\x64\gmp.dll gmp.dll`
5858
- `copy ..\..\java\runtime-mathsat\x64\mathsat.dll mathsat.dll`
5959
- `copy ..\..\java\runtime-mathsat\x64\mathsat5j.dll mathsat5j.dll`
6060

solvers_ivy_conf/ivy_mathsat.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file is part of JavaSMT,
55
an API wrapper for a collection of SMT solvers:
66
https://github.com/sosy-lab/java-smt
77
8-
SPDX-FileCopyrightText: 2020 Dirk Beyer <https://www.sosy-lab.org>
8+
SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
99
1010
SPDX-License-Identifier: Apache-2.0
1111
-->
@@ -45,7 +45,7 @@ SPDX-License-Identifier: Apache-2.0
4545
<!-- Windows x64 files -->
4646
<artifact name="mathsat5j" conf="solver-mathsat-windows-x64" e:arch="x64" type="dll" ext="dll"/>
4747
<artifact name="mathsat" conf="solver-mathsat-windows-x64" e:arch="x64" type="dll" ext="dll"/>
48-
<artifact name="mpir" conf="solver-mathsat-windows-x64" e:arch="x64" type="dll" ext="dll"/>
48+
<artifact name="gmp" conf="solver-mathsat-windows-x64" e:arch="x64" type="dll" ext="dll"/>
4949
</publications>
5050
<dependencies></dependencies>
5151

solvers_maven_conf/maven_mathsat_pom_template.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file is part of JavaSMT,
66
an API wrapper for a collection of SMT solvers:
77
https://github.com/sosy-lab/java-smt
88
9-
SPDX-FileCopyrightText: 2021 Dirk Beyer <https://www.sosy-lab.org>
9+
SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
1010
1111
SPDX-License-Identifier: Apache-2.0
1212
-->
@@ -41,7 +41,7 @@ SPDX-License-Identifier: Apache-2.0
4141
<url>http://mathsat.fbk.eu/download.html</url>
4242
</license>
4343
<license>
44-
<name>MPIR is licensed LGPL v3+</name>
44+
<name>GMP is licensed both GNU LGPL v3 and GNU GPL v2</name>
4545
<url>https://www.gnu.org/licenses/lgpl-3.0.en.html</url>
4646
</license>
4747
</licenses>

0 commit comments

Comments
 (0)