-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.dev
192 lines (155 loc) · 5.54 KB
/
Dockerfile.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# SPDX-License-Identifier: MIT
# Copyright (c) 2023. University of Texas at Austin. All rights reserved.
ARG GASNET_IMAGE=gasnet
ARG DRIVEX_IMAGE=drivex
ARG BUILD_IMAGE=ubuntu:22.04
# Build Gasnet
FROM ubuntu:22.04 AS gasnet
ARG COMPILER=g++-12
ARG GCC_VERSION=12.3.0
ARG QTHEADS_VERSION=1.16
ARG GASNET_VERSION=2023.3.0
ARG OMPI_VERSION=4.1.5
RUN apt update -y \
&& apt install -y \
git \
python3 \
python3-pip \
language-pack-en\
pkg-config\
${COMPILER}=${GCC_VERSION}* \
gfortran-12 \
&& apt clean \
&& update-locale
WORKDIR /dependencies
RUN git clone --depth 1 --branch v0.20.1 https://github.com/spack/spack.git
RUN . /dependencies/spack/share/spack/setup-env.sh \
&& spack compiler find \
&& spack install -j`nproc` qthreads@${QTHEADS_VERSION}%gcc@${GCC_VERSION} target=x86_64 \
openmpi@${OMPI_VERSION}%gcc@${GCC_VERSION} target=x86_64 \
&& spack load openmpi@${OMPI_VERSION}%gcc@${GCC_VERSION} \
&& spack install -j`nproc` gasnet@${GASNET_VERSION}%gcc@${GCC_VERSION} conduits=smp,mpi target=x86_64
ARG PYTHON_VERSION=3.10.10
RUN . /dependencies/spack/share/spack/setup-env.sh \
&& spack install -j`nproc` python@${PYTHON_VERSION}%gcc@${GCC_VERSION}
# Build Drive X
FROM ${GASNET_IMAGE} AS drivex
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y \
wget \
clang-11 \
clang++-11 \
libtool-bin \
&& apt-get clean
COPY scripts/build_drvx_deps.sh /tmp/build_drvx_deps.sh
COPY sst-core-src/ /dependencies/deps/sst-core-src/
COPY sst-elements-src/ /dependencies/deps/sst-elements-src/
WORKDIR /dependencies
ARG GCC_VERSION=12.3.0
ARG OMPI_VERSION=4.1.5
COPY scripts/load_drvx.sh /tmp/load_drvx.sh
RUN . /tmp/load_drvx.sh \
&& mkdir -p $DRV_ROOT \
&& python3 --version \
&& . /dependencies/spack/share/spack/setup-env.sh \
&& spack load openmpi@${OMPI_VERSION}%gcc@${GCC_VERSION} \
&& cd /dependencies && bash /tmp/build_drvx_deps.sh && ls -al /dependencies
COPY pando-drv /dependencies/pando-drv
RUN cd /dependencies && \
. /tmp/load_drvx.sh && \
. /dependencies/spack/share/spack/setup-env.sh && \
cd /dependencies && \
ls -al /dependencies/install && \
DRV_DIR=/dependencies/pando-drv make -j -C /dependencies/pando-drv install
RUN ln -s /dependencies/install /dependencies/pando-drv/install
RUN ln -s /pando/pando-drv/tests /dependencies/pando-drv/tests
FROM ${DRIVEX_IMAGE} AS drivex_wrapper
# Base ci image
FROM ${BUILD_IMAGE} AS dev
ARG COMPILER=g++-12
ARG GCC_VERSION=12.3.0
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y \
&& apt install -y \
git \
python3 \
python3-pip \
language-pack-en\
pkg-config\
${COMPILER}=${GCC_VERSION}* \
gfortran-12 \
shfmt \
&& apt clean \
&& update-locale
# CMake
RUN apt-get update -y \
&& apt install -y ca-certificates gpg wget \
&& wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null \
&& echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -y \
&& rm /usr/share/keyrings/kitware-archive-keyring.gpg \
&& apt-get install -y kitware-archive-keyring \
&& apt-get update -y \
&& apt-get install -y cmake cmake-curses-gui \
&& apt-get purge -y gpg wget \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=drivex_wrapper /dependencies /dependencies
ARG IS_CI=true
RUN if [ "${IS_CI}" != "true" ] ; then \
apt update -y \
&& apt install -y \
vim \
gdb \
universal-ctags \
powerline \
zsh \
valgrind \
doxygen \
texlive-latex-extra \
texlive-font-utils \
&& apt clean \
&& update-locale; fi
ARG SRC_DIR=/pando
ARG BUILD_DIR=/pando/dockerbuild
ARG UNAME
ARG UID
ARG GID
RUN if [ "${UNAME}" != "root" ] ; then groupadd -g ${GID} ${UNAME} \
&& useradd -ms /bin/bash -u "${UID}" -g "${GID}" ${UNAME}; fi
RUN mkdir -p /home/${UNAME} \
&& chown ${UNAME}:${UNAME} /home/${UNAME}
USER ${UNAME}
WORKDIR /home/${UNAME}
ENV BUILD_DIR=${BUILD_DIR}
RUN pip3 install compdb pre-commit cpplint "clang-format>=14.0.0,<17.0.0"
ARG GCC_VERSION=12.3.0
ARG QTHEADS_VERSION=1.16
ARG GASNET_VERSION=2023.3.0
ARG OMPI_VERSION=4.1.5
RUN echo "export SRC_DIR=${SRC_DIR}" >> /home/${UNAME}/.profile
RUN echo "export BUILD_DIR=${BUILD_DIR}" >> /home/${UNAME}/.profile
RUN echo ". /dependencies/spack/share/spack/setup-env.sh" >> /home/${UNAME}/spack_env \
&& echo "spack load gasnet@${GASNET_VERSION}%gcc@${GCC_VERSION} \
qthreads@${QTHEADS_VERSION}%gcc@${GCC_VERSION} \
openmpi@${OMPI_VERSION}%gcc@${GCC_VERSION}" >> /home/${UNAME}/spack_env && \
. /home/${UNAME}/spack_env && echo "PATH=${PATH}:\$PATH" >> /home/${UNAME}/.profile
RUN echo "PATH=/home/${UNAME}/.local/bin/:\$PATH" >> /home/${UNAME}/.zshenv
RUN echo "cd /dependencies/pando-drv && . ./load_drvx.sh && cd ~-" >> /home/${UNAME}/.profile
WORKDIR ${SRC_DIR}
ENV GCC_VERSION=${GCC_VERSION}
ENV QTHEADS_VERSION=${QTHEADS_VERSION}
ENV GASNET_VERSION=${GASNET_VERSION}
ENV OMPI_VERSION=${OMPI_VERSION}
ENV TERM=xterm-256color
ENV USER=${UNAME}
ENV LANG="C.UTF-8"
ENV LC_COLLATE="C.UTF-8"
ENV LC_CTYPE="C.UTF-8"
ENV LC_MESSAGES="C.UTF-8"
ENV LC_MONETARY="C.UTF-8"
ENV LC_NUMERIC="C.UTF-8"
ENV LC_TIME="C.UTF-8"
USER ${UNAME}