Skip to content

Commit 99a8591

Browse files
committed
250904.164031.CST [skip ci] revise parallel_test_matlab.yml
1 parent 1b2b961 commit 99a8591

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/parallel_test_matlab.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ 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

4344

4445
steps:
@@ -121,6 +122,58 @@ jobs:
121122
cache: true
122123
products: Optimization_Toolbox Parallel_Computing_Toolbox
123124

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+
124177
- name: Conduct the test
125178
uses: matlab-actions/[email protected]
126179
with:

.github/workflows/recursive_test_matlab.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636

37-
# The matrix is essentially the same as that of stress_test_matlab.yml, except for test
37+
# The matrix is the same as that of stress_test_matlab.yml, except for test
3838
matrix:
3939
os: [ubuntu-latest, macos-13, windows-latest]
4040
matlab: [R2023a, latest]

0 commit comments

Comments
 (0)