From b5a8385f3154e173b81fc891ea8ce1a990dd7ef8 Mon Sep 17 00:00:00 2001 From: Karlheinz Friedberger Date: Thu, 30 May 2024 12:55:14 +0200 Subject: [PATCH] Bitwuzla: add ant-steps for building a Windows-DLL --- .../build-publish-solvers/solver-bitwuzla.xml | 168 ++++++++++++++---- doc/Developers-How-to-Release-into-Ivy.md | 9 +- docker/ubuntu2204.Dockerfile | 14 +- solvers_ivy_conf/ivy_bitwuzla.xml | 8 +- 4 files changed, 155 insertions(+), 44 deletions(-) diff --git a/build/build-publish-solvers/solver-bitwuzla.xml b/build/build-publish-solvers/solver-bitwuzla.xml index 5235475685..0ae203cb31 100644 --- a/build/build-publish-solvers/solver-bitwuzla.xml +++ b/build/build-publish-solvers/solver-bitwuzla.xml @@ -13,6 +13,9 @@ SPDX-License-Identifier: Apache-2.0 + + + - - Please specify the path to Bitwuzla with the flag -Dbitwuzla.path=/path/to/bitwuzla. - The path has to point to the root Bitwuzla folder, i.e., - a checkout of the official git repository from 'https://github.com/bitwuzla/bitwuzla'. - + + Please specify a custom revision with the flag -Dbitwuzla.customRev=XXX. The custom revision should be a version number of Bitwuzla. @@ -59,10 +59,20 @@ SPDX-License-Identifier: Apache-2.0 - + + + + + + + + + - + + @@ -77,17 +87,43 @@ SPDX-License-Identifier: Apache-2.0 - - + - + + + + + + + + + + + + + + + + + + + + + - + + + This ant-step uses the Linux dependencies for building the SWIG-wrapper. + The Windows dependencies are identical and would also work. + + @@ -96,7 +132,7 @@ SPDX-License-Identifier: Apache-2.0 - + @@ -118,16 +154,9 @@ SPDX-License-Identifier: Apache-2.0 - - - WARNING: Skipping the build step for the SWIG wrapper. - If the Bitwuzla API has changed since the last release, the wrapper should be updated. - Use option -Dbitwuzla.rebuildWrapper to run SWIG and automatically generate a new wrapper. - - - - - + + @@ -135,48 +164,121 @@ SPDX-License-Identifier: Apache-2.0 - + + - + + - - - - - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + diff --git a/doc/Developers-How-to-Release-into-Ivy.md b/doc/Developers-How-to-Release-into-Ivy.md index 11af9077fb..838de831fd 100644 --- a/doc/Developers-How-to-Release-into-Ivy.md +++ b/doc/Developers-How-to-Release-into-Ivy.md @@ -164,14 +164,19 @@ in which the following command can be run. To publish Bitwuzla, checkout the [Bitwuzla repository](https://github.com/bitwuzla/bitwuzla). Then execute the following command in the JavaSMT directory: ``` -ant publish-bitwuzla -Dbitwuzla.path=$BITWUZLA_DIR -Dbitwuzla.customRev=$VERSION -Dbitwuzla.rebuildWrapper=$BOOL +ant publish-bitwuzla \ + -Dbitwuzla.path=$BITWUZLA_DIR -Dbitwuzla.customRev=$VERSION \ + -Dbitwuzla.rebuildWrapper=$BOOL -Djdk-windows.path=$JNI_DIR ``` Example: ``` -ant publish-bitwuzla -Dbitwuzla.path=../bitwuzla/ -Dbitwuzla.customRev=0.4.0 -Dbitwuzla.rebuildWrapper=false +ant publish-bitwuzla \ + -Dbitwuzla.path=../bitwuzla/ -Dbitwuzla.customRev=0.4.0 \ + -Dbitwuzla.rebuildWrapper=false -Djdk-windows.path=/dependencies/jdk-11/ ``` The build-scripts Bitwuzla will download and build necessary dependencies like GMP automatically. Our build script will automatically append the git-revision of Bitwuzla, if available. +The build-steps will produce a Linux and a Windows library and publish them. Finally, follow the instructions shown in the message at the end. The instructions for publication via SVN into the Ivy repository are not intended to be executed in the Docker environment, diff --git a/docker/ubuntu2204.Dockerfile b/docker/ubuntu2204.Dockerfile index 70f189b0e5..cdcf647a04 100644 --- a/docker/ubuntu2204.Dockerfile +++ b/docker/ubuntu2204.Dockerfile @@ -20,7 +20,7 @@ ENV LANGUAGE en_US.UTF-8 # Install basic packages for building several solvers RUN apt-get update \ && apt-get install -y \ - wget curl git build-essential cmake patchelf \ + wget curl git build-essential cmake patchelf unzip \ openjdk-11-jdk ant maven \ gcc-mingw-w64-x86-64-posix g++-mingw-w64-x86-64-posix \ zlib1g-dev m4 \ @@ -63,8 +63,8 @@ RUN wget http://prdownloads.sourceforge.net/swig/swig-4.1.1.tar.gz \ && ./configure \ && make -j4 \ && make install \ - && cd -- \ - && rm -rf swig-4.1.1.tar.gz swig-4.1.1 + && rm -rf swig-4.1.1.tar.gz swig-4.1.1 \ + && cd -- RUN wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz \ && tar xf gmp-6.2.1.tar.lz \ @@ -72,8 +72,12 @@ RUN wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz \ && ./configure --enable-cxx --with-pic --disable-shared --enable-fat \ && make -j4 \ && make install \ - && cd -- \ - && rm -rf gmp-6.2.1.tar.lz gmp-6.2.1 + && rm -rf gmp-6.2.1.tar.lz gmp-6.2.1 \ + && cd -- + +RUN wget https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_windows-x64_bin.zip \ + && unzip openjdk-11+28_windows-x64_bin.zip \ + && rm openjdk-11+28_windows-x64_bin.zip # Add the user "developer" with UID:1000, GID:1000, home at /developer. # This allows to map the docker-internal user to the local user 1000:1000 outside of the container. diff --git a/solvers_ivy_conf/ivy_bitwuzla.xml b/solvers_ivy_conf/ivy_bitwuzla.xml index 259ffcc7f3..5f44ceed04 100644 --- a/solvers_ivy_conf/ivy_bitwuzla.xml +++ b/solvers_ivy_conf/ivy_bitwuzla.xml @@ -24,17 +24,17 @@ SPDX-License-Identifier: Apache-2.0 - - + + - - + +