Done
Description
Error log:
CMake Error at Wrapping/CMakeUtilityFunctions.cmake:40 (math):
math cannot parse the expression: ")
set(ITK_WRAP_VECTOR_COMPONENTS + 1": syntax error, unexpected
exp_CLOSEPARENT (1).
Call Stack (most recent call first):
Wrapping/WrapBasicTypes.cmake:55 (INCREMENT)
Wrapping/ConfigureWrapping.cmake:131 (include)
Wrapping/CMakeLists.txt:97 (include)
CMake Warning (dev) at Wrapping/CMakeUtilityFunctions.cmake:40 (math):
Unexpected character in expression at position 1: "
Call Stack (most recent call first):
Wrapping/WrapBasicTypes.cmake:63 (INCREMENT)
Wrapping/ConfigureWrapping.cmake:131 (include)
Wrapping/CMakeLists.txt:97 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at Wrapping/WrapBasicTypes.cmake:73 (message):
ITK_WRAP_VECTOR_COMPONENTS must include ITK_WRAP_IMAGE_DIMS
Call Stack (most recent call first):
Wrapping/ConfigureWrapping.cmake:131 (include)
Wrapping/CMakeLists.txt:97 (include)
See the complete build log here
Metadata
Metadata
Assignees
Labels
No labels
Activity
thewtex commentedon Apr 2, 2021
How is the build invoked?
hubutui commentedon Apr 3, 2021
I use clang instead of gcc, because I used to build python-itk 5.1.2 with clang.
thewtex commentedon Apr 5, 2021
Does the same issue occur with the
v5.2.0tag (the currentreleasebranch)?hubutui commentedon Apr 6, 2021
yes, check the latest build log for v5.2.0 here.
thewtex commentedon Apr 6, 2021
@hubutui , please try this branch #156
hubutui commentedon Apr 7, 2021
I got this error when building with clang 11.1.0:
check the complete build log here
I could build itk with gcc 10.2.0. I create pkg for ArchLinux with:
python setup.py build python setup.py install --root="${pkgdir}" --optimize=1 --skip-buildBut I fail to read example image with
itk.imread(), error output:and
itk.Image.GetTypes()gives me:Did I use the wrong method to build and create pkg for python-itk?
thewtex commentedon Apr 21, 2021
@hubutui please test this patch:
InsightSoftwareConsortium/ITK#2498
The default build does not enable support for all pixel types. To add support for more pixels type, enable CMake configurations such as:
ITKPythonPackage/scripts/internal/manylinux-build-wheels.sh
Lines 126 to 128 in e019220
hubutui commentedon Apr 21, 2021
OK, I could now build python-itk with pull 156 and pull 2498 patches applied.
However, I still fail to read the example image with
itk.imread()with a similar error message as above.Are these wheels from PyPI build with:
?
I could confirm that if I install from PyPi, I could read the example image.
thewtex commentedon Apr 21, 2021
This indicated the
signed shortpixel type, which is wrapped by default.The error message says 2D signed short images are wrapped. However, I do not see 3D listed.
As with #156, we may need to remove the quotes.
hubutui commentedon Apr 22, 2021
@thewtex I'm confused, if I run
python setup.py build -- \ -DITK_WRAP_unsigned_short:BOOL=ON \ -DITK_WRAP_double:BOOL=ON \ -DITK_WRAP_IMAGE_DIMS:STRING=2;3;4 \ -DITK_SOURCE_DIR="${srcdir}/ITK-5.2.0"doesn't it means:
python setup.py build -- \ -DITK_WRAP_unsigned_short:BOOL=ON \ -DITK_WRAP_double:BOOL=ON \ -DITK_WRAP_IMAGE_DIMS:STRING=2 3 4 -DITK_SOURCE_DIR="${srcdir}/ITK-5.2.0"?
thewtex commentedon Apr 22, 2021
@hubutui yes, how about
"-DITK_WRAP_IMAGE_DIMS:STRING=2;3;4"hubutui commentedon Apr 22, 2021
I could build python-itk with:
However, it seems that
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4"is not passed to ITK build stage, soitk.Image.GetTypes()shows no 3D type supported.hubutui commentedon Apr 22, 2021
I check
${srcdir}/ITKPythonPackage-5.2.0/_skbuild/linux-x86_64-3.9/cmake-build/ITKb/CMakeCache.txt, and foundITK_WRAP_IMAGE_DIMS:STRING=2, if I set"-DITK_WRAP_IMAGE_DIMS:STRING=2;3;4".ITK_WRAP_IMAGE_DIMS:STRING=2is also found in${srcdir}/ITKPythonPackage-5.2.0/_skbuild/linux-x86_64-3.9/cmake-build/ITKb/CMakeCache.txtif I set-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4".hubutui commentedon Apr 22, 2021
I check the build log, and log messages mentioned
ITK_WRAP_IMAGE_DIMSin build stage:hubutui commentedon Apr 30, 2021
update:
I rebuild with v5.2.0.post1, now
ITK_WRAP_IMAGE_DIMS:STRING=2,3,4is found in${srcdir}/ITKPythonPackage-5.2.0/_skbuild/linux-x86_64-3.9/cmake-build/ITKb/CMakeCache.txtas expected. However, it seems that there is something wrong with the install step.python setup.py install --root="${pkgdir}" --optimize=1 --skip-buildNothing is installed except an
__init__.pyfile.The install tree looks like this:
check the complete build log here
thewtex commentedon May 4, 2021
@hubutui thanks for the update.
Does
python setup.py bdist_wheel,python -m pip install dist/*.whlwork?hubutui commentedon May 4, 2021
_itkver=5.2.0 python setup.py bdist_wheel -- \ -DITK_WRAP_unsigned_short:BOOL=ON \ -DITK_WRAP_double:BOOL=ON \ -DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" \ -DITK_SOURCE_DIR="${srcdir}/ITK-${_itkver}" PIP_CONFIG_FILE=/dev/null pip install --isolated --root="${pkgdir}" --ignore-installed --no-deps dist/*.whlNo, it didn't work. Check the complete build log here.
thewtex commentedon May 4, 2021
A quick looks, and I am having a hard time finding the error. Any pointers?
It seems to end with
and the fils that were built in the package, which look to be in their correct location:
hubutui commentedon May 5, 2021
I check the build wheel file, it's less than 1MB. According to
ITKPythonPackage/scripts/internal/manylinux-build-wheels.sh
Lines 51 to 79 in f7fb031
I rebuid with these commands:
I could now build the wheel file, but the file
itkConfig.pyis installed to/usr, not/usr/lib/python3.9/site-packages. This lead to import error:I manually move
/usr/itkConfig.pyto/usr/lib/python3.9/site-packages/itkConfig.py, then I got error when I try to read an image:and
itk.Image.GetTypesoutputs:see also the complete build log here.
The lines between
Starting build()andStarting package()are the log for build step, and lines afterStarting package()are the log for install step.hubutui commentedon May 6, 2021
I also try to build the python binding with only ITK source, not using this repo.
cmake_opts=( -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_SKIP_INSTALL_RPATH=ON -DITK_BUILD_DEFAULT_MODULES=ON -DITK_USE_MKL=ON -DITK_USE_SYSTEM_CASTXML=ON -DITK_USE_SYSTEM_DOUBLECONVERSION=OFF -DITK_USE_SYSTEM_EIGEN=ON -DITK_USE_SYSTEM_EXPAT=ON -DITK_USE_SYSTEM_FFTW=ON -DITK_USE_SYSTEM_GDCM=ON -DITK_USE_SYSTEM_GOOGLETEST=ON -DITK_USE_SYSTEM_HDF5=ON -DITK_USE_SYSTEM_JPEG=ON -DITK_USE_SYSTEM_PNG=ON -DITK_USE_SYSTEM_SWIG=ON -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_WRAP_unsigned_short=ON -DITK_WRAP_double=ON -DITK_WRAP_IMAGE_DIMS="2;3;4" -DITK_WRAP_PYTHON=ON ) git clone https://github.com/InsightSoftwareConsortium/ITK.git _pkgname=ITK cmake -B "build" -S "${srcdir}/${_pkgname}" \ ${cmake_opts[@]} \ -DITK_USE_GPU=ON make -C "${srcdir}/build" make -C "${srcdir}/build" DESTDIR="${pkgdir}" installeverything works great. I could build and install both ITK and its python binding.