|
| 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 | + |
0 commit comments