Skip to content

Commit

Permalink
add Dockerfile to build Fedora MinGW image
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-zero committed Dec 6, 2018
1 parent 60c80ff commit 6a47836
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/Linux-x86-64-mingw64-minimal.sopt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# This configuration was tested on a Centos 7 with the EPEL repository configured
# and the following packages installed:
# and a Fedora 29 Docker image with the following packages installed:
# mingw64-gcc-gfortran mingw64-gcc-c++ mingw64-winpthreads-static
# OpenBLAS was built with the following command:
# make BINARY=64 CC=x86_64-w64-mingw32-gcc FC=x86_64-w64-mingw32-gfortran HOSTCC=gcc TARGET=CORE2
# The result is a minimal standalone binary running on Windows when built with
# make OPENBLAS_LIBPATH=<path to OpenBLAS> ARCH=Linux-x86-64-mingw64-minimal VERSION=sopt
# If you do not have a Fedora or Centos yet but have Docker, you can use the following two commands
# to build CP2K via a Fedora Docker container:
# docker build -f tools/docker/Dockerfile.build_mingw64 -t cp2k/mingw64:latest tools/docker
# docker run --rm -v $(pwd):/cp2k --user $(id -u):$(id -g) cp2k/mingw64
CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++
CPP = x86_64-w64-mingw32-cpp
Expand Down
27 changes: 27 additions & 0 deletions tools/docker/Dockerfile.build_mingw64
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from fedora:latest

RUN dnf -y upgrade && \
dnf -y install \
@development-tools \
hostname \
python \
mingw64-gcc-gfortran \
mingw64-gcc-c++ \
mingw64-winpthreads-static \
&& dnf clean all

# build dependencies in /usr/src

WORKDIR /usr/src

RUN mkdir -p OpenBLAS \
&& curl -SL "https://sourceforge.net/projects/openblas/files/v0.3.4/OpenBLAS%200.3.4%20version.tar.gz/download" | \
tar -xz --strip-component=1 -C OpenBLAS \
&& make -C OpenBLAS BINARY=64 CC=x86_64-w64-mingw32-gcc FC=x86_64-w64-mingw32-gfortran HOSTCC=gcc TARGET=CORE2

# assume a CP2K source tree to be mounted at /cp2k
VOLUME ["/cp2k"]
WORKDIR /cp2k

# if not overridden, simply build CP2K
ENTRYPOINT ["make", "-j", "OPENBLAS_LIBPATH=/usr/src/OpenBLAS", "ARCH=Linux-x86-64-mingw64-minimal", "VERSION=sopt"]

0 comments on commit 6a47836

Please sign in to comment.