|
4 | 4 |
|
5 | 5 | base_dir=$(dirname $(realpath $0))
|
6 | 6 |
|
7 |
| -if [ $# -ne 4 ]; then |
8 |
| - echo "ERROR: Usage: $0 <EESSI tmp dir (example: /tmp/$USER/EESSI)> <version (example: 2023.06)> <CPU arch subdir (example: x86_64/amd/zen2)> <path to tarball>" >&2 |
| 7 | +if [ $# -ne 5 ]; then |
| 8 | + echo "ERROR: Usage: $0 <EESSI tmp dir (example: /tmp/$USER/EESSI)> <version (example: 2023.06)> <CPU arch subdir (example: x86_64/amd/zen2)> <accelerator subdir (example: nvidia/cc80)> <path to tarball>" >&2 |
9 | 9 | exit 1
|
10 | 10 | fi
|
11 | 11 | eessi_tmpdir=$1
|
12 | 12 | eessi_version=$2
|
13 | 13 | cpu_arch_subdir=$3
|
14 |
| -target_tgz=$4 |
| 14 | +accel_subdir=$4 |
| 15 | +target_tgz=$5 |
15 | 16 |
|
16 | 17 | tmpdir=`mktemp -d`
|
17 | 18 | echo ">> tmpdir: $tmpdir"
|
@@ -58,30 +59,34 @@ if [ -d ${eessi_version}/init ]; then
|
58 | 59 | find ${eessi_version}/init -type f | grep -v '/\.wh\.' >> ${files_list}
|
59 | 60 | fi
|
60 | 61 |
|
61 |
| -if [ -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/modules ]; then |
62 |
| - # module files |
63 |
| - find ${eessi_version}/software/${os}/${cpu_arch_subdir}/modules -type f | grep -v '/\.wh\.' >> ${files_list} |
64 |
| - # module symlinks |
65 |
| - find ${eessi_version}/software/${os}/${cpu_arch_subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} |
66 |
| - # module files and symlinks |
67 |
| - find ${eessi_version}/software/${os}/${cpu_arch_subdir}/modules/all -type f -o -type l \ |
68 |
| - | grep -v '/\.wh\.' | grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \ |
69 |
| - >> ${module_files_list} |
70 |
| -fi |
71 |
| - |
72 |
| -if [ -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/software -a -r ${module_files_list} ]; then |
73 |
| - # installation directories but only those for which module files were created |
74 |
| - # Note, we assume that module names (as defined by 'PACKAGE_NAME/VERSION.lua' |
75 |
| - # using EasyBuild's standard module naming scheme) match the name of the |
76 |
| - # software installation directory (expected to be 'PACKAGE_NAME/VERSION/'). |
77 |
| - # If either side changes (module naming scheme or naming of software |
78 |
| - # installation directories), the procedure will likely not work. |
79 |
| - for package_version in $(cat ${module_files_list}); do |
80 |
| - echo "handling ${package_version}" |
81 |
| - ls -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/software/${package_version} \ |
82 |
| - | grep -v '/\.wh\.' >> ${files_list} |
83 |
| - done |
84 |
| -fi |
| 62 | +# consider both CPU-only and accelerator subdirectories |
| 63 | +for subdir in ${cpu_arch_subdir} ${cpu_arch_subdir}/accel/${accel_subdir}; do |
| 64 | + |
| 65 | + if [ -d ${eessi_version}/software/${os}/${subdir}/modules ]; then |
| 66 | + # module files |
| 67 | + find ${eessi_version}/software/${os}/${subdir}/modules -type f | grep -v '/\.wh\.' >> ${files_list} |
| 68 | + # module symlinks |
| 69 | + find ${eessi_version}/software/${os}/${subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} |
| 70 | + # module files and symlinks |
| 71 | + find ${eessi_version}/software/${os}/${subdir}/modules/all -type f -o -type l \ |
| 72 | + | grep -v '/\.wh\.' | grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \ |
| 73 | + >> ${module_files_list} |
| 74 | + fi |
| 75 | + |
| 76 | + if [ -d ${eessi_version}/software/${os}/${subdir}/software -a -r ${module_files_list} ]; then |
| 77 | + # installation directories but only those for which module files were created |
| 78 | + # Note, we assume that module names (as defined by 'PACKAGE_NAME/VERSION.lua' |
| 79 | + # using EasyBuild's standard module naming scheme) match the name of the |
| 80 | + # software installation directory (expected to be 'PACKAGE_NAME/VERSION/'). |
| 81 | + # If either side changes (module naming scheme or naming of software |
| 82 | + # installation directories), the procedure will likely not work. |
| 83 | + for package_version in $(cat ${module_files_list}); do |
| 84 | + echo "handling ${package_version}" |
| 85 | + ls -d ${eessi_version}/software/${os}/${subdir}/software/${package_version} \ |
| 86 | + | grep -v '/\.wh\.' >> ${files_list} |
| 87 | + done |
| 88 | + fi |
| 89 | +done |
85 | 90 |
|
86 | 91 | # add a bit debug output
|
87 | 92 | echo "wrote file list to ${files_list}"
|
|
0 commit comments