Skip to content

Commit 5bafbdc

Browse files
committed
MathSAT5: replace MPIR with GMP.
MPIR was no longer developed since 2017, as there was GMP anyway. Now MPIR is officially dead and is removed from MathSAT and also from JavaSMT.
1 parent c6564bc commit 5bafbdc

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
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"/>

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>

src/org/sosy_lab/java_smt/solvers/mathsat5/Mathsat5SolverContext.java

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

@@ -236,7 +236,7 @@ public static Mathsat5SolverContext create(
236236
@VisibleForTesting
237237
static void loadLibrary(Consumer<String> pLoader) {
238238
loadLibrariesWithFallback(
239-
pLoader, ImmutableList.of("mathsat5j"), ImmutableList.of("mpir", "mathsat", "mathsat5j"));
239+
pLoader, ImmutableList.of("mathsat5j"), ImmutableList.of("gmp", "mathsat", "mathsat5j"));
240240
}
241241

242242
long createEnvironment(long cfg) {

0 commit comments

Comments
 (0)