Open ExpHP opened 5 years ago
The following is a (relatively hacked-together) Dockerfile
that will build the dftbplus library if it helps.
FROM python:slim-stretch as build-dftbplus
ARG DFTBPLUS_VERSION=9b980bdaaa187db5f7602f583dd406899a8a8155
RUN set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
gcc \
gfortran \
git \
libopenblas-dev \
make \
perl \
wget \
&& mkdir -p /usr/src/dftbplus \
&& cd /usr/src/dftbplus \
&& wget -O dftbplus.tar.gz "https://github.com/dftbplus/dftbplus/archive/${DFTBPLUS_VERSION}.tar.gz" \
&& tar -x --strip-components=1 -f dftbplus.tar.gz \
&& LIB_LAPACK="-lopenblas" \
OTHERLIBS_C="-lgfortran -lm -lgomp" \
API_VERSION="$(cat api/mm/API_VERSION)" \
GIT_VERSION="$(printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')")" \
&& cp sys/make.x86_64-linux-gnu make.arch \
&& ./utils/get_opt_externals \
&& make BUILD_API=1 LIB_LAPACK="$LIB_LAPACK" OTHERLIBS_C="$OTHERLIBS_C" -j "$(nproc)" api \
&& make INSTALLDIR="/usr/local" install_api \
&& install -Dm644 LICENSE /usr/local/share/licenses/dftbplus/LICENSE \
&& install -Dm644 api/mm/dftbplus.h /usr/local/include/dftbplus.h \
&& install -D _build/external/xmlf90/libxmlf90.a /usr/local/lib/libxmlf90.a \
&& rm "/usr/local/include/"*.mod \
&& mkdir -p /usr/local/lib/pkgconfig \
&& printf "%s\n" \
"lib_lapack=$LIB_LAPACK" \
"lib_other_c=$OTHERLIBS_C" \
"api_version=$API_VERSION" \
"git_version=$GIT_VERSION" \
\
'prefix=/usr/local' \
'exec_prefix=${prefix}' \
'libdir=${exec_prefix}/lib' \
'includedir=${prefix}/include' \
\
'Name: DFTB+' \
'Description: C library for DFTB+, a fast and efficient versatile quantum mechanical simulation software package.' \
'Version: ${git_version}' \
'Requires.private:' \
'Libs: -L${libdir} -ldftb+ -lxmlf90' \
'Libs.private: ${lib_lapack} ${lib_other_c}' \
'Cflags: -I${includedir}' \
> /usr/local/lib/pkgconfig/libdftb+.pc \
&& ldconfig
This one will be a nuisance; a new travis script will be necessary to build dftb+ from source.