Skip to content

Commit 4961880

Browse files
committed
COMP: Fix manylinux scripts using portable "uname -m" command
The use of "uname -p" returns "unknown" when used within the 2_24 image.
1 parent 274f73e commit 4961880

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

scripts/internal/manylinux-build-common.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ else
2828
fi
2929

3030
# i686 or x86_64 ?
31-
case $(uname -p) in
31+
case $(uname -m) in
3232
i686)
3333
ARCH=x86
3434
;;
@@ -39,13 +39,13 @@ case $(uname -p) in
3939
ARCH=aarch64
4040
;;
4141
*)
42-
die "Unknown architecture $(uname -p)"
42+
die "Unknown architecture $(uname -m)"
4343
;;
4444
esac
4545

4646
# Install prerequirements
4747
export PATH=/work/tools/doxygen-1.8.11/bin:$PATH
48-
case $(uname -p) in
48+
case $(uname -m) in
4949
i686)
5050
ARCH=x86
5151
;;
@@ -69,7 +69,7 @@ case $(uname -p) in
6969
fi
7070
;;
7171
*)
72-
die "Unknown architecture $(uname -p)"
72+
die "Unknown architecture $(uname -m)"
7373
;;
7474
esac
7575
if ! type ninja > /dev/null 2>&1; then

scripts/internal/manylinux-build-module-wheels.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
9595
-DITK_USE_SYSTEM_SWIG:BOOL=ON \
9696
-DWRAP_ITK_INSTALL_COMPONENT_IDENTIFIER:STRING=PythonWheel \
9797
-DSWIG_EXECUTABLE:FILEPATH=${itk_build_dir}/Wrapping/Generators/SwigInterface/swig/bin/swig \
98-
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -p)-linux-gnu \
98+
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -m)-linux-gnu \
9999
-DBUILD_TESTING:BOOL=OFF \
100100
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
101101
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
@@ -108,7 +108,7 @@ if test "${ARCH}" == "x64"; then
108108
# Make sure auditwheel is installed for this python exe before importing
109109
# it in auditwheel_whitelist_monkeypatch.py
110110
sudo ${Python3_EXECUTABLE} -m pip install auditwheel
111-
for whl in dist/*linux_$(uname -p).whl; do
111+
for whl in dist/*linux_$(uname -m).whl; do
112112
# Repair wheel using monkey patch to exclude shared libraries provided in whitelist
113113
${Python3_EXECUTABLE} "${script_dir}/auditwheel_whitelist_monkeypatch.py" \
114114
repair ${whl} -w /work/dist/ --whitelist "${EXCLUDE_LIBS}"

scripts/internal/manylinux-build-wheels.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
8181
-DITK_WRAP_double:BOOL=ON \
8282
-DITK_WRAP_complex_double:BOOL=ON \
8383
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
84-
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -p)-linux-gnu \
84+
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -m)-linux-gnu \
8585
-DCMAKE_CXX_FLAGS:STRING="$compile_flags" \
8686
-DCMAKE_C_FLAGS:STRING="$compile_flags" \
8787
-DCMAKE_BUILD_TYPE:STRING="${build_type}" \
@@ -110,7 +110,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
110110
-DBUILD_TESTING:BOOL=OFF \
111111
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
112112
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
113-
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -p)-linux-gnu \
113+
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -m)-linux-gnu \
114114
-DCMAKE_CXX_FLAGS:STRING="$compile_flags" \
115115
-DCMAKE_C_FLAGS:STRING="$compile_flags" \
116116
-DCMAKE_BUILD_TYPE:STRING="${build_type}" \
@@ -168,12 +168,12 @@ done
168168
if test "${ARCH}" == "x64"; then
169169
sudo /opt/python/cp39-cp39/bin/pip3 install auditwheel wheel
170170
# This step will fixup the wheel switching from 'linux' to 'manylinux<version>' tag
171-
for whl in dist/itk_*linux_$(uname -p).whl; do
171+
for whl in dist/itk_*linux_$(uname -m).whl; do
172172
/opt/python/cp39-cp39/bin/auditwheel repair --plat manylinux${MANYLINUX_VERSION}_x86_64 ${whl} -w /work/dist/
173173
rm ${whl}
174174
done
175175
else
176-
for whl in dist/itk_*$(uname -p).whl; do
176+
for whl in dist/itk_*$(uname -m).whl; do
177177
auditwheel repair ${whl} -w /work/dist/
178178
rm ${whl}
179179
done

0 commit comments

Comments
 (0)