Skip to content

Commit 1b2b961

Browse files
committed
250904.163558.CST [skip ci] revise stress/recursive_test_matlab.yml
1 parent 214c0fc commit 1b2b961

File tree

2 files changed

+106
-23
lines changed

2 files changed

+106
-23
lines changed

.github/workflows/recursive_test_matlab.yml

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,8 @@ jobs:
3939
os: [ubuntu-latest, macos-13, windows-latest]
4040
matlab: [R2023a, latest]
4141
solver: [uobyqa, newuoa, bobyqa, lincoa, cobyla]
42+
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
4243

43-
########################################################################################
44-
# PRIMA is not recursion-safe on Ubuntu with MATLAB R2025a due to a bug of MATLAB.
45-
# Review and update this part when new releases of MATLAB becomes the latest.
46-
exclude:
47-
- os: ubuntu-latest
48-
matlab: latest
49-
include:
50-
- os: ubuntu-latest
51-
matlab: R2024b
52-
solver: uobyqa
53-
- os: ubuntu-latest
54-
matlab: R2024b
55-
solver: newuoa
56-
- os: ubuntu-latest
57-
matlab: R2024b
58-
solver: bobyqa
59-
- os: ubuntu-latest
60-
matlab: R2024b
61-
solver: lincoa
62-
- os: ubuntu-latest
63-
matlab: R2024b
64-
solver: cobyla
65-
########################################################################################
6644

6745
steps:
6846

@@ -144,6 +122,58 @@ jobs:
144122
cache: true
145123
products: Optimization_Toolbox Parallel_Computing_Toolbox
146124

125+
- name: Link system libgcc to MATLAB if needed
126+
if: startsWith(matrix.os, 'ubuntu')
127+
shell: bash
128+
run: |
129+
matlab_root=$(realpath $(dirname $(which matlab))/../)
130+
echo "MATLAB root is ${matlab_root}"
131+
132+
matlab_libgcc="${matlab_root}/sys/os/glnxa64/libgcc_s.so.1"
133+
echo "MATLAB libgcc is:"
134+
ls -alh ${matlab_libgcc} || exit 42
135+
echo "gcc strings in MATLAB libgcc are:"
136+
strings ${matlab_libgcc} | grep -iE "^GCC_"
137+
echo "latest gcc version string in MATLAB libgcc is:"
138+
readelf -V ${matlab_libgcc} | grep -oiE 'GCC_([0-9]+)(.[0-9]+){0,2}' | sort -V | tail -1
139+
140+
system_libgcc="/usr/lib/x86_64-linux-gnu/libgcc_s.so.1"
141+
echo "System libgcc is:"
142+
ls -alh ${system_libgcc} || exit 42
143+
echo "gcc strings in system libgcc are:"
144+
strings ${system_libgcc} | grep -iE "^GCC_"
145+
echo "latest gcc version string in system libgcc is:"
146+
readelf -V ${system_libgcc} | grep -oiE 'GCC_([0-9]+)(.[0-9]+){0,2}' | sort -V | tail -1
147+
148+
if [[ "${{ matrix.use_system_libgcc }}" == "true" ]] ; then
149+
ln -sf ${system_libgcc} ${matlab_libgcc} || exit 42
150+
echo "Linked ${system_libgcc} to ${matlab_libgcc}."
151+
else
152+
echo "Keep ${matlab_libgcc} untouched."
153+
fi
154+
echo "After the operation, MATLAB libgcc is:"
155+
ls -alh ${matlab_libgcc} || exit 42
156+
echo "gcc strings in MATLAB libgcc are:"
157+
strings ${matlab_libgcc} | grep -iE "^GCC_"
158+
echo "latest gcc version string in MATLAB libgcc is:"
159+
readelf -V ${matlab_libgcc} | grep -oiE 'GCC_([0-9]+)(.[0-9]+){0,2}' | sort -V | tail -1
160+
161+
- name: Revise getMexLibgcc and compiled.m to print necessary information
162+
run: |
163+
cd matlab/setup_tools || exit 42
164+
$SEDI 's|\(.*lddOut.*\);|\1|' getMexLibgcc.m
165+
$SEDI 's|\(.*Path.*\);|\1|' getMexLibgcc.m
166+
$SEDI 's|\(.*String.*\);|\1|' getMexLibgcc.m
167+
$SEDI 's|\(.*Version.*\);|\1|' getMexLibgcc.m
168+
cat getMexLibgcc.m
169+
$SEDI 's|\(common_mex_options\s*=\s*.*$\)$|\1\ncommon_mex_options{:}|' compile.m
170+
$SEDI 's|\(.*\s*=\s*getMexLibgcc().gccVersion.*\)|\1\ngetMexLibgcc() |' compile.m
171+
$SEDI 's|\(.*_version\s*=\s*.*\);|\1 |' compile.m
172+
$SEDI 's|\(compiler_options\s*=\s*.*\);|\1 |' compile.m
173+
$SEDI "s|\(if\s*~support_internal_procedures\)|verLessThan('matlab', '25.1'), verLessThan('matlab', '25.2'), compiler_manufacturer, compiler_options, support_internal_procedures\n\1|" compile.m
174+
cat compile.m
175+
176+
147177
- name: Conduct the test
148178
uses: matlab-actions/run-command@v2.2.2
149179
with:

.github/workflows/stress_test_matlab.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
matlab: [R2023a, latest]
3737
solver: [uobyqa, newuoa, bobyqa, lincoa, cobyla]
3838
test: [normal, tough]
39+
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
3940

4041
steps:
4142

@@ -124,6 +125,58 @@ jobs:
124125
$SEDI "s|#define PRIMA_INTEGER_KIND 0|#define PRIMA_INTEGER_KIND ${IKIND}|g" fortran/common/ppf.h
125126
cat fortran/common/ppf.h
126127
128+
- name: Link system libgcc to MATLAB if needed
129+
if: startsWith(matrix.os, 'ubuntu')
130+
shell: bash
131+
run: |
132+
matlab_root=$(realpath $(dirname $(which matlab))/../)
133+
echo "MATLAB root is ${matlab_root}"
134+
135+
matlab_libgcc="${matlab_root}/sys/os/glnxa64/libgcc_s.so.1"
136+
echo "MATLAB libgcc is:"
137+
ls -alh ${matlab_libgcc} || exit 42
138+
echo "gcc strings in MATLAB libgcc are:"
139+
strings ${matlab_libgcc} | grep -iE "^GCC_"
140+
echo "latest gcc version string in MATLAB libgcc is:"
141+
readelf -V ${matlab_libgcc} | grep -oiE 'GCC_([0-9]+)(.[0-9]+){0,2}' | sort -V | tail -1
142+
143+
system_libgcc="/usr/lib/x86_64-linux-gnu/libgcc_s.so.1"
144+
echo "System libgcc is:"
145+
ls -alh ${system_libgcc} || exit 42
146+
echo "gcc strings in system libgcc are:"
147+
strings ${system_libgcc} | grep -iE "^GCC_"
148+
echo "latest gcc version string in system libgcc is:"
149+
readelf -V ${system_libgcc} | grep -oiE 'GCC_([0-9]+)(.[0-9]+){0,2}' | sort -V | tail -1
150+
151+
if [[ "${{ matrix.use_system_libgcc }}" == "true" ]] ; then
152+
ln -sf ${system_libgcc} ${matlab_libgcc} || exit 42
153+
echo "Linked ${system_libgcc} to ${matlab_libgcc}."
154+
else
155+
echo "Keep ${matlab_libgcc} untouched."
156+
fi
157+
echo "After the operation, MATLAB libgcc is:"
158+
ls -alh ${matlab_libgcc} || exit 42
159+
echo "gcc strings in MATLAB libgcc are:"
160+
strings ${matlab_libgcc} | grep -iE "^GCC_"
161+
echo "latest gcc version string in MATLAB libgcc is:"
162+
readelf -V ${matlab_libgcc} | grep -oiE 'GCC_([0-9]+)(.[0-9]+){0,2}' | sort -V | tail -1
163+
164+
- name: Revise getMexLibgcc and compiled.m to print necessary information
165+
run: |
166+
cd matlab/setup_tools || exit 42
167+
$SEDI 's|\(.*lddOut.*\);|\1|' getMexLibgcc.m
168+
$SEDI 's|\(.*Path.*\);|\1|' getMexLibgcc.m
169+
$SEDI 's|\(.*String.*\);|\1|' getMexLibgcc.m
170+
$SEDI 's|\(.*Version.*\);|\1|' getMexLibgcc.m
171+
cat getMexLibgcc.m
172+
$SEDI 's|\(common_mex_options\s*=\s*.*$\)$|\1\ncommon_mex_options{:}|' compile.m
173+
$SEDI 's|\(.*\s*=\s*getMexLibgcc().gccVersion.*\)|\1\ngetMexLibgcc() |' compile.m
174+
$SEDI 's|\(.*_version\s*=\s*.*\);|\1 |' compile.m
175+
$SEDI 's|\(compiler_options\s*=\s*.*\);|\1 |' compile.m
176+
$SEDI "s|\(if\s*~support_internal_procedures\)|verLessThan('matlab', '25.1'), verLessThan('matlab', '25.2'), compiler_manufacturer, compiler_options, support_internal_procedures\n\1|" compile.m
177+
cat compile.m
178+
179+
127180
- name: Conduct the test
128181
uses: matlab-actions/run-command@v2.2.2
129182
with:

0 commit comments

Comments
 (0)