Newer
Older

Jan David Mol
committed
#
# base
#
FROM lofar-base:${LOFAR_TAG}

Jan David Mol
committed

Jorrit Schaap
committed
RUN apt-get update && apt-get install -y git python python3 g++ make
#
# *******************
# Blitz
# *******************
#
#RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN apt-get update && apt-get install -y git python && \
mkdir /src && cd /src && git clone --branch=1.0.1 https://github.com/blitzpp/blitz.git && \
cd /src/blitz && ./configure && make install && \

Jorrit Schaap
committed
rm -rf /src/blitz
#
# *******************
# DAL
# *******************
#
ENV DAL_VERSION=v3.3.1
# Run-time dependencies
RUN aptitude install -y libhdf5-${LIBHDF5_VERSION} python3 && \
aptitude clean && \
aptitude autoclean
RUN export BUILD_PACKAGES="git cmake g++ swig3.0 python3-setuptools python3-dev libhdf5-dev" && \
aptitude install -y ${BUILD_PACKAGES} && \
mkdir -p ${INSTALLDIR}/DAL/build && \
git clone --branch ${DAL_VERSION//latest/master} https://git.astron.nl/ro/dal2.git ${INSTALLDIR}/DAL/DAL.src && \
cd ${INSTALLDIR}/DAL/build && \
cmake -DPYTHON_INCLUDE_DIR=/usr/include/python${PYTHON_VERSION} -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}m.so -DBUILD_TESTING=OFF -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -fpermissive" -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/DAL ${INSTALLDIR}/DAL/DAL.src && \
make -j ${J} && \
make install && \
bash -c "rm -rf ${INSTALLDIR}/DAL/{DAL.src,build}" && \
aptitude purge -y ${BUILD_PACKAGES} && \
aptitude clean && \
aptitude autoclean

Jan David Mol
committed
#
# *******************
# LOFAR
# *******************
#
# Run-time dependencies
RUN apt-get update && apt-get install -y binutils liblog4cplus-1.1-9 libxml2 libboost-thread${BOOST_VERSION}.1 libboost-filesystem${BOOST_VERSION}.1 libboost-date-time${BOOST_VERSION}.1 libpng16-16 libsigc++-2.0-dev libxml++2.6-2v5 libboost-regex${BOOST_VERSION}.1

Jan David Mol
committed

Jan David Mol
committed
# Tell image build information
ENV LOFAR_BRANCH=${LOFAR_VERSION} \
LOFAR_BUILDVARIANT=gnucxx11_opt

Jan David Mol
committed

Jan David Mol
committed
# Install
RUN apt-get update && apt-get install -y git cmake g++ gfortran bison flex autogen liblog4cplus-dev libhdf5-dev libboost-dev boost-python${BOOST_VERSION}-dev libxml2-dev pkg-config libpng-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev libboost-regex${BOOST_VERSION}-dev binutils-dev libopenblas-dev libcfitsio-dev wcslib-dev libcap2-bin && \
mkdir -p ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && \
cd ${INSTALLDIR}/lofar && git clone https://git.astron.nl/ro/lofar.git ${INSTALLDIR}/lofar/src && \
cd ${INSTALLDIR}/lofar/src && git checkout ${LOFAR_VERSION} && \
cd ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && cmake -DBUILD_PACKAGES=Online_OutputProc -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/lofar/ -DCASACORE_ROOT_DIR=${INSTALLDIR}/casacore/ -DQPID_ROOT_DIR=/opt/qpid/ -DDAL_ROOT_DIR=${INSTALLDIR}/DAL -DUSE_OPENMP=True ${INSTALLDIR}/lofar/src/ && \

Jan David Mol
committed
cd ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && sed -i '29,31d' include/ApplCommon/PosixTime.h && \
cd ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && make -j ${J} && \
cd ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && make install && \

Jan David Mol
committed
bash -c "mkdir -p /home/${USER}/lofar/var/{log,run}" && \

Jan David Mol
committed
bash -c "ln -sfT /home/${USER}/lofar/var ${INSTALLDIR}/lofar/var" && \

Jan David Mol
committed
bash -c "strip ${INSTALLDIR}/lofar/{bin,sbin,lib64}/* || true" && \
bash -c "rm -rf ${INSTALLDIR}/lofar/{build,src}" && \
setcap cap_sys_nice,cap_sys_admin=ep ${INSTALLDIR}/lofar/bin/outputProc && \
Alexander van Amesfoort
committed
setcap cap_sys_nice,cap_sys_admin=ep ${INSTALLDIR}/lofar/bin/TBB_Writer && \
apt-get purge -y subversion cmake g++ gfortran bison flex autogen liblog4cplus-dev libhdf5-dev libboost-dev libboost-python${BOOST_VERSION}-dev libxml2-dev pkg-config libpng12-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev binutils-dev libcfitsio3-dev wcslib-dev libopenblas-dev && \

Jan David Mol
committed
apt-get autoremove -y --purge