Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No integration tests for dftb+ #94

Open
ExpHP opened this issue May 14, 2019 · 1 comment
Open

No integration tests for dftb+ #94

ExpHP opened this issue May 14, 2019 · 1 comment

Comments

@ExpHP
Copy link
Owner

ExpHP commented May 14, 2019

This one will be a nuisance; a new travis script will be necessary to build dftb+ from source.

@colin-daniels
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants