Skip to content

Commit 96e3477

Browse files
committed
COMP: Update Linux module build for binary swig
Following InsightSoftwareConsortium/ITK@bfc7f7b swig has an updated path and it is a pre-built binary. Ideally we do not encode the version, but we should be moving beyond swig.
1 parent 26d0b48 commit 96e3477

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ source "${script_dir}/manylinux-build-common.sh"
7373
sudo ldconfig
7474
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/work/oneTBB-prefix/lib:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
7575

76+
# Swig pre-built version from ITK build in ITKPythonPackage
77+
SWIG_VERSION=4.0.2
78+
7679
# Compile wheels re-using standalone project and archive cache
7780
for PYBIN in "${PYBINARIES[@]}"; do
7881
Python3_EXECUTABLE=${PYBIN}/python
@@ -102,18 +105,20 @@ for PYBIN in "${PYBINARIES[@]}"; do
102105
echo 'ITK source tree not available!' 1>&2
103106
exit 1
104107
fi
108+
swig_args=""
109+
if [[ "${ARCH}" = "x64" ]]; then
110+
swig_args="-DITK_USE_SYSTEM_SWIG:BOOL=ON -DSWIG_VERSION:STRING=${SWIG_VERSION} -DSWIG_EXECUTABLE:FILEPATH=${itk_build_dir}/Wrapping/Generators/SwigInterface/swiglinux-${SWIG_VERSION}/bin/swig -DSWIG_DIR:FILEPATH=${itk_build_dir}/Wrapping/Generators/SwigInterface/swiglinux-${SWIG_VERSION}/share/swig/${SWIG_VERSION}"
111+
fi
105112
${PYBIN}/python setup.py clean
106113
${PYBIN}/python setup.py bdist_wheel --build-type Release -G Ninja -- \
107114
-DITK_DIR:PATH=${itk_build_dir} \
108-
-DITK_USE_SYSTEM_SWIG:BOOL=ON \
109115
-DWRAP_ITK_INSTALL_COMPONENT_IDENTIFIER:STRING=PythonWheel \
110-
-DSWIG_EXECUTABLE:FILEPATH=${itk_build_dir}/Wrapping/Generators/SwigInterface/swig/bin/swig \
111116
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -m)-linux-gnu \
112117
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
113118
-DBUILD_TESTING:BOOL=OFF \
114119
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
115120
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
116-
${CMAKE_OPTIONS} \
121+
${swig_args} ${CMAKE_OPTIONS} \
117122
|| exit 1
118123
done
119124

0 commit comments

Comments
 (0)