Skip to content

Commit

Permalink
fix(build): compile for generic x86_64 (v3) microarchitecture
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Jun 20, 2024
1 parent 579b271 commit 574efcf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN apt update \

RUN mkdir -p /opt/spack && curl -sL https://github.com/spack/spack/archive/v0.21.0.tar.gz | tar -xz --strip-components 1 -C /opt/spack

RUN sed -i 's/ granularity: microarchitectures/ granularity: generic/g' /opt/spack/etc/spack/defaults/concretizer.yaml
RUN sed -i '/ all:/a\ target: [x86_64_v3]' /opt/spack/etc/spack/defaults/packages.yaml
RUN echo "source /opt/spack/share/spack/setup-env.sh" > /etc/profile.d/z09_source_spack_setup.sh

SHELL ["/bin/bash", "-l", "-c"]
Expand Down Expand Up @@ -48,13 +50,13 @@ COPY <<"EOF" /tmp/patch_spack_default_modules.yaml
EOF

RUN sed -i '/ prefix_inspections:/r /tmp/patch_spack_default_modules.yaml' /opt/spack/etc/spack/defaults/modules.yaml
RUN sed -i 's/ autoload: direct/\ autoload: none/g' /opt/spack/etc/spack/defaults/modules.yaml
RUN sed -i 's/ autoload: direct/ autoload: none/g' /opt/spack/etc/spack/defaults/modules.yaml

RUN spack module tcl refresh -y
RUN cp -r /opt/spack/share/spack/modules/$(spack arch) /opt/modules
RUN cp -r /opt/spack/share/spack/modules/linux-ubuntu22.04-x86_64_v3 /opt/modules
RUN echo "module use --append /opt/modules" >> /etc/profile.d/z10_load_spack_modules.sh
RUN spack module tcl loads geant4 xerces-c clhep boost cmake nlohmann-json >> /etc/profile.d/z10_load_spack_modules.sh
RUN rm -fr /opt/spack/share/spack/modules/$(spack arch)
RUN rm -fr /opt/spack/share/spack/modules/$linux-ubuntu22.04-x86_64_v3

ENV ESI_DIR=/esi
ENV HOME=$ESI_DIR
Expand Down

0 comments on commit 574efcf

Please sign in to comment.