diff --git a/Dockerfile b/Dockerfile index c96245464dfca518c01af6139e009672ba47f037..8486771e13f2fcd73f18741bb522b4f95bc7545e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,13 +93,19 @@ ENV OMPI_CXX=clang++ FROM base-${MPI_FLAVOR} AS final ARG MUST_VERSION=1.9.2 + +COPY patches /patches + # Build and install MUST RUN mkdir -p /opt/must/ WORKDIR /build RUN wget https://hpc.rwth-aachen.de/must/files/MUST-v${MUST_VERSION}.tar.gz && \ tar -xf MUST-v${MUST_VERSION}.tar.gz && mkdir -p MUST-v${MUST_VERSION}/build -RUN cd MUST-v${MUST_VERSION}/build && \ +RUN cd MUST-v${MUST_VERSION} && \ + patch utility/mustrun2.sh < /patches/mustrun-env.patch && \ + patch externals/typeart/scripts/typeart-wrapper.in < /patches/typeart-fpic.patch && \ + cd build && \ CC=clang CXX=clang++ MPICH_CC=clang MPICH_CXX=clang++ OMPI_CC=clang OMPI_CXX=clang \ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/must -DUSE_BACKWARD=ON -DENABLE_TESTS=ON -DENABLE_FORTRAN=ON -DLLVM_FILECHECK_PATH=$(which FileCheck) -DCMAKE_BUILD_TYPE=Release && \ make install -j8 install-prebuilds diff --git a/patches/mustrun-env.patch b/patches/mustrun-env.patch new file mode 100644 index 0000000000000000000000000000000000000000..bc81016f87383a40e1b7349188594cca433d035d --- /dev/null +++ b/patches/mustrun-env.patch @@ -0,0 +1,14 @@ +@@ -2477,7 +2477,11 @@ if [ -n "${must_exports}" ] && cmaketrue "@MUSTRUN_INJECT_ENV@" + then + # $mpiexec_command should e.g look like this after this looping + # construct: mpiexec /usr/bin/env "PATH=/usr/bin" "FANCY_ENVVAR=value of fancy envvar" ... +- EXEC_EXPORTS="$(which env)" ++ if ! MYENV=$(which env) ++ then ++ MYENV=env ++ fi ++ EXEC_EXPORTS="${MYENV}" + for exp in ${must_exports} + do + EXEC_EXPORTS="${EXEC_EXPORTS} \"${exp}=${!exp}\"" + diff --git a/patches/typeart-fpic.patch b/patches/typeart-fpic.patch new file mode 100644 index 0000000000000000000000000000000000000000..ec0c8645975ad321f46fd43ce20c00796ab20161 --- /dev/null +++ b/patches/typeart-fpic.patch @@ -0,0 +1,16 @@ +--- externals/typeart/scripts/typeart-wrapper.in 2024-04-02 18:55:06.715830352 +0200 ++++ externals/typeart/scripts/typeart-wrapper.in.fix 2024-04-02 18:54:27.849233560 +0200 +@@ -265,11 +265,11 @@ + + # shellcheck disable=SC2086 + $compiler ${ta_more_args} ${typeart_includes} ${typeart_san_flags} \ +- -O1 -Xclang -disable-llvm-passes -S -emit-llvm "${source_file}" -o - | ++ -O1 -fPIC -Xclang -disable-llvm-passes -S -emit-llvm "${source_file}" -o - | + $opt_tool ${typeart_plugin} ${typeart_heap_mode_args} | + $opt_tool ${optimize} -S | + $opt_tool ${typeart_plugin} ${typeart_stack_mode_args} | +- $llc_tool -x=ir ${llc_flags} -o "${out_file}" ++ $llc_tool -x=ir --relocation-model=pic ${llc_flags} -o "${out_file}" + } + + function main_in() {