Skip to content

Commit 31a1921

Browse files
committed
ENH: Bump for ITK v5.3.0
Includes CI and build script updates for v5.3.0 build procedure.
1 parent efeb298 commit 31a1921

File tree

5 files changed

+110
-44
lines changed

5 files changed

+110
-44
lines changed

.github/workflows/build-test-package.yml

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ name: Build, test, package
33
on: [push,pull_request]
44

55
env:
6-
itk-git-tag: "171fb2ba33a87041f99328a2f26612ff33aa9cc8"
7-
itk-wheel-tag: "v5.3rc04.post3"
6+
itk-git-tag: "v5.3.0"
7+
itk-wheel-tag: "v5.3.0"
8+
itk-python-package-tag: "03391ad738438661fff40bfe37a7cfabd171b9b1"
89
opencl-icd-loader-git-tag: "v2021.04.29"
910
opencl-headers-git-tag: "v2021.04.29"
1011
vkfft-backend: 3
@@ -17,13 +18,13 @@ jobs:
1718
strategy:
1819
max-parallel: 3
1920
matrix:
20-
os: [ubuntu-20.04, windows-2019, macos-11]
21+
os: [ubuntu-20.04, windows-2022, macos-11]
2122
include:
2223
- os: ubuntu-20.04
2324
c-compiler: "gcc"
2425
cxx-compiler: "g++"
2526
cmake-build-type: "MinSizeRel"
26-
- os: windows-2019
27+
- os: windows-2022
2728
c-compiler: "cl.exe"
2829
cxx-compiler: "cl.exe"
2930
cmake-build-type: "Release"
@@ -46,7 +47,7 @@ jobs:
4647
python -m pip install ninja
4748
4849
- name: Get specific version of CMake, Ninja
49-
uses: lukka/get-cmake@v3.18.3
50+
uses: lukka/get-cmake@v3.22.2
5051

5152
- name: Download OpenCL-SDK
5253
if: matrix.os == 'macos-11'
@@ -73,7 +74,7 @@ jobs:
7374
shell: bash
7475

7576
- name: Install pocl
76-
if: matrix.os != 'windows-2019'
77+
if: matrix.os != 'windows-2022'
7778
run: |
7879
sudo conda config --add channels conda-forge
7980
sudo conda config --set channel_priority strict
@@ -98,7 +99,7 @@ jobs:
9899
shell: bash
99100

100101
- name: Build OpenCL-ICD-Loader
101-
if: matrix.os != 'windows-2019'
102+
if: matrix.os != 'windows-2022'
102103
run: |
103104
cd ..
104105
mkdir OpenCL-ICD-Loader-build
@@ -107,18 +108,18 @@ jobs:
107108
sudo cmake --build . --target install
108109
109110
- name: Build OpenCL-ICD-Loader
110-
if: matrix.os == 'windows-2019'
111+
if: matrix.os == 'windows-2022'
111112
run: |
112113
cd ..
113114
mkdir OpenCL-ICD-Loader-build
114115
cd OpenCL-ICD-Loader-build
115-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
116+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
116117
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../OpenCL-ICD-Loader
117118
cmake --build . --target install
118119
shell: cmd
119120

120121
- name: Build ITK
121-
if: matrix.os != 'windows-2019'
122+
if: matrix.os != 'windows-2022'
122123
run: |
123124
cd ..
124125
mkdir ITK-build
@@ -127,12 +128,12 @@ jobs:
127128
ninja
128129
129130
- name: Build ITK
130-
if: matrix.os == 'windows-2019'
131+
if: matrix.os == 'windows-2022'
131132
run: |
132133
cd ..
133134
mkdir ITK-build
134135
cd ITK-build
135-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
136+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
136137
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK
137138
ninja
138139
shell: cmd
@@ -196,31 +197,31 @@ jobs:
196197
shell: bash
197198

198199
- name: Build and test
199-
if: matrix.os != 'windows-2019'
200+
if: matrix.os != 'windows-2022'
200201
run: |
201202
ctest --output-on-failure -j 2 -V -S dashboard.cmake -R "VkFFTBackend"
202203
203204
- name: Build and test
204-
if: matrix.os == 'windows-2019'
205+
if: matrix.os == 'windows-2022'
205206
run: |
206-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
207+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
207208
ctest --output-on-failure -j 2 -V -S dashboard.cmake -R "VkFFTBackend"
208209
shell: cmd
209210

210211
build-windows-opencl-python-packages:
211-
runs-on: windows-2019
212+
runs-on: windows-2022
212213
strategy:
213214
max-parallel: 2
214215
matrix:
215-
python-version-minor: ["7", "8", "9", "10"]
216+
python-version-minor: ["7", "8", "9", "10", "11"]
216217
include:
217218
- c-compiler: "cl.exe"
218219
cxx-compiler: "cl.exe"
219220
cmake-build-type: "MinSizeRel"
220221

221222
steps:
222223
- name: Get specific version of CMake, Ninja
223-
uses: lukka/get-cmake@v3.18.3
224+
uses: lukka/get-cmake@v3.22.2
224225

225226
- uses: actions/checkout@v2
226227
with:
@@ -233,6 +234,7 @@ jobs:
233234
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1'))
234235
235236
- name: 'Fetch build dependencies'
237+
shell: bash
236238
run: |
237239
mv im ../../
238240
cd ../../im
@@ -242,7 +244,14 @@ jobs:
242244
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
243245
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
244246
7z x grep-win.zip -o/c/P/grep -aoa -r
245-
shell: bash
247+
248+
echo "Updating ITKPythonPackage build scripts to ${{ env.itk-python-package-tag }}"
249+
pushd /c/P/IPP
250+
git remote add InsightSoftwareConsortium https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git --tags
251+
git fetch InsightSoftwareConsortium
252+
git checkout ${{ env.itk-python-package-tag }}
253+
git status
254+
popd
246255
247256
- name: Download OpenCL-ICD-Loader
248257
run: |
@@ -265,15 +274,15 @@ jobs:
265274
cd ..
266275
mkdir OpenCL-ICD-Loader-build
267276
cd OpenCL-ICD-Loader-build
268-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
277+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
269278
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../OpenCL-ICD-Loader
270279
cmake --build . --target install
271280
shell: cmd
272281

273282
- name: 'Build 🐍 Python 📦 package'
274283
run: |
275284
cd ../../im
276-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
285+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
277286
set PATH=C:\P\grep;%PATH%
278287
set CC=cl.exe
279288
set CXX=cl.exe
@@ -291,7 +300,7 @@ jobs:
291300
strategy:
292301
max-parallel: 2
293302
matrix:
294-
python-version: ["37", "38", "39", "310"]
303+
python-version: ["37", "38", "39", "310", "311"]
295304

296305
steps:
297306
- uses: actions/checkout@v2
@@ -305,11 +314,19 @@ jobs:
305314
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
306315
df -h
307316
317+
- name: 'Fetch build dependencies'
318+
shell: bash
319+
run: |
320+
sudo apt-get install zstd
321+
unzstd --version
322+
308323
- name: 'Build 🐍 Python 📦 package'
309324
run: |
310325
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }}
311-
export TARBALL_SPECIALIZATION="-manylinux_2_28"
312-
./wrapping/dockcross-manylinux-download-cache.sh
326+
export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }}
327+
export MANYLINUX_VERSION="_2_28"
328+
echo "Building for manylinux specialization ${MANYLINUX_VERSION}"
329+
./wrapping/dockcross-manylinux-download-cache.sh cp${{ matrix.python-version }}
313330
./wrapping/dockcross-manylinux-build-module-wheels-opencl.sh cp${{ matrix.python-version }}
314331
315332
- name: Publish Python package as GitHub Artifact
@@ -331,16 +348,17 @@ jobs:
331348
sudo xcode-select -s "/Applications/Xcode_13.2.1.app"
332349
333350
- name: Get specific version of CMake, Ninja
334-
uses: lukka/get-cmake@v3.18.3
351+
uses: lukka/get-cmake@v3.22.2
335352

336353
- name: 'Fetch build script'
337354
run: |
338-
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
355+
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/${{ env.itk-python-package-tag }}/scripts/macpython-download-cache-and-build-module-wheels.sh -O
339356
chmod u+x macpython-download-cache-and-build-module-wheels.sh
340357
341358
- name: 'Build 🐍 Python 📦 package'
342359
run: |
343360
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }}
361+
export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }}
344362
export MACOSX_DEPLOYMENT_TARGET=10.9
345363
./macpython-download-cache-and-build-module-wheels.sh
346364

.github/workflows/test-gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test GPU
33
on: [pull_request]
44

55
env:
6-
itk-git-tag: "171fb2ba33a87041f99328a2f26612ff33aa9cc8"
6+
itk-git-tag: "abf5fa10522a36bc51f42f20f426a622f42ed90d"
77

88
jobs:
99
build-test-gpu:
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v2
3131

3232
- name: Get specific version of CMake, Ninja
33-
uses: lukka/get-cmake@v3.18.3
33+
uses: lukka/get-cmake@v3.22.2
3434

3535
- name: Download OpenCL-ICD-Loader
3636
run: |

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="itk-vkfft",
15-
version="0.1.9",
15+
version="0.2.0",
1616
author="Insight Software Consortium",
1717
author_email="itk+community@discourse.itk.org",
1818
packages=["itk"],
@@ -42,5 +42,5 @@
4242
license="Apache",
4343
keywords="ITK InsightToolkit",
4444
url=r"https://itk.org/",
45-
install_requires=[r"itk>=5.3rc04.post3"],
45+
install_requires=[r"itk>=5.3.0"],
4646
)

wrapping/dockcross-manylinux-build-module-wheels-opencl.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
# For example,
88
#
99
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
10+
#
11+
# Forked from
12+
# https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/scripts/dockcross-manylinux-build-module-wheels.sh
1013

1114
# Generate dockcross scripts
1215

13-
MANYLINUX_VERSION="_2_28"
14-
IMAGE_TAG=20220715-9ce3707
16+
MANYLINUX_VERSION=${MANYLINUX_VERSION:=_2_28}
17+
IMAGE_TAG=${IMAGE_TAG:=20221108-102ebcc}
1518
OPENCL_ICD_LOADER_TAG=v2021.04.29
1619
OPENCL_HEADERS_TAG=v2021.04.29
1720

@@ -20,6 +23,12 @@ chmod u+x /tmp/dockcross-manylinux-x64
2023

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

26+
mkdir -p $(pwd)/tools
27+
chmod 777 $(pwd)/tools
28+
# Build wheels
29+
mkdir -p dist
30+
31+
# Build OpenCL-ICD-Loader before ITKVkFFTBackend
2332
if ! test -d ./OpenCL-ICD-Loader; then
2433
git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader
2534
pushd OpenCL-ICD-Loader
@@ -40,8 +49,12 @@ if ! test -d ./OpenCL-ICD-Loader; then
4049
fi
4150

4251
# Build wheels
43-
mkdir -p dist
44-
DOCKER_ARGS="-v $(pwd)/dist:/work/dist/ -v $script_dir/../ITKPythonPackage:/ITKPythonPackage -v $(pwd)/tools:/tools -v $(pwd)/OpenCL-ICD-Loader/inc/CL:/usr/include/CL -v $(pwd)/OpenCL-ICD-Loader-build/libOpenCL.so.1.2:/usr/lib64/libOpenCL.so.1 -v $(pwd)/OpenCL-ICD-Loader-build/libOpenCL.so.1.2:/usr/lib64/libOpenCL.so"
52+
DOCKER_ARGS="-v $(pwd)/dist:/work/dist/ -v $script_dir/../ITKPythonPackage:/ITKPythonPackage -v $(pwd)/tools:/tools"
53+
DOCKER_ARGS+=" -v $(pwd)/OpenCL-ICD-Loader/inc/CL:/usr/include/CL"
54+
DOCKER_ARGS+=" -v $(pwd)/OpenCL-ICD-Loader-build/libOpenCL.so.1.2:/usr/lib64/libOpenCL.so.1"
55+
DOCKER_ARGS+=" -v $(pwd)/OpenCL-ICD-Loader-build/libOpenCL.so.1.2:/usr/lib64/libOpenCL.so"
56+
DOCKER_ARGS+=" -e MANYLINUX_VERSION"
57+
4558
/tmp/dockcross-manylinux-x64 \
4659
-a "$DOCKER_ARGS" \
4760
"/ITKPythonPackage/scripts/internal/manylinux-build-module-wheels.sh" "$@"

wrapping/dockcross-manylinux-download-cache.sh

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,55 @@
22

33
# This module should be pulled and run from an ITKModule root directory to generate the Linux python wheels of this module,
44
# it is used by the circle.yml file contained in ITKModuleTemplate: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate
5+
#
6+
# Forked from
7+
# https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh
58

6-
curl https://data.kitware.com/api/v1/file/592dd8068d777f16d01e1a92/download -o zstd-1.2.0-linux.tar.gz
7-
gunzip -d zstd-1.2.0-linux.tar.gz
8-
tar xf zstd-1.2.0-linux.tar
9+
# -----------------------------------------------------------------------
910

11+
# Verifies that unzstd binary is available to decompress ITK build archives.
12+
unzstd_exe=`(which unzstd)`
13+
14+
if [[ -z ${unzstd_exe} ]]; then
15+
echo "ERROR: can not find required binary 'unzstd' "
16+
exit 255
17+
fi
18+
19+
# Expect unzstd > v1.3.2, see discussion in `dockcross-manylinux-build-tarball.sh`
20+
${unzstd_exe} --version
21+
22+
# -----------------------------------------------------------------------
23+
# Fetch build archive
24+
25+
TARBALL_SPECIALIZATION="-manylinux${MANYLINUX_VERSION:=_2_28}"
1026
TARBALL_NAME="ITKPythonBuilds-linux${TARBALL_SPECIALIZATION}.tar"
11-
curl -L https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.3rc04.post2}/${TARBALL_NAME}.zst -O
12-
./zstd-1.2.0-linux/bin/unzstd ${TARBALL_NAME}.zst -o ${TARBALL_NAME}
13-
echo "Extracting all files"
14-
tar xf ${TARBALL_NAME}
27+
curl -L https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.3.0}/${TARBALL_NAME}.zst -O
28+
29+
${unzstd_exe} --long=31 ${TARBALL_NAME}.zst -o ${TARBALL_NAME}
30+
if [ "$#" -lt 1 ]; then
31+
echo "Extracting all files";
32+
tar xf ${TARBALL_NAME}
33+
else
34+
echo "Extracting files relevant for: $1";
35+
tar xf ${TARBALL_NAME} ITKPythonPackage/scripts/
36+
tar xf ${TARBALL_NAME} ITKPythonPackage/ITK-source/
37+
tar xf ${TARBALL_NAME} ITKPythonPackage/oneTBB-prefix/
38+
tar xf ${TARBALL_NAME} --wildcards ITKPythonPackage/ITK-$1*
39+
fi
1540
rm ${TARBALL_NAME}
1641

17-
mkdir tools
18-
curl https://data.kitware.com/api/v1/file/5c0aa4b18d777f2179dd0a71/download -o doxygen-1.8.11.linux.bin.tar.gz
19-
tar -xvzf doxygen-1.8.11.linux.bin.tar.gz -C tools
42+
# Optional: Update build scripts
43+
if [[ -n ${ITKPYTHONPACKAGE_TAG} ]]; then
44+
echo "Updating build scripts to ${ITKPYTHONPACKAGE_ORG:=InsightSoftwareConsortium}/ITKPythonPackage@${ITKPYTHONPACKAGE_TAG}"
45+
git clone "https://github.com/${ITKPYTHONPACKAGE_ORG}/ITKPythonPackage.git" "IPP-tmp"
46+
pushd IPP-tmp/
47+
git checkout "${ITKPYTHONPACKAGE_TAG}"
48+
git status
49+
popd
50+
51+
rm -rf ITKPythonPackage/scripts/
52+
cp -r IPP-tmp/scripts ITKPythonPackage/
53+
rm -rf IPP-tmp/
54+
fi
2055

2156
cp -a ITKPythonPackage/oneTBB-prefix ./

0 commit comments

Comments
 (0)