-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
FROM ubuntu:16.04 as builder | ||
|
||
LABEL maintainer="Mate Soos" | ||
LABEL version="1.0" | ||
LABEL Description="Approxmc" | ||
|
||
# get curl, etc | ||
RUN apt-get update && apt-get install --no-install-recommends -y software-properties-common | ||
# RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
# RUN apt-get update | ||
RUN apt-get install --no-install-recommends -y libboost-program-options-dev gcc g++ make cmake zlib1g-dev wget make | ||
|
||
# get M4RI | ||
WORKDIR / | ||
RUN https://bitbucket.org/malb/m4ri/downloads/m4ri-20200125.tar.gz | ||
RUN tar -xvf m4ri-20200125.tar.gz | ||
WORKDIR m4ri-20200125 | ||
RUN ./configure | ||
RUN make \ | ||
&& make install | ||
|
||
# build CMS | ||
WORKDIR / | ||
RUN wget https://github.com/msoos/cryptominisat/archive/5.8.0.tar.gz | ||
RUN tar -xvf 5.8.0.tar.gz | ||
WORKDIR /cryptominisat-5.8.0 | ||
RUN mkdir build | ||
WORKDIR /cryptominisat-5.8.0/build | ||
RUN cmake -DSTATICCOMPILE=ON .. | ||
RUN make -j6 \ | ||
&& make install | ||
|
||
# build approxmc | ||
USER root | ||
COPY . /home/solver/approxmc | ||
WORKDIR /home/solver/approxmc | ||
RUN mkdir build | ||
WORKDIR /home/solver/approxmc/build | ||
RUN cmake -DSTATICCOMPILE=ON .. | ||
RUN make -j6 \ | ||
&& make install | ||
|
||
# set up for running | ||
FROM alpine:latest | ||
COPY --from=builder /usr/local/bin/approxmc /usr/local/bin/ | ||
ENTRYPOINT ["/usr/local/bin/approxmc"] | ||
|
||
# -------------------- | ||
# HOW TO USE | ||
# -------------------- | ||
# on file through STDIN: | ||
# zcat mizh-md5-47-3.cnf.gz | docker run --rm -i -a stdin -a stdout msoos/approxmc | ||
|
||
# on a file: | ||
# docker run --rm -v `pwd`/myfile.cnf.gz:/in msoos/approxmc in | ||
|
||
# echo through STDIN: | ||
# echo "1 2 0" | docker run --rm -i -a stdin -a stdout msoos/approxmc | ||
|
||
# hand-written CNF: | ||
# docker run --rm -ti -a stdin -a stdout msoos/approxmc | ||
|