meelgroup / bosphorus

Bosphorus, ANF simplifier and solver, and ANF-to-CNF converter
Other
67 stars 18 forks source link

Docker build fails due to deprecation of Ubuntu 19.04 #15

Closed ErwinHaasnoot closed 4 years ago

ErwinHaasnoot commented 4 years ago

Hi!

I've been dabbling in SAT solving recently and came across this great tool. Unfortunately, my first attempt at building the docker image failed.

Sending build context to Docker daemon  994.8kB
Step 1/36 : FROM ubuntu:19.04 as builder
 ---> c88ac1f841b7
Step 2/36 : LABEL maintainer="Mate Soos"
 ---> Using cache
 ---> afd290d3adb6
Step 3/36 : LABEL version="1.0"
 ---> Using cache
 ---> f596b3719289
Step 4/36 : LABEL Description="Bosphorus"
 ---> Using cache
 ---> 71175ca36d25
Step 5/36 : ENV DEBIAN_FRONTEND=noninteractive
 ---> Running in 2d3195720178
Removing intermediate container 2d3195720178
 ---> b1f3cc1f335b
Step 6/36 : RUN apt-get update
 ---> Running in 3ab93a802801
Ign:1 http://archive.ubuntu.com/ubuntu disco InRelease
Ign:2 http://archive.ubuntu.com/ubuntu disco-updates InRelease
Ign:3 http://archive.ubuntu.com/ubuntu disco-backports InRelease
Err:4 http://archive.ubuntu.com/ubuntu disco Release
  404  Not Found [IP: 91.189.88.152 80]
Err:5 http://archive.ubuntu.com/ubuntu disco-updates Release
  404  Not Found [IP: 91.189.88.152 80]
Err:6 http://archive.ubuntu.com/ubuntu disco-backports Release
  404  Not Found [IP: 91.189.88.152 80]
Ign:7 http://security.ubuntu.com/ubuntu disco-security InRelease
Err:8 http://security.ubuntu.com/ubuntu disco-security Release
  404  Not Found [IP: 91.189.91.39 80]
Reading package lists...
E: The repository 'http://archive.ubuntu.com/ubuntu disco Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu disco-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu disco-backports Release' does not have a Release file.
E: The repository 'http://security.ubuntu.com/ubuntu disco-security Release' does not have a Release file.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100

This is due to ubuntu 19.04 no longer being supported by Canonical.

https://ubuntu.com/about/release-cycle

Fortunately, the build seems to work fine on Ubuntu 19.10. Ideally however the image would be upgraded to an LTS version of ubuntu (20.04), as 19.10 is slated for deprecation in 6 months with the release of Ubuntu 20.10.

Moving the image to Ubuntu 20.04 is proving difficult. First off, it fails early in the build process due to tzdata now requiring a dialog. This is remedied by adding the following line near the top of the Dockerfile

ENV DEBIAN_FRONTEND=noninteractive

However, Cryptominisat is failing to build after that:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(eh_globals.o): undefined reference to symbol '__tls_get_addr@@GLIBC_2.3'
/usr/bin/ld: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [cmsat5-src/CMakeFiles/cryptominisat5.dir/build.make:118: cryptominisat5] Error 1
make[1]: *** [CMakeFiles/Makefile2:155: cmsat5-src/CMakeFiles/cryptominisat5.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I tried upgrading cryptominisat to 5.6.8

# build CMS
WORKDIR /
RUN wget https://github.com/msoos/cryptominisat/archive/5.6.8.tar.gz \
    && tar -xvf 5.6.8.tar.gz
WORKDIR /cryptominisat-5.6.8
RUN mkdir build
WORKDIR /cryptominisat-5.6.8/build
RUN cmake -DSTATICCOMPILE=ON .. \
    && make -j2 \
    && make install \
    && rm -rf *

but this brings up a slightly different error.

/usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0'
collect2: error: ld returned 1 exit status
make[2]: *** [cmsat5-src/CMakeFiles/cryptominisat5-bin.dir/build.make:118: cryptominisat5] Error 1
make[1]: *** [CMakeFiles/Makefile2:155: cmsat5-src/CMakeFiles/cryptominisat5-bin.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I would love to help out here, but I am not very familiar with this type of buildchain and it seems like an easily correctable issue by someone who is more knowledgeable about the project.

If I can be of any more assistance here please let me know!

All the best

msoos commented 4 years ago

Oh, thank you, that was a very useful and I used your trick to fix it! Check out dd9654af6e380a77e9ff8dfe4ec72b6da90edb40 it should now build, even on Docker Hub :) Thanks again, I hope this closes it. Please re-open in case it doesn't.

Also, we are very much looking forward to fixes and upgrades, so in case you have anything to contribute, just create a pull request, we are happy to merge it in :) Thanks again,

Mate

ErwinHaasnoot commented 4 years ago

Wow, very quick response! I can confirm it works. Thanks a lot! We should be good now for the coming 10 years :)

I'm afraid I'm not yet at the level where I can make improvements to the bosphorus core, but I will keep a lookout for contributions I can make to the periphery of e.g. the docker build process.