Sign inSign up

edp8489/openradioss_arm

By edp8489

•Updated 10 months ago

OpenRadioss arm64 images, including base build environment

Image
0

589

edp8489/openradioss_arm repository overview

Dockerfile converted from Apptainer definitions https://github.com/OpenRadioss/OpenRadioss/tree/main/Apptainer/arm⁠

# Dockerfile for building OpenRadioss using the Arm compiler

# Use the previously built Arm environment as the base image.
# Replace 'arm_build_env:latest' with the actual tag you used.
FROM edp8489/openradioss_arm:buildenv

# Add metadata for the image
LABEL maintainer="Eric Peters <[email protected]>"
LABEL description="OpenRadioss compiled for linux/arm64 with Arm Compiler for Linux and OpenMPI."

# --- Environment Setup ---
# This section is updated based on the output of 'module show acfl'
# to ensure the build environment is identical to the one set by environment-modules.

# Define the precise directory for the Arm Compiler installation
ENV ACFL_DIR=/opt/arm/arm-linux-compiler-22.1_Generic-AArch64_RHEL-8_aarch64-linux

# Set the C, C++, and Fortran compilers to the Arm compilers
ENV CC=armclang
ENV CXX=armclang++
ENV FC=armflang
ENV Fortran_COMPILER=armflang

# Add the Arm compilers and libraries to the relevant environment variables,
# mirroring what the 'acfl' module does.
ENV PATH=${ACFL_DIR}/bin:${PATH}
ENV MANPATH=${ACFL_DIR}/share/man:${MANPATH}
ENV CPATH=${ACFL_DIR}/include:${CPATH}
ENV LIBRARY_PATH=${ACFL_DIR}/lib:${LIBRARY_PATH}
ENV LD_LIBRARY_PATH=${ACFL_DIR}/lib:${ACFL_DIR}/lib/clang/13.0.1/armpl_links/lib:${LD_LIBRARY_PATH}

# Set a build-time argument for the number of parallel jobs.
# This can be customized during the build with `docker build --build-arg NCPU=16 .`
ARG NCPU=8

# --- Build and Install Software ---
WORKDIR /opt

RUN mkdir /opt/openmpi

# Combine all build steps into a single RUN instruction to minimize image layers.
RUN \
    set -e && \
    echo "==== Building OpenMPI ====" && \
    wget -q https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz && \
    tar xzvf openmpi-4.1.4.tar.gz

RUN \
    cd openmpi-4.1.4 && \
    ./configure --prefix=/opt/openmpi && \
    # Apply patches as seen in the original script
    sed -i -e 's#wl=""#wl="-Wl,"#g' libtool && \
    sed -i -e 's#pic_flag=""#pic_flag=" -fPIC -DPIC"#g' libtool && \
    make -j${NCPU} && \
    make install && \
    # Add OpenMPI to the PATH for the subsequent build steps in this same RUN block
    export PATH=/opt/openmpi/bin:$PATH && \
    export LD_LIBRARY_PATH=/opt/openmpi/lib:$LD_LIBRARY_PATH

RUN \
    cd /opt && \
    \
    echo "==== Building OpenRadioss ====" && \
    git lfs install && \
    git clone --depth 1 --branch main https://github.com/OpenRadioss/OpenRadioss.git
RUN  \
    # Build OpenRadioss Starter
    cd /opt/OpenRadioss/starter && \
    ./build_script.sh -arch=linuxa64 -nt=${NCPU} -static-link -release
    \
RUN \
    # Build OpenRadioss Engine (serial, then MPI)
    cd /opt/OpenRadioss/engine && \
    # Note: Corrected typo from '-relsease' to '-release'
    ./build_script.sh -arch=linuxa64 -nt=${NCPU} -static-link -release && \
    ./build_script.sh -arch=linuxa64 -mpi=ompi -nt=${NCPU} -static-link -release
RUN \
    # Build OpenRadioss Tools
    cd /opt/OpenRadioss/tools/anim_to_vtk/linux64 && \
    ./build.bash && \
    cd /opt/OpenRadioss/tools/th_to_csv/linux64 && \
    ./build.bash
RUN  \
    # Apply library fix
    cd /opt/OpenRadioss/extlib/hm_reader/linuxa64 && \
    cp libapr-1.so libapr-1.so.0
RUN  \
    # --- Cleanup ---
    # Remove downloaded archives and extracted source directories to reduce image size.
    # The final OpenRadioss directory is kept as it is the application itself.
    echo "==== Cleaning up build artifacts ====" && \
    cd /opt && \
    rm -rf openmpi-4.1.4.tar.gz openmpi-4.1.4 && \
    # Remove the git history from the cloned repo to save space
    rm -rf /opt/OpenRadioss/.git

# --- Final Runtime Environment ---
# Set the environment variables required to run OpenRadioss.
# This corresponds to the %environment section of the Apptainer file.
ENV OPENRADIOSS_PATH=/opt/OpenRadioss
ENV RAD_CFG_PATH=${OPENRADIOSS_PATH}/hm_cfg_files
ENV OMP_STACKSIZE=400m
ENV PATH=${OPENRADIOSS_PATH}/exec:/opt/openmpi/bin:${PATH}
ENV LD_LIBRARY_PATH=${OPENRADIOSS_PATH}/extlib/hm_reader/linuxa64/:${OPENRADIOSS_PATH}/extlib/h3d/lib/linuxa64/:/opt/openmpi/lib:${LD_LIBRARY_PATH}

# Set the working directory to the OpenRadioss installation
WORKDIR /opt/OpenRadioss

# Set a default command to start a shell, allowing the user to run the application
CMD ["/bin/bash"]

Tag summary

Content type

Image

Digest

sha256:246449c06…

Size

2.8 GB

Last updated

10 months ago

docker pull edp8489/openradioss_arm