Browse Source

Replace monolitic Dockerfiles by modular ones for SymbiYosys & GHDl(-synth)

T. Meissner 2 months ago
parent
commit
c77f6ca3b3
3 changed files with 150 additions and 112 deletions
  1. 0
    112
      SymbiYosys/Dockerfile
  2. 66
    0
      ghdl-formal.Dockerfile
  3. 84
    0
      symbiyosys.Dockerfile

+ 0
- 112
SymbiYosys/Dockerfile View File

@@ -1,112 +0,0 @@
1
-FROM ubuntu:18.04
2
-
3
-RUN apt-get update && \
4
-    apt-get upgrade -y && \
5
-    apt-get install -y \
6
-    build-essential \
7
-    clang \
8
-    bison \
9
-    flex \
10
-    libreadline-dev \
11
-    gawk \
12
-    tcl-dev \
13
-    libffi-dev \
14
-    git \
15
-    mercurial \
16
-    graphviz \
17
-    xdot \
18
-    pkg-config \
19
-    python \
20
-    python3 \
21
-    libftdi-dev \
22
-    gperf \
23
-    libboost-program-options-dev \
24
-    autoconf \
25
-    libgmp-dev \
26
-    cmake \
27
-    make \
28
-    wget \
29
-    libpython2.7 && \
30
-    adduser symbiyosys --gecos "" --disabled-login
31
-
32
-RUN cd /home/symbiyosys && \
33
-    git clone https://github.com/cliffordwolf/yosys.git yosys && \
34
-    cd yosys && \
35
-    make -j$(nproc) && \
36
-    make install && \
37
-    cd /home/symbiyosys && \
38
-    git clone https://github.com/cliffordwolf/SymbiYosys.git SymbiYosys && \
39
-    cd SymbiYosys && \
40
-    make install && \
41
-    cd /home/symbiyosys && \
42
-    git clone https://github.com/Z3Prover/z3.git z3 && \
43
-    cd z3 && \
44
-    python scripts/mk_make.py && \
45
-    cd build && \
46
-    make -j$(nproc) && \
47
-    make install && \
48
-    cd /home/symbiyosys && \
49
-    git clone https://github.com/SRI-CSL/yices2.git yices2 && \
50
-    cd yices2 && \
51
-    autoconf && \
52
-    ./configure && \
53
-    make -j$(nproc) && \
54
-    make install && \
55
-    cd /home/symbiyosys && \
56
-    git clone https://bitbucket.org/arieg/extavy.git && \
57
-    cd extavy && \
58
-    git submodule update --init && \
59
-    mkdir build; cd build && \
60
-    cmake -DCMAKE_BUILD_TYPE=Release .. && \
61
-    make -j$(nproc) && \
62
-    cp avy/src/avy /usr/local/bin/ && \
63
-    cp avy/src/avybmc /usr/local/bin/ && \
64
-    cd /home/symbiyosys && \
65
-    git clone https://github.com/boolector/boolector && \
66
-    git clone https://github.com/arminbiere/lingeling boolector/deps/lingeling && \
67
-    git clone https://github.com/boolector/btor2tools boolector/deps/btor2tools && \
68
-    ( cd boolector/deps/lingeling  && ./configure.sh -fPIC && make -j$(nproc); ) && \
69
-    ( cd boolector/deps/btor2tools && ./configure.sh -fPIC && make -j$(nproc); ) && \
70
-    ( cd boolector && ./configure.sh && cd build && make -j$(nproc); ) && \
71
-    cp boolector/build/bin/boolector /usr/local/bin/ && \
72
-    cp boolector/build/bin/btor* /usr/local/bin/ && \
73
-    cp boolector/deps/btor2tools/bin/btorsim /usr/local/bin/ && \
74
-    cd /home/symbiyosys && \
75
-    wget https://downloads.bvsrc.org/super_prove/super_prove-hwmcc17_final-2-d7b71160dddb-Ubuntu_14.04-Release.tar.gz && \
76
-    tar xzf super_prove-hwmcc17_final-2-d7b71160dddb-Ubuntu_14.04-Release.tar.gz -C /usr/local/ && \
77
-    echo '#!/bin/bash' >> /usr/local/bin/suprove && \
78
-    echo 'tool=super_prove; if [ "$1" != "${1#+}" ]; then tool="${1#+}"; shift; fi' >> /usr/local/bin/suprove && \
79
-    echo 'exec /usr/local/super_prove/bin/${tool}.sh "$@"' >> /usr/local/bin/suprove && \
80
-    chmod +x /usr/local/bin/suprove && \
81
-    rm -rf yosys SymbiYosys z3 yices2 extavy boolector super_prove*
82
-
83
-RUN apt-get purge -y \
84
-    build-essential \
85
-    clang \
86
-    bison \
87
-    flex \
88
-    libreadline-dev \
89
-    gawk \
90
-    libffi-dev \
91
-    git \
92
-    mercurial \
93
-    graphviz \
94
-    xdot \
95
-    pkg-config \
96
-    libftdi-dev \
97
-    gperf \
98
-    libboost-program-options-dev \
99
-    autoconf \
100
-    libgmp-dev \
101
-    cmake \
102
-    wget && \
103
-    apt-get clean -y && \
104
-    apt-get autoclean -y && \
105
-    apt-get autoremove -y
106
-
107
-
108
-USER symbiyosys
109
-WORKDIR /home/symbiyosys
110
-
111
-RUN mkdir work
112
-VOLUME /home/symbiyosys/work

+ 66
- 0
ghdl-formal.Dockerfile View File

@@ -0,0 +1,66 @@
1
+## GHDL ##
2
+
3
+FROM symbiyosys as symbiyosys-ghdl
4
+
5
+ARG LLVM_VER="7"
6
+ARG GNAT_VER="8"
7
+
8
+RUN apt-get update -qq && \
9
+    DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
10
+    gnat \
11
+    zlib1g-dev \
12
+    llvm-dev && \
13
+    apt-get autoclean && apt-get clean && apt-get -y autoremove && \
14
+    rm -rf /var/lib/apt/lists/*
15
+
16
+# Build GHDL
17
+RUN cd /root && \
18
+    mkdir ghdl && \
19
+    cd ghdl && \
20
+    curl https://codeload.github.com/ghdl/ghdl/tar.gz/master | tar xzf - --strip-components=1 && \
21
+    ./configure --enable-synth --prefix=/opt/ghdl --with-llvm-config=llvm-config-$LLVM_VER && \
22
+    make && \
23
+    make install
24
+
25
+
26
+## GHDLSYNTH-BETA ##
27
+
28
+FROM symbiyosys-ghdl AS symbiyosys-ghdlsynth
29
+
30
+# Build ghdlsynth-beta
31
+RUN cd /root && \
32
+    mkdir ghdlsynth-beta && \
33
+    cd ghdlsynth-beta && \
34
+    curl https://codeload.github.com/tmeissner/ghdlsynth-beta/tar.gz/tests | tar xzf - --strip-components=1 && \
35
+    make GHDL=/opt/ghdl/bin/ghdl YOSYS_CONFIG=/opt/yosys/bin/yosys-config && \
36
+    make install GHDL=/opt/ghdl/bin/ghdl YOSYS_CONFIG=/opt/yosys/bin/yosys-config
37
+
38
+
39
+# GHDL-formal
40
+
41
+FROM debian:buster-slim AS ghdl-formal
42
+
43
+# Get runtime dependencies
44
+RUN apt-get update -qq && \
45
+    DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
46
+    ca-certificates \
47
+    libreadline7 \
48
+    libtcl8.6 \
49
+    libgnat-8 \
50
+    make \
51
+    python3 && \
52
+    apt-get autoclean && apt-get clean && apt-get -y autoremove && \
53
+    update-ca-certificates && \
54
+    rm -rf /var/lib/apt/lists/*
55
+
56
+# copy build artifacts
57
+COPY --from=symbiyosys-ghdlsynth /opt/ghdl /opt/ghdl
58
+COPY --from=symbiyosys-ghdlsynth /opt/symbiyosys /opt/symbiyosys
59
+COPY --from=symbiyosys-ghdlsynth /opt/yosys /opt/yosys
60
+COPY --from=symbiyosys-ghdlsynth /opt/z3 /opt/z3
61
+COPY --from=symbiyosys-ghdlsynth /opt/yices2 /opt/yices2
62
+COPY --from=symbiyosys-ghdlsynth /opt/cvc4 /opt/cvc4
63
+COPY --from=symbiyosys-ghdlsynth /opt/boolector /opt/boolector
64
+
65
+# Enhance path variable
66
+ENV PATH "/opt/ghdl/bin:/opt/symbiyosys/bin:/opt/yosys/bin:/opt/z3/bin:/opt/yices2/bin:/opt/cvc4/bin:/opt/boolector/bin:$PATH"

+ 84
- 0
symbiyosys.Dockerfile View File

@@ -0,0 +1,84 @@
1
+FROM debian:buster-slim as yosys
2
+
3
+## YOSYS ##
4
+
5
+# Get yosys dependencies
6
+RUN apt-get update -qq && \
7
+    DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
8
+    ca-certificates \
9
+    gcc \
10
+    make \
11
+    bison \
12
+    flex \
13
+    libreadline-dev \
14
+    gawk \
15
+    tcl-dev \
16
+    libffi-dev \
17
+    graphviz \
18
+    xdot \
19
+    pkg-config \
20
+    python3 \
21
+    libboost-system-dev \
22
+    libboost-python-dev \
23
+    libboost-filesystem-dev \
24
+    clang \
25
+    git && \
26
+    apt-get autoclean && apt-get clean && apt-get -y autoremove && \
27
+    update-ca-certificates && \
28
+    rm -rf /var/lib/apt/lists/* && \
29
+    cd /root && \
30
+    git clone https://github.com/YosysHQ/yosys.git yosys && \
31
+    cd yosys && \
32
+    git clone https://github.com/berkeley-abc/abc.git abc && \
33
+    make -j$(nproc) PREFIX=/opt/yosys && \
34
+    make install PREFIX=/opt/yosys
35
+
36
+
37
+# SymbiYosys, Solvers
38
+
39
+FROM yosys AS symbiyosys
40
+
41
+RUN apt-get update -qq && \
42
+    DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
43
+    autoconf \
44
+    gperf  \
45
+    cmake \
46
+    curl \
47
+    libgmp-dev && \
48
+    apt-get autoclean && apt-get clean && apt-get -y autoremove && \
49
+    rm -rf /var/lib/apt/lists/* && \
50
+    cd /root && \
51
+    git clone https://github.com/YosysHQ/SymbiYosys.git symbiyosys && \
52
+    cd symbiyosys && \
53
+    make install PREFIX=/opt/symbiyosys && \
54
+    cd .. && \
55
+    git clone https://github.com/Z3Prover/z3.git z3 && \
56
+    cd z3 && \
57
+    python scripts/mk_make.py && \
58
+    cd build && \
59
+    make -j$(nproc) PREFIX=/opt/z3 && \
60
+    make install PREFIX=/opt/z3 && \
61
+    cd /root && \
62
+    git clone https://github.com/SRI-CSL/yices2.git yices2 && \
63
+    cd yices2 && \
64
+    autoconf && \
65
+    ./configure --prefix=/opt/yices2 && \
66
+    make -j$(nproc) && \
67
+    make install && \
68
+    cd /opt && \
69
+    mkdir cvc4 && mkdir cvc4/bin && \
70
+    curl -L -o cvc4/bin/cvc4 https://github.com/CVC4/CVC4/releases/download/1.7/cvc4-1.7-x86_64-linux-opt && \
71
+    chmod +x cvc4/bin/cvc4 && \
72
+    cd /root && \
73
+    git clone https://github.com/boolector/boolector && \
74
+    cd boolector && \
75
+    ./contrib/setup-btor2tools.sh && \
76
+    ./contrib/setup-lingeling.sh && \
77
+    ./configure.sh && \
78
+    make -C build -j$(nproc) PREFIX=/opt/boolector && \
79
+    cd /root/boolector && \
80
+    mkdir /opt/boolector && \
81
+    mkdir /opt/boolector/bin && \
82
+    cp build/bin/boolector /opt/boolector/bin/ && \
83
+    cp build/bin/btor* /opt/boolector/bin/ && \
84
+    cp deps/btor2tools/bin/btorsim /opt/boolector/bin/