Skip to content

Commit 70d2496

Browse files
authored
Merge pull request #152 from thewtex/wrap-4d
2 parents b89d1d6 + 76f4400 commit 70d2496

8 files changed

+28
-19
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ if(ITKPythonPackage_SUPERBUILD)
226226
-DITK_WRAP_PYTHON:BOOL=ON
227227
-DITK_WRAP_unsigned_short:BOOL=ON
228228
-DITK_WRAP_double:BOOL=ON
229+
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4"
229230
-DITK_WRAP_DOC:BOOL=ON
230231
-DDOXYGEN_EXECUTABLE:FILEPATH=${DOXYGEN_EXECUTABLE}
231232
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR}

docs/Build_ITK_Python_packages.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ For example::
3232
[...]
3333

3434
$ ls -1 dist/
35-
itk-4.11.0.dev20170218-cp27-cp27m-manylinux1_x86_64.whl
36-
itk-4.11.0.dev20170218-cp27-cp27mu-manylinux1_x86_64.whl
37-
itk-4.11.0.dev20170218-cp34-cp34m-manylinux1_x86_64.whl
38-
itk-4.11.0.dev20170218-cp35-cp35m-manylinux1_x86_64.whl
39-
itk-4.11.0.dev20170218-cp36-cp36m-manylinux1_x86_64.whl
35+
itk-4.11.0.dev20170218-cp27-cp27m-manylinux2014_x86_64.whl
36+
itk-4.11.0.dev20170218-cp27-cp27mu-manylinux2014_x86_64.whl
37+
itk-4.11.0.dev20170218-cp34-cp34m-manylinux2014_x86_64.whl
38+
itk-4.11.0.dev20170218-cp35-cp35m-manylinux2014_x86_64.whl
39+
itk-4.11.0.dev20170218-cp36-cp36m-manylinux2014_x86_64.whl
4040

4141
macOS
4242
-----

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

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

1111
# Generate dockcross scripts
12-
docker run --rm dockcross/manylinux1-x64:20201015-96d8741 > /tmp/dockcross-manylinux-x64
12+
docker run --rm dockcross/manylinux2014-x64:20201015-96d8741 > /tmp/dockcross-manylinux-x64
1313
chmod u+x /tmp/dockcross-manylinux-x64
1414

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

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 cp35
99

1010
# Generate dockcross scripts
11-
docker run --rm dockcross/manylinux1-x64:20201015-96d8741 > /tmp/dockcross-manylinux-x64
11+
docker run --rm dockcross/manylinux2014-x64:20201015-96d8741 > /tmp/dockcross-manylinux-x64
1212
chmod u+x /tmp/dockcross-manylinux-x64
1313

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ for PYBIN in "${PYBINARIES[@]}"; do
2525
version=$(basename $(dirname ${PYBIN}))
2626
# Remove "m" -- not present in Python 3.8 and later
2727
version=${version:0:9}
28-
itk_build_dir=/work/$(basename /ITKPythonPackage/ITK-${version}*-manylinux1_${ARCH})
29-
ln -fs /ITKPythonPackage/ITK-${version}*-manylinux1_${ARCH} $itk_build_dir
28+
itk_build_dir=/work/$(basename /ITKPythonPackage/ITK-${version}*-manylinux2014_${ARCH})
29+
ln -fs /ITKPythonPackage/ITK-${version}*-manylinux2014_${ARCH} $itk_build_dir
3030
if [[ ! -d ${itk_build_dir} ]]; then
3131
echo 'ITK build tree not available!' 1>&2
3232
exit 1
@@ -51,7 +51,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
5151
done
5252

5353
# Since there are no external shared libraries to bundle into the wheels
54-
# this step will fixup the wheel switching from 'linux' to 'manylinux1' tag
54+
# this step will fixup the wheel switching from 'linux' to 'manylinux2014' tag
5555
for whl in dist/*linux_$(uname -p).whl; do
5656
auditwheel repair ${whl} -w /work/dist/
5757
rm ${whl}

scripts/internal/manylinux-build-wheels.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ for PYBIN in "${PYBINARIES[@]}"; do
3838
# Install dependencies
3939
${PYBIN}/pip install --upgrade -r /work/requirements-dev.txt
4040

41-
build_type=""
42-
compile_flags="-O2 -DNDEBUG"
41+
build_type="Release"
42+
compile_flags="-O3 -DNDEBUG"
4343
source_path=/work/ITK-source/ITK
44-
build_path=/work/ITK-$(basename $(dirname ${PYBIN}))-manylinux1_${ARCH}
44+
build_path=/work/ITK-$(basename $(dirname ${PYBIN}))-manylinux2014_${ARCH}
4545
SETUP_PY_CONFIGURE="${script_dir}/../setup_py_configure.py"
4646
SKBUILD_CMAKE_INSTALL_PREFIX=$(${Python3_EXECUTABLE} -c "from skbuild.constants import CMAKE_INSTALL_DIR; print(CMAKE_INSTALL_DIR)")
4747

@@ -64,6 +64,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
6464
-DITKPythonPackage_WHEEL_NAME:STRING="itk" \
6565
-DITK_WRAP_unsigned_short:BOOL=ON \
6666
-DITK_WRAP_double:BOOL=ON \
67+
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
6768
-DCMAKE_CXX_COMPILER_TARGET:STRING=$(uname -p)-linux-gnu \
6869
-DCMAKE_CXX_FLAGS:STRING="$compile_flags" \
6970
-DCMAKE_C_FLAGS:STRING="$compile_flags" \
@@ -100,6 +101,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
100101
-DWRAP_ITK_INSTALL_COMPONENT_PER_MODULE:BOOL=ON \
101102
-DITK_WRAP_unsigned_short:BOOL=ON \
102103
-DITK_WRAP_double:BOOL=ON \
104+
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
103105
-DPY_SITE_PACKAGES_PATH:PATH="." \
104106
-DITK_LEGACY_SILENT:BOOL=ON \
105107
-DITK_WRAP_PYTHON:BOOL=ON \
@@ -123,6 +125,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
123125
-DITKPythonPackage_WHEEL_NAME:STRING=${wheel_name} \
124126
-DITK_WRAP_unsigned_short:BOOL=ON \
125127
-DITK_WRAP_double:BOOL=ON \
128+
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
126129
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
127130
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
128131
-DCMAKE_BUILD_TYPE:STRING="${build_type}" \
@@ -143,14 +146,15 @@ for PYBIN in "${PYBINARIES[@]}"; do
143146

144147
done
145148

146-
# auditwheel contains a regression where it will consume the "itk" wheels.
147-
/opt/python/cp37-cp37m/bin/pip3 install auditwheel==1.9.0 wheel==0.26.0
149+
/opt/python/cp37-cp37m/bin/pip3 install auditwheel wheel
148150
# Since there are no external shared libraries to bundle into the wheels
149-
# this step will fixup the wheel switching from 'linux' to 'manylinux1' tag
150-
for whl in dist/*linux_$(uname -p).whl; do
151-
/opt/python/cp37-cp37m/bin/auditwheel repair ${whl} -w /work/dist/
151+
# this step will fixup the wheel switching from 'linux' to 'manylinux2014' tag
152+
for whl in dist/itk_*linux_$(uname -p).whl; do
153+
/opt/python/cp37-cp37m/bin/auditwheel repair --plat manylinux2014_x86_64 ${whl} -w /work/dist/
152154
rm ${whl}
153155
done
156+
itk_wheel=$(ls dist/itk-*linux*)
157+
mv ${itk_wheel} ${itk_wheel/linux/manylinux2014}
154158

155159
# Install packages and test
156160
for PYBIN in "${PYBINARIES[@]}"; do

scripts/macpython-build-wheels.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ for VENV in "${VENVS[@]}"; do
7272
# Install dependencies
7373
${Python3_EXECUTABLE} -m pip install --upgrade -r ${SCRIPT_DIR}/../requirements-dev.txt
7474

75-
build_type="MinSizeRel"
75+
build_type="Release"
7676
plat_name="macosx-10.9-x86_64"
7777
osx_target="10.9"
7878
source_path=${SCRIPT_DIR}/../ITK-source/ITK
@@ -99,6 +99,7 @@ for VENV in "${VENVS[@]}"; do
9999
-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 \
100100
-DITK_WRAP_unsigned_short:BOOL=ON \
101101
-DITK_WRAP_double:BOOL=ON \
102+
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
102103
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
103104
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
104105
-DITK_WRAP_DOC:BOOL=ON
@@ -124,6 +125,7 @@ for VENV in "${VENVS[@]}"; do
124125
-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 \
125126
-DITK_WRAP_unsigned_short:BOOL=ON \
126127
-DITK_WRAP_double:BOOL=ON \
128+
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
127129
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
128130
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
129131
-DWRAP_ITK_INSTALL_COMPONENT_IDENTIFIER:STRING=PythonWheel \
@@ -152,6 +154,7 @@ for VENV in "${VENVS[@]}"; do
152154
-DITKPythonPackage_WHEEL_NAME:STRING=${wheel_name} \
153155
-DITK_WRAP_unsigned_short:BOOL=ON \
154156
-DITK_WRAP_double:BOOL=ON \
157+
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
155158
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
156159
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
157160
-DITK_WRAP_DOC:BOOL=ON \

scripts/windows_build_wheels.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def build_wrapped_itk(
9090
"-DPython3_EXECUTABLE:FILEPATH=%s" % python_executable,
9191
"-DITK_WRAP_unsigned_short:BOOL=ON",
9292
"-DITK_WRAP_double:BOOL=ON",
93+
"-DITK_WRAP_IMAGE_DIMS:STRING=2;3;4",
9394
"-DPython3_INCLUDE_DIR:PATH=%s" % python_include_dir,
9495
"-DPython3_INCLUDE_DIRS:PATH=%s" % python_include_dir,
9596
"-DPython3_LIBRARY:FILEPATH=%s" % python_library,

0 commit comments

Comments
 (0)