From 5bb2f8c68a2377309ea70102a92e8a593c32ff0b Mon Sep 17 00:00:00 2001 From: Alexander Pace <alexander.pace@ligo.org> Date: Mon, 27 Aug 2018 09:21:45 -0500 Subject: [PATCH] Inflating commit count: update Dockerfile with latest MKL and build parameters. Triggering a change to test CI/CD. --- Dockerfile.stretch | 146 +++++++++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 64 deletions(-) diff --git a/Dockerfile.stretch b/Dockerfile.stretch index c1f014f95f..1e7c52f2be 100644 --- a/Dockerfile.stretch +++ b/Dockerfile.stretch @@ -1,40 +1,65 @@ # Start with the lalsuite nightly container: -FROM containers.ligo.org/lscsoft/lalsuite:nightly +FROM containers.ligo.org/lscsoft/lalsuite/nightly:stretch # Labeling/packaging stuff: LABEL name="GstLAL Development Package, Debian" \ maintainer="Alexander Pace <alexander.pace@ligo.org>" \ - date="20180521" \ + date="20180625" \ support="Reference Platform, Stretch" # Set up the base user and build environment: -# Note that I've had to install the following packages to get things to +# Note that I've had to install the following packages to get things to # work. Some duplication with the command line, but the list is clearer: # * build-essential (gcc, etc.) # * wget +# * vim +# * git # * flex (from gobject-introspection) # * bison (from gobject-introspection) # * libffi-dev (from gobject-introspection) USER root -RUN apt-get update && apt-get install --assume-yes build-essential wget flex bison libffi-dev -# Set some environment variables. Hopefully these propagate to the -# gitlab-ci environment. Possibly re-define and then just copy the stuff over. +# Define MKL version variables: +ENV VERSION 2018 +ENV UPDATE 3 +ENV BUILD 051 -ENV GSTLAL_DIR /opt/gstlal +RUN apt-get update && apt-get install -y build-essential wget vim git flex bison libffi-dev git-lfs + +RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \ + apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \ + sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' && \ + apt-get update && \ + apt-get install -y intel-mkl-64bit-$VERSION.$UPDATE-$BUILD + +# Install system dependencies: +RUN apt-get --assume-yes install gtk-doc-tools libfftw3-3 libfftw3-dev liborc-0.4-0 python-gobject-dev python-numpy python-scipy lscsoft-gds python-ligo-segments python3-ligo-segments + +# Set some environment variables. Hopefully these propagate to the +# gitlab-ci environment. Possibly re-define and then just copy the stuff over. + +ENV GSTLAL_DIR /usr ENV PATH ${GSTLAL_DIR}/bin:${PATH} ENV PKG_CONFIG_PATH ${GSTLAL_DIR}/lib/pkgconfig:${GSTLAL_DIR}/lib64/pkgconfig:${PKG_CONFIG_PATH} ENV GI_TYPELIB_PATH ${GSTLAL_DIR}/lib/girepository-1.0:${GI_TYPELIB_PATH} ENV GST_PLUGIN_PATH ${GSTLAL_DIR}/lib/gstreamer-1.0:${GST_PLUGIN_PATH} ENV PYTHONPATH ${GSTLAL_DIR}/lib64/python2.7/site-packages:${GSTLAL_DIR}/lib/python2.7/site-packages:${PYTHONPATH} +ENV MKLROOT=/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl +ENV LIBRARY_PATH=/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64_lin/gcc4.7:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin +ENV CPATH=/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/include +ENV PATH=PATH=/opt/intel/compilers_and_libraries_2018.3.222/linux/bin/intel64:${PATH} +ENV PKG_CONFIG_PATH /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/bin/pkgconfig:${PKG_CONFIG_PATH} +ENV LD_LIBRARY_PATH /opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64_lin/gcc4.7:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin + # Set build variables: ENV CC gcc ENV CXX g++ -ENV CFLAGS "-O3 -fPIC -march=native -I${GSTLAL_DIR}/include" +ENV CFLAGS "-O3 -fPIC -DMKL_ILP64 -m64 -I${MKLROOT}/include -I${GSTLAL_DIR}/include" +ENV LDFLAGS "-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl" -# These are the packages to download. Use the same nominclature as the optimixed Makefile. +# These are the packages to download. Use the same nomenclature as the optimized Makefile. ENV GSTPYTHON gst-python-1.4.0 ENV GSTPLUGINSGOOD gst-plugins-good-1.4.5 @@ -54,23 +79,29 @@ RUN wget --no-check-certificate http://gstreamer.freedesktop.org/src/gstreamer/$ RUN wget --no-check-certificate http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.28/${PYGOBJECT}.tar.xz --directory-prefix=/tars -nc RUN wget --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/1.50/${GINTRO}.tar.xz --directory-prefix=/tars -nc +# Get glue git repo: +RUN cd /src && \ + git clone https://git.ligo.org/lscsoft/glue.git +# cd glue && \ +# python setup.py install --prefix=${GSTLAL_DIR} + # Install gobject-introspection: RUN tar -xf /tars/${GINTRO}.tar.xz -C /src && \ - cd /src/${GINTRO} && \ + cd /src/${GINTRO} && \ ./configure --prefix=${GSTLAL_DIR} --disable-static --with-python=/usr/bin/python && \ make && \ make install # Install pygobject: RUN tar -xf /tars/${PYGOBJECT}.tar.xz -C /src && \ - cd /src/${PYGOBJECT} && \ + cd /src/${PYGOBJECT} && \ ./configure --prefix=${GSTLAL_DIR} --with-python=python2 --enable-cairo=no && \ make && \ make install # Install gstreamer: RUN tar -xf /tars/${GSTREAMER}.tar.xz -C /src && \ - cd /src/${GSTREAMER} && \ + cd /src/${GSTREAMER} && \ ./configure --prefix=${GSTLAL_DIR} && \ make && \ make install @@ -89,63 +120,50 @@ RUN tar -xf /tars/${GSTPLUGINSGOOD}.tar.xz -C /src && \ make && \ make install -# Install some stuff needed for documentation. I'm putting it as part of this +# Install gst-python: +RUN tar -xf /tars/${GSTPYTHON}.tar.xz -C /src && \ + cd /src/${GSTPYTHON} && \ + #mkdir -p ${GSTLAL_DIR}/lib64/python2.7/site-packages/gi/overrides && \ + ./configure --prefix=${GSTLAL_DIR} --exec-prefix=${GSTLAL_DIR} --with-libpython-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --with-pygi-overrides-dir=${GSTLAL_DIR}/lib/python2.7/dist-packages/gi/overrides && \ + make && \ + make install + +# Install glue: +RUN cd /src/glue && \ + #python setup.py install + python setup.py install --prefix=${GSTLAL_DIR} + +# Install some stuff needed for documentation. I'm putting it as part of this # container because it takes for-freaking-ever to install in CI: -RUN apt-get --assume-yes install doxygen graphviz python-sphinx \ - texlive-base \ - texlive-binaries \ - texlive-extra-utils \ - texlive-font-utils \ - texlive-fonts-extra \ - texlive-fonts-extra-doc \ - texlive-fonts-recommended \ - texlive-fonts-recommended-doc \ - texlive-generic-extra \ - texlive-generic-recommended \ - texlive-latex-base \ - texlive-latex-base-doc \ - texlive-latex-extra \ - texlive-latex-extra-doc \ - texlive-latex-recommended \ - texlive-latex-recommended-doc \ - texlive-pictures \ - texlive-pictures-doc \ - texlive-pstricks \ - texlive-pstricks-doc \ - texlive-science \ - texlive-science-doc +RUN apt-get --assume-yes install doxygen graphviz python-matplotlib python3-matplotlib + +# Dumb hack to get ligolw_segments from the python-pylal package. I can't just install +# python-pylal because it's been depreciated and because there are conflicts with files +# that are coming from lalapps. + +RUN mkdir pylaltmp && \ + apt-get install --download-only -o=dir::cache=./pylaltmp python-pylal && \ + ls ./pylaltmp/* && \ + dpkg-deb -x pylaltmp/archives/python-pylal*.deb pylaltmp && \ + sed -i 's/pylal/glue/g' pylaltmp/usr/bin/ligolw_segments && \ + cp pylaltmp/usr/bin/ligolw_segments /usr/bin && \ + rm -r pylaltmp -# Install system dependencies: -RUN apt-get --assume-yes install gtk-doc-tools libfftw3-dev liborc-0.4-0 python-gobject-dev python-numpy python-scipy lscsoft-gds + +# Set up a random uid for the avahi user before starting the daemon. + +#RUN randuid=$(od -An -N1 -i /dev/random) && \ +# adduser --uid $randuid avahi +RUN apt-get --assume-yes install python-avahi avahi-daemon # Clean up and close-out RUN rm -rf /tars /src -ENTRYPOINT [""] - - - -# Notes to run: -# -# 1. On your local machine (assuming you have docker installed), then first build the -# gstlal-dev container: -# -# docker build --rm --no-cache -t containers.ligo.org/alexander.pace/gstlal-dev:stretch -f ./Dockerfile.stretch ./ -# -# , where the flags mean: -# --rm --no-cache : build fresh, delete old build stages and cached copy. I'm paranoid. -# -t : location/tag of destination container -# -f : name of Dockerfile to use (it defaults to "Dockerfile") -# -# 2. Once it builds, docker will give you a hash of the built container: -# -# docker tag 7039c16eadc4 aepace/gstlal-dev:stretch -# -# , this tags the container with hash "7039c16eadc4" and then tags it to the -# gstlal-dev:stretch container in aepace's namespace. -# -# 3. Finally, push the container you just tagged: -# -# docker push aepace/gstlal-dev +# Build gstreamer registry cache: + +RUN gst-inspect-1.0 +#ENV GST_REGISTRY_UPDATE=no + +ENTRYPOINT service dbus start && service avahi-daemon start && bash \ No newline at end of file -- GitLab