Skip to content

Commit

Permalink
Singularity definition file for virtual fugaku
Browse files Browse the repository at this point in the history
  • Loading branch information
hikaru-inoue-cyber committed Aug 26, 2024
1 parent df8f4c8 commit c78e252
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
42 changes: 42 additions & 0 deletions spack_all.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Bootstrap: docker
From: redhat/ubi8

%setup
mkdir ${SINGULARITY_ROOTFS}/opt/amazon

%files
# /opt/amazon

%post

dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf -y install git gcc* make xz patch bzip2* autoconf* automake libtool* libevent*
dnf -y install binutils ctags curl findutils gdb glibc-devel gnupg2 hostname iproute perl-Fedora-VSP perl-generators perl-Sys-Syslog pkgconf* python39 python3-boto3 python3-pip python3-setuptools redhat-lsb-core redhat-rpm-config source-highlight strace unzip
dnf repolist
dnf list installed

cd /opt
git clone https://github.com/RIKEN-RCCS/spack.git
cd spack
git checkout virtual_fugaku

. ./share/spack/setup-env.sh

spack install hwloc
HWLOC=$(find /opt/spack/opt/spack/linux-rhel8-neoverse_v1 -name 'libhwloc.so.15.*' | tail -n 1)
ln -s ${HWLOC} /usr/lib64
ln -s ${HWLOC} /usr/lib64/libhwloc.so
ln -s ${HWLOC} /usr/lib64/libhwloc.so.15

spack install gcc+binutils
spack load gcc
spack compiler find
spack env create virtual_fugaku etc/spack/spack.yaml
spack env activate -p virtual_fugaku
spack add gcc
spack concretize
spack install

spack env deactivate

spack env activate --sh virtual_fugaku >> $SINGULARITY_ENVIRONMENT
30 changes: 30 additions & 0 deletions spack_all_small.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Bootstrap: localimage
From: spack_all.sif
Stage: build

%post
. /opt/spack/share/spack/setup-env.sh
spack env activate virtual_fugaku
spack gc -y
spack clean --all

Bootstrap: docker
From: redhat/ubi8
Stage: final

%setup
mkdir ${SINGULARITY_ROOTFS}/opt/amazon

%files from build
/opt/spack
/usr/lib64/libhwloc.so.15.6.4

%post
dnf -y install libevent*
dnf clean all

cd /usr/lib64
ln -s libhwloc.so.15.6.4 libhwloc.so

. /opt/spack/share/spack/setup-env.sh
spack env activate --sh virtual_fugaku >> $SINGULARITY_ENVIRONMENT

0 comments on commit c78e252

Please sign in to comment.