|
| 1 | +FROM ubuntu:20.04 |
| 2 | + |
| 3 | +LABEL org.opencontainers.image.source https://github.com/su2code/Docker-Builds |
| 4 | + |
| 5 | +ENV LANG C.UTF-8 |
| 6 | +RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime |
| 7 | +RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \ |
| 8 | + apt-utils \ |
| 9 | + python3 \ |
| 10 | + pkg-config \ |
| 11 | + python3-pip \ |
| 12 | + git \ |
| 13 | + build-essential \ |
| 14 | + cmake \ |
| 15 | + python3-numpy \ |
| 16 | + python3-scipy \ |
| 17 | + python3-mpi4py \ |
| 18 | + swig \ |
| 19 | + libopenmpi-dev \ |
| 20 | + libopenblas-dev \ |
| 21 | + openmpi-bin \ |
| 22 | + ccache \ |
| 23 | + petsc-dev \ |
| 24 | + python3-petsc4py \ |
| 25 | + python3-rtree \ |
| 26 | + curl \ |
| 27 | + flex \ |
| 28 | + && rm -rf /var/lib/apt/lists/* \ |
| 29 | + && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 |
| 30 | + |
| 31 | +# Build a gcc suitable for thread sanitizer analysis |
| 32 | +RUN cd / \ |
| 33 | + && git clone git://gcc.gnu.org/git/gcc.git gcc_sources \ |
| 34 | + && cd gcc_sources \ |
| 35 | + && git checkout releases/gcc-9.4.0 \ |
| 36 | + && ./contrib/download_prerequisites \ |
| 37 | + && cd / \ |
| 38 | + && mkdir gcc_objdir \ |
| 39 | + && cd gcc_objdir \ |
| 40 | + && /gcc_sources/configure --prefix=/gcc_install --enable-languages=c,c++ --disable-linux-futex --disable-multilib \ |
| 41 | + && make \ |
| 42 | + && make install \ |
| 43 | + && cd / \ |
| 44 | + && rm -rf gcc_sources \ |
| 45 | + && rm -rf gcc_objdir \ |
| 46 | + && cd /gcc_install/bin \ |
| 47 | + && ln -s gcc cc |
| 48 | + |
| 49 | +# Ensure that ccache uses the built gcc |
| 50 | +RUN export PATH=/gcc_install/bin:$PATH \ |
| 51 | + && /usr/sbin/update-ccache-symlinks |
| 52 | + |
| 53 | +# Configure environment for the built gcc, also enable thread sanitizer |
| 54 | +ENV LD_LIBRARY_PATH=/gcc_install/lib64:$LD_LIBRARY_PATH |
| 55 | +ENV CXXFLAGS="-I/gcc_install/include/c++/9.4.0 -I/gcc_install/include/c++/9.4.0/x86_64-pc-linux-gnu -fsanitize=thread" |
| 56 | +ENV CFLAGS="-I/gcc_install/include/c++/9.4.0 -I/gcc_install/include/c++/9.4.0/x86_64-pc-linux-gnu -fsanitize=thread" |
| 57 | +ENV LDFLAGS="-L/gcc_install/lib64 -fsanitize=thread" |
| 58 | +ENV PATH=/usr/lib/ccache:/gcc_install/bin:$PATH |
| 59 | +ENV TSAN_OPTIONS="history_size=7 halt_on_error=1" |
| 60 | + |
| 61 | +# Copies your code file from your action repository to the filesystem path `/` of the container |
| 62 | +COPY compileSU2.sh /compileSU2.sh |
| 63 | + |
| 64 | +# Code file to execute when the docker container starts up (`entrypoint.sh`) |
| 65 | +ENTRYPOINT ["/compileSU2.sh"] |
0 commit comments