File tree 4 files changed +47
-12
lines changed
4 files changed +47
-12
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ From: containers/basic/{{ BASE_CONTAINER }}.sif
50
50
mawk \
51
51
ninja-build \
52
52
pkg-config \
53
- python3 python3-dev python3-myst-parser \
53
+ python3 python3-dev python3-myst-parser python3-venv \
54
54
sed \
55
55
meson \
56
56
zlib1g-dev
@@ -63,9 +63,10 @@ From: containers/basic/{{ BASE_CONTAINER }}.sif
63
63
cd /opt/hpctoolkit
64
64
git checkout {{ FRAMEWORK_VERSION }}
65
65
# Create hpctoolkit-ci.ini configuration
66
+ mkdir -p /usr/share/meson/native
66
67
t=/usr/share/meson/native/hpctoolkit-ci.ini
67
68
rm -f "$t"
68
- echo "[built-in options]" >> "$t"
69
+ echo "[built-in options]" > "$t"
69
70
echo "wrap_mode = 'nofallback'" >> "$t"
70
71
echo "force_fallback_for = ['dyninst', 'libunwind', 'xed']" >> "$t"
71
72
echo "" >> "$t"
@@ -84,8 +85,9 @@ From: containers/basic/{{ BASE_CONTAINER }}.sif
84
85
meson setup build
85
86
meson compile -C build
86
87
meson install -C build
87
- echo "export JAVA_HOME=${JAVA_HOME} > /opt/hpctoolkit/bashrc"
88
- echo "export PATH=${PATH}:${JAVA_HOME}/bin:/opt/hpcviewer >> /opt/hpctoolkit/bashrc"
88
+ echo "export JAVA_HOME=${JAVA_HOME}" > /opt/hpctoolkit/bashrc
89
+ echo "export PATH=${PATH}:${JAVA_HOME}/bin:/opt/hpcviewer" >> /opt/hpctoolkit/bashrc
90
+ echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib64" >> /opt/hpctoolkit/bashrc
89
91
jq --arg app hpctoolkit --arg commit {{ FRAMEWORK_GIT_REF }} \
90
92
--arg branch {{ FRAMEWORK_GIT_REF }} \
91
93
'.[$app] |= if . == null then
Original file line number Diff line number Diff line change 178
178
--build-arg BASE_CONTAINER={{ item.base_container }} \
179
179
--build-arg OS_VERSION={{ containers.basic[item.base_container].os.version }} \
180
180
--build-arg MPI_VERSION={{ containers.basic[item.base_container].mpi.version }} \
181
- --build-arg FRAMEWORK_VERSION={{ containers.basic[item.base_container].framework.version }} \
182
- --build-arg FRAMEWORK_GIT_REF={{ containers.basic[item.base_container].framework.git_ref | default('default') }} \
183
181
{{ original_dir }}/containers/projects/{{ item.name }}.sif \
184
182
{{ original_dir }}/{{ item.definition }} \
185
183
> {{ item.name }}.log 2>&1
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ From: {{ CONTAINERS_DIR }}/basic/{{ BASE_CONTAINER }}.sif
23
23
24
24
%post
25
25
echo "Testing OpenMPI implementation"
26
- /bin/bash -c "cd /opt/OMPIFoam && mpicc -o ompiTest testOMPI.cpp"
27
- /bin/bash -c "source /opt/foam/foam-extend-{{ OPENFOAM_VERSION }}/etc/bashrc && cd /opt/OMPIFoam && wmake"
26
+ source $(jq -r '.openfoam.source_script' /apps.json)
27
+ cd /opt/OMPIFoam && mpicc -o ompiTest testOMPI.cpp
28
+ cd /opt/OMPIFoam && wmake
28
29
jq --arg app extend-test \
29
30
'.[$app] |= if . == null then
30
31
{
@@ -38,5 +39,26 @@ From: {{ CONTAINERS_DIR }}/basic/{{ BASE_CONTAINER }}.sif
38
39
} end' /apps.json > /tmp/apps.json
39
40
mv /tmp/apps.json /apps.json
40
41
42
+ %environment
43
+ #!/bin/bash
44
+ jq -r '.. | .source_script? // empty' /apps.json | while read -r script; do
45
+ if [[ -f "$script" ]]; then
46
+ source "$script"
47
+ fi
48
+ done
49
+ jq -r '.. | .python_env? // empty' /apps.json | while read -r script; do
50
+ if [[ -f "$script" ]]; then
51
+ source "$script/bin/activate"
52
+ fi
53
+ done
54
+
55
+ %runscript
56
+ #!/bin/bash
57
+ if [ $# -eq 0 ]; then
58
+ /bin/bash
59
+ else
60
+ /bin/bash -c "$@"
61
+ fi
62
+
41
63
%labels
42
64
Description Test applications for Foam-Extend
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ From: {{ CONTAINERS_DIR }}/basic/{{ BASE_CONTAINER }}.sif
26
26
27
27
%post -c /bin/bash
28
28
echo "Testing OpenMPI implementation"
29
- source /usr/lib/openfoam/openfoam{{ FRAMEWORK_VERSION }}/etc/bashrc
29
+ source $(jq -r '.openfoam.source_script' /apps.json)
30
30
export LD_LIBRARY_PATH=/opt/{{ MPI_IMPLEMENTATION }}/lib:$LD_LIBRARY_PATH
31
31
cd /opt/OMPIFoam && mpicc -o ompiTest testOMPI.cpp && wmake
32
32
jq --arg app test --arg branch {{ BRANCH }} \
@@ -44,12 +44,25 @@ From: {{ CONTAINERS_DIR }}/basic/{{ BASE_CONTAINER }}.sif
44
44
} end' /apps.json > /tmp/apps.json
45
45
mv /tmp/apps.json /apps.json
46
46
47
+ %environment
48
+ #!/bin/bash
49
+ jq -r '.. | .source_script? // empty' /apps.json | while read -r script; do
50
+ if [[ -f "$script" ]]; then
51
+ source "$script"
52
+ fi
53
+ done
54
+ jq -r '.. | .python_env? // empty' /apps.json | while read -r script; do
55
+ if [[ -f "$script" ]]; then
56
+ source "$script/bin/activate"
57
+ fi
58
+ done
59
+
47
60
%runscript
48
- /bin/bash -c 'cd /usr/lib/openfoam/openfoam{{ FRAMEWORK_VERSION }} && source etc/bashrc && mkdir -p $FOAM_USER_LIBBIN && mkdir -p $FOAM_USER_APPBIN'
61
+ #! /bin/bash
49
62
if [ $# -eq 0 ]; then
50
- /usr/ bin/openfoam{{ FRAMEWORK_VERSION }}
63
+ /bin/bash
51
64
else
52
- /usr/ bin/openfoam{{ FRAMEWORK_VERSION }} $@
65
+ /bin/bash -c "$@"
53
66
fi
54
67
55
68
%labels
You can’t perform that action at this time.
0 commit comments