Skip to content

Commit 374c744

Browse files
committed
ENH: Add macOS wheel TBB support
1 parent a5f774b commit 374c744

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ if(ITKPythonPackage_SUPERBUILD)
106106
USES_TERMINAL_CONFIGURE 1
107107
USES_TERMINAL_BUILD 1
108108
)
109+
set(libpath "lib")
110+
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
111+
set(libpath "lib64")
112+
endif()
109113
if(ITK_SOURCE_DIR)
110-
set(TBB_DIR "${ITK_SOURCE_DIR}/../oneTBB-prefix/lib64/cmake/TBB")
114+
set(TBB_DIR "${ITK_SOURCE_DIR}/../oneTBB-prefix/${libpath}/cmake/TBB")
111115
else()
112-
set(TBB_DIR "${CMAKE_BINARY_DIR}/../oneTBB-prefix/lib64/cmake/TBB")
116+
set(TBB_DIR "${CMAKE_BINARY_DIR}/../oneTBB-prefix/${libpath}/cmake/TBB")
113117
endif()
114118
set(tbb_args
115119
-DModule_ITKTBB:BOOL=ON

docs/Build_ITK_Python_packages.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ Building ITK Python wheels
115115
Build the ITK Python wheel with the following command::
116116

117117
python3 -m venv build-itk
118-
./build-itk/bin/pip install -r requirements-dev.txt
118+
./build-itk/bin/pip install --upgrade pip
119+
./build-itk/bin/pip install -r requirements-dev.txt numpy
119120
./build-itk/bin/python setup.py bdist_wheel
120121

121122
Build a wheel for a custom version of ITK

scripts/macpython-build-wheels.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ DELOCATE_LISTDEPS=${VENV}/bin/delocate-listdeps
4141
DELOCATE_WHEEL=${VENV}/bin/delocate-wheel
4242

4343
# Build standalone project and populate archive cache
44+
tbb_dir=$PWD/oneTBB-prefix/lib/cmake/TBB
45+
# So delocate can find the libs
46+
export DYLD_LIBRARY_PATH=$PWD/oneTBB-prefix/lib
4447
mkdir -p ITK-source
4548
pushd ITK-source > /dev/null 2>&1
4649
${CMAKE_EXECUTABLE} -DITKPythonPackage_BUILD_PYTHON:PATH=0 \
@@ -103,6 +106,8 @@ for VENV in "${VENVS[@]}"; do
103106
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \
104107
-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \
105108
-DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \
109+
-DModule_ITKTBB:BOOL=ON \
110+
-DTBB_DIR:PATH=${tbb_dir} \
106111
-DITK_WRAP_DOC:BOOL=ON
107112
# Cleanup
108113
${Python3_EXECUTABLE} setup.py clean
@@ -136,6 +141,8 @@ for VENV in "${VENVS[@]}"; do
136141
-DITK_LEGACY_SILENT:BOOL=ON \
137142
-DITK_WRAP_PYTHON:BOOL=ON \
138143
-DITK_WRAP_DOC:BOOL=ON \
144+
-DModule_ITKTBB:BOOL=ON \
145+
-DTBB_DIR:PATH=${tbb_dir} \
139146
-G Ninja \
140147
${source_path} \
141148
&& ninja\

0 commit comments

Comments
 (0)