View Single Post
Old 2017-02-09, 00:59   #13
nordi
 
Dec 2016

7×11 Posts
Default

I have a pretty well-automated version now: To build PFGW with Docker, get and extract the sources of PFGW. In the directory with the sources, create a Dockerfile with this content:
Code:
FROM gcc
RUN apt-get update && apt-get install -y libgmp-dev wget unzip

RUN mkdir /usr/src/mprime && \
    cd /usr/src/mprime && \ 
    # openpfgw insists on version 28.6
    wget -O mprime.zip --quiet https://www.mersenne.org/ftp_root/gimps/p95v286.source.zip && \
    # unzip produces some warnings and therefore has exit code 1.
    unzip mprime.zip ; \
    rm mprime.zip
RUN cd /usr/src/mprime/gwnum && \
    make -j -f make64

COPY . /usr/src/openpfgw
WORKDIR /usr/src/openpfgw
RUN cp /usr/lib/x86_64-linux-gnu/libgmp.a packages/gmp/64bit/
RUN cp /usr/src/mprime/gwnum/gwnum.a packages/gwnum/64bit/gwnum.a
RUN sed -i 's/-Wl,-no_pie//g' makefile

RUN make -j
Run "docker build -t pfgw ." (mind the dot at the end) to build a new image. Then "docker run -it pfgw" to start a container with that image. The executable is at /usr/src/openpfgw/pfgw64 and it actually works.

This assumes "#include <ctype.h>" fix to PFGW is already applied.
nordi is offline   Reply With Quote