Skip to content

Commit 3152b3b

Browse files
committed
Merge branch 'master' into release
2 parents f390080 + 7216514 commit 3152b3b

16 files changed

+153
-27
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ if(ITKPythonPackage_SUPERBUILD)
9393

9494
set(ITK_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git")
9595

96-
# ITK release 2021-09-10
96+
# ITK release 2021-10-27
9797
set(ITK_GIT_TAG "30cd5fa095a6b2e52fac052e4a84bb3740fcc2b1")
9898

9999
#-----------------------------------------------------------------------------

itkVersion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '5.3rc1'
1+
VERSION = '5.3rc2'
22

33
def get_versions():
44
"""Returns versions for the ITK Python package.

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,18 @@
77
# For example,
88
#
99
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
10+
#
11+
# Shared libraries can be included in the wheel by exporting them to LD_LIBRARY_PATH before
12+
# running this script.
13+
#
14+
# For example,
15+
#
16+
# export LD_LIBRARY_PATH="/path/to/OpenCL.so:/path/to/OpenCL.so.1.2"
17+
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
18+
#
1019

1120
# Generate dockcross scripts
12-
docker run --rm dockcross/manylinux2014-x64:20210823-d7b98b4 > /tmp/dockcross-manylinux-x64
21+
docker run --rm dockcross/manylinux2014-x64:20211011-a315bdc > /tmp/dockcross-manylinux-x64
1322
chmod u+x /tmp/dockcross-manylinux-x64
1423

1524
script_dir=$(cd $(dirname $0) || exit 1; pwd)
@@ -19,6 +28,13 @@ chmod 777 $(pwd)/tools
1928
# Build wheels
2029
mkdir -p dist
2130
DOCKER_ARGS="-v $(pwd)/dist:/work/dist/ -v $script_dir/..:/ITKPythonPackage -v $(pwd)/tools:/tools"
31+
# Mount any shared libraries
32+
if [[ -n ${LD_LIBRARY_PATH} ]]; then
33+
for libpath in ${LD_LIBRARY_PATH//:/ }; do
34+
DOCKER_ARGS+=" -v ${libpath}:/usr/lib64/$(basename -- ${libpath})"
35+
done
36+
fi
37+
2238
/tmp/dockcross-manylinux-x64 \
2339
-a "$DOCKER_ARGS" \
2440
"/ITKPythonPackage/scripts/internal/manylinux-build-module-wheels.sh" "$@"

scripts/dockcross-manylinux-build-tarball.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if test -e /home/kitware/Support/zstd-build/programs/zstd; then
1313
fi
1414
tar -c --to-stdout \
1515
ITKPythonPackage/ITK-* \
16+
ITKPythonPackage/oneTBB* \
1617
ITKPythonPackage/scripts > ITKPythonBuilds-linux.tar
1718
$zstd_exe -f \
1819
./ITKPythonBuilds-linux.tar \

scripts/dockcross-manylinux-build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# scripts/dockcross-manylinux-build-wheels.sh cp39
99

1010
# Generate dockcross scripts
11-
docker run --rm dockcross/manylinux2014-x64:20210823-d7b98b4 > /tmp/dockcross-manylinux-x64
11+
docker run --rm dockcross/manylinux2014-x64:20211011-a315bdc > /tmp/dockcross-manylinux-x64
1212
chmod u+x /tmp/dockcross-manylinux-x64
1313

1414
script_dir=$(cd $(dirname $0) || exit 1; pwd)

scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ else
2929
echo "Extracting files relevant for: $1";
3030
tar xf ITKPythonBuilds-linux.tar ITKPythonPackage/scripts/
3131
tar xf ITKPythonBuilds-linux.tar ITKPythonPackage/ITK-source/
32+
tar xf ITKPythonBuilds-linux.tar ITKPythonPackage/oneTBB-prefix/
3233
tar xf ITKPythonBuilds-linux.tar --wildcards ITKPythonPackage/ITK-$1*
3334
fi
3435
rm ITKPythonBuilds-linux.tar

scripts/internal/manylinux-build-common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [[ $# -eq 0 ]]; then
1616
PYBIN=(/opt/python/*/bin)
1717
PYBINARIES=()
1818
for version in "${PYBIN[@]}"; do
19-
if [[ ${version} == *"cp37"* || ${version} == *"cp38"* || ${version} == *"cp39"* ]]; then
19+
if [[ ${version} == *"cp37"* || ${version} == *"cp38"* || ${version} == *"cp39"* || ${version} == *"cp310"* ]]; then
2020
PYBINARIES+=(${version})
2121
fi
2222
done

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env bash
22

3+
# Run this script inside a dockcross container to build Python wheels for an ITK module.
4+
#
5+
# Versions can be restricted by passing them in as arguments to the script.
6+
# For example,
7+
#
8+
# /tmp/dockcross-manylinux-x64 manylinux-build-module-wheels.sh cp39
9+
#
10+
# Shared library dependencies can be included in the wheel by mounting them to /usr/lib64 or /usr/local/lib64
11+
# before running this script.
12+
#
13+
# For example,
14+
#
15+
# DOCKER_ARGS="-v /path/to/lib.so:/usr/local/lib64/lib.so"
16+
# /tmp/dockcross-manylinux-x64 -a "$DOCKER_ARGS" manylinux-build-module-wheels.sh
17+
#
18+
319
# -----------------------------------------------------------------------
420
# These variables are set in common script:
521
#
@@ -10,8 +26,9 @@ script_dir=$(cd $(dirname $0) || exit 1; pwd)
1026
source "${script_dir}/manylinux-build-common.sh"
1127
# -----------------------------------------------------------------------
1228

13-
# So auditwheel can find the libs
14-
export LD_LIBRARY_PATH=/work/oneTBB-prefix/lib64
29+
# Set up library paths in container so that shared libraries can be added to wheels
30+
sudo ldconfig
31+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/work/oneTBB-prefix/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
1532

1633
# Compile wheels re-using standalone project and archive cache
1734
for PYBIN in "${PYBINARIES[@]}"; do

scripts/internal/manylinux-build-wheels.sh

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env bash
22

3+
# Run this script inside a dockcross container to build Python wheels for ITK.
4+
#
5+
# Versions can be restricted by passing them in as arguments to the script.
6+
# For example,
7+
#
8+
# /tmp/dockcross-manylinux-x64 manylinux-build-wheels.sh cp39
9+
#
10+
# Shared library dependencies can be included wheels by mounting them to /usr/lib64 or /usr/local/lib64
11+
# before running this script.
12+
#
13+
# For example,
14+
#
15+
# DOCKER_ARGS="-v /path/to/lib.so:/usr/local/lib64/lib.so"
16+
# /tmp/dockcross-manylinux-x64 -a "$DOCKER_ARGS" manylinux-build-wheels.sh
17+
#
18+
319
# -----------------------------------------------------------------------
420
# These variables are set in common script:
521
#
@@ -20,7 +36,8 @@ pushd /work/ITK-source > /dev/null 2>&1
2036
popd > /dev/null 2>&1
2137
tbb_dir=/work/oneTBB-prefix/lib64/cmake/TBB
2238
# So auditwheel can find the libs
23-
export LD_LIBRARY_PATH=/work/oneTBB-prefix/lib64
39+
sudo ldconfig
40+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/work/oneTBB-prefix/lib64:/usr/lib:/usr/lib64
2441

2542
SINGLE_WHEEL=0
2643

@@ -149,10 +166,10 @@ for PYBIN in "${PYBINARIES[@]}"; do
149166
done
150167

151168
if test "${ARCH}" == "x64"; then
152-
/opt/python/cp37-cp37m/bin/pip3 install auditwheel wheel
169+
sudo /opt/python/cp39-cp39/bin/pip3 install auditwheel wheel
153170
# This step will fixup the wheel switching from 'linux' to 'manylinux2014' tag
154171
for whl in dist/itk_*linux_$(uname -p).whl; do
155-
/opt/python/cp37-cp37m/bin/auditwheel repair --plat manylinux2014_x86_64 ${whl} -w /work/dist/
172+
/opt/python/cp39-cp39/bin/auditwheel repair --plat manylinux2014_x86_64 ${whl} -w /work/dist/
156173
rm ${whl}
157174
done
158175
else
@@ -161,8 +178,22 @@ else
161178
rm ${whl}
162179
done
163180
fi
181+
itk_core_whl=$(ls dist/itk_core*whl | head -n 1)
182+
repaired_plat1=$(echo $itk_core_whl | cut -d- -f5 | cut -d. -f1)
183+
repaired_plat2=$(echo $itk_core_whl | cut -d- -f5 | cut -d. -f2)
164184
for itk_wheel in dist/itk*-linux*.whl; do
165-
mv ${itk_wheel} ${itk_wheel/linux/manylinux2014}
185+
mkdir -p unpacked_whl packed_whl
186+
/opt/python/cp39-cp39/bin/wheel unpack -d unpacked_whl ${itk_wheel}
187+
version=$(echo ${itk_wheel} | cut -d- -f3-4)
188+
echo "Wheel-Version: 1.0" > unpacked_whl/itk-*/*.dist-info/WHEEL
189+
echo "Generator: skbuild 0.8.1" >> unpacked_whl/itk-*/*.dist-info/WHEEL
190+
echo "Root-Is-Purelib: false" >> unpacked_whl/itk-*/*.dist-info/WHEEL
191+
echo "Tag: ${version}-${repaired_plat1}" >> unpacked_whl/itk-*/*.dist-info/WHEEL
192+
echo "Tag: ${version}-${repaired_plat2}" >> unpacked_whl/itk-*/*.dist-info/WHEEL
193+
echo "" >> unpacked_whl/itk-*/*.dist-info/WHEEL
194+
/opt/python/cp39-cp39/bin/wheel pack -d packed_whl ./unpacked_whl/itk-*
195+
mv packed_whl/*.whl dist/
196+
rm -rf unpacked_whl packed_whl ${itk_wheel}
166197
done
167198

168199
# Install packages and test

scripts/internal/windows_build_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
import shutil
66

7-
DEFAULT_PY_ENVS = ["37-x64", "38-x64", "39-x64"]
7+
DEFAULT_PY_ENVS = ["37-x64", "38-x64", "39-x64", "310-x64"]
88

99
SCRIPT_DIR = os.path.dirname(__file__)
1010
ROOT_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "..", ".."))

0 commit comments

Comments
 (0)