summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Wittenburg <scott.wittenburg@kitware.com>2018-12-17 17:33:46 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2019-02-21 15:37:35 -0600
commit05cdb5a0bb385c049cc3b54e664be6e5b2a35816 (patch)
tree5f944f368f3e7b7e04682bd476f0214a6583db5e
parentfce1c4133f104c1a09b09909f12bed81a83bb46a (diff)
downloadspack-05cdb5a0bb385c049cc3b54e664be6e5b2a35816.tar.gz
spack-05cdb5a0bb385c049cc3b54e664be6e5b2a35816.tar.bz2
spack-05cdb5a0bb385c049cc3b54e664be6e5b2a35816.tar.xz
spack-05cdb5a0bb385c049cc3b54e664be6e5b2a35816.zip
docker: Add Dockerfiles for images needed by AWS gitlab-runners
The built images are set up with fairly recent versions of gcc and clang: - centos_7: [ gcc@5.5.0 (built from src), clang@6.0.0 (spack-built from src) ] - ubuntu_18.04: [ gcc@5.5.0 (system), clang@6.0.0-1ubuntu2 (system) ]
-rw-r--r--share/spack/docker/spack_builder/Dockerfile-spack_builder_centos_761
-rw-r--r--share/spack/docker/spack_builder/Dockerfile-spack_builder_ubuntu_18.0423
-rw-r--r--share/spack/docker/spack_builder/update_rpaths.py34
3 files changed, 118 insertions, 0 deletions
diff --git a/share/spack/docker/spack_builder/Dockerfile-spack_builder_centos_7 b/share/spack/docker/spack_builder/Dockerfile-spack_builder_centos_7
new file mode 100644
index 0000000000..a10e9369be
--- /dev/null
+++ b/share/spack/docker/spack_builder/Dockerfile-spack_builder_centos_7
@@ -0,0 +1,61 @@
+
+#
+# To build this image:
+#
+# cd <path-to-spack-repo>/share/spack/docker/spack_builder
+# docker build -f Dockerfile-spack_builder_centos_7 -t spack_builder_centos_7 .
+#
+
+from spack/centos:7
+
+RUN yum update -y && \
+ yum install -y \
+ gmp-devel \
+ libmpc-devel \
+ mpfr-devel \
+ vim \
+ which && \
+ rm -rf /var/cache/yum && yum clean all
+
+# Download, build and install gcc 5.5.0
+RUN mkdir -p /home/spackuser/Download/gcc550/build-gcc550 && \
+ mkdir -p /opt/gcc/gcc-5.5.0 && \
+ cd /home/spackuser/Download/gcc550 && \
+ curl -OL https://ftp.gnu.org/gnu/gcc/gcc-5.5.0/gcc-5.5.0.tar.xz && \
+ tar -xvf gcc-5.5.0.tar.xz && \
+ cd build-gcc550 && \
+ ../gcc-5.5.0/configure \
+ --enable-languages=c,c++,fortran \
+ --disable-multilib \
+ --prefix=/opt/gcc/gcc-5.5.0 && \
+ make -j$(nproc) && \
+ make install && \
+ cd /home/spackuser && \
+ rm -rf /home/spackuser/Download
+
+RUN export PATH=/spack/bin:$PATH && \
+ spack compiler find /opt/gcc/gcc-5.5.0
+
+RUN sed -i 's/f77: null/f77: \/opt\/gcc\/gcc-5.5.0\/bin\/gfortran/g;s/fc: null/fc: \/opt\/gcc\/gcc-5.5.0\/bin\/gfortran/g' ~/.spack/linux/compilers.yaml
+
+RUN mkdir -p /home/spackuser/spackcommand
+
+COPY update_rpaths.py /home/spackuser/spackcommand/update_rpaths.py
+
+RUN spack python /home/spackuser/spackcommand/update_rpaths.py \
+ --prefix /opt/gcc/gcc-5.5.0 \
+ --rpaths /opt/gcc/gcc-5.5.0/lib64
+
+RUN export PATH=/spack/bin:$PATH && \
+ spack install -y llvm@6.0.0%gcc@5.5.0 && \
+ spack clean -a
+
+RUN export PATH=/spack/bin:$PATH && \
+ spack compiler find $(spack location -i llvm@6.0.0%gcc@5.5.0)
+
+RUN sed -i 's/f77: null/f77: \/opt\/gcc\/gcc-5.5.0\/bin\/gfortran/g;s/fc: null/fc: \/opt\/gcc\/gcc-5.5.0\/bin\/gfortran/g' ~/.spack/linux/compilers.yaml
+
+RUN spack python /home/spackuser/spackcommand/update_rpaths.py \
+ --prefix /spack/opt/spack/linux-centos7-x86_64/gcc-5.5.0/llvm-6.0.0-awfpo7kn3k24weu655rrt2erihzd4gii \
+ --rpaths /spack/opt/spack/linux-centos7-x86_64/gcc-5.5.0/llvm-6.0.0-awfpo7kn3k24weu655rrt2erihzd4gii/lib
+
diff --git a/share/spack/docker/spack_builder/Dockerfile-spack_builder_ubuntu_18.04 b/share/spack/docker/spack_builder/Dockerfile-spack_builder_ubuntu_18.04
new file mode 100644
index 0000000000..417a11f932
--- /dev/null
+++ b/share/spack/docker/spack_builder/Dockerfile-spack_builder_ubuntu_18.04
@@ -0,0 +1,23 @@
+
+#
+# To build this image:
+#
+# cd <path-to-spack-repo>/share/spack/docker/spack_builder
+# docker build -f Dockerfile-spack_builder_ubuntu_18.04 -t spack_builder_ubuntu_18.04 .
+#
+
+from spack/ubuntu:bionic
+
+RUN apt-get -yqq update && apt-get -yqq install \
+ clang \
+ g++-5 \
+ gcc-5 \
+ gfortran-5 \
+ unzip \
+ vim && \
+ rm -rf /var/lib/apt/lists/*
+
+RUN export PATH=/spack/bin:$PATH && \
+ spack compiler find gcc clang
+
+RUN sed -i 's/f77: null/f77: \/usr\/bin\/gfortran/g;s/fc: null/fc: \/usr\/bin\/gfortran/g' ~/.spack/linux/compilers.yaml
diff --git a/share/spack/docker/spack_builder/update_rpaths.py b/share/spack/docker/spack_builder/update_rpaths.py
new file mode 100644
index 0000000000..110e2f9fa6
--- /dev/null
+++ b/share/spack/docker/spack_builder/update_rpaths.py
@@ -0,0 +1,34 @@
+# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import argparse
+from spack.config import config as spack_config
+
+
+def update_compiler(prefix, rpaths):
+ compilers_config = spack_config.get('compilers')
+
+ for compiler_entry in compilers_config:
+ if compiler_entry['compiler']['paths']['cc'].startswith(prefix):
+ print('found target compiler: {0}'.format(
+ compiler_entry['compiler']['spec']))
+ compiler_entry['compiler']['extra_rpaths'].append(rpaths)
+
+ spack_config.update_config('compilers', compilers_config)
+
+
+if __name__ == "__main__":
+ # Create argument parser
+ parser = argparse.ArgumentParser(
+ description="Add extra_rpaths to default system compilers.yaml")
+
+ parser.add_argument('-p', '--prefix', default=None,
+ help="Install prefix of compiler to update")
+ parser.add_argument('-r', '--rpaths', default=None,
+ help="Extra rpaths to add to target compiler")
+
+ args = parser.parse_args()
+
+ update_compiler(args.prefix, args.rpaths)