diff --git a/insighttoolkit-fno-sized-deallocation.patch b/insighttoolkit-fno-sized-deallocation.patch new file mode 100644 index 0000000..6ce1e62 --- /dev/null +++ b/insighttoolkit-fno-sized-deallocation.patch @@ -0,0 +1,32 @@ +From 58ce6e84f2b93a963f5e4ec58b87f72886a0aa6f Mon Sep 17 00:00:00 2001 +From: Matt McCormick +Date: Wed, 10 Aug 2022 15:23:47 -0400 +Subject: [PATCH] COMP: Add -fno-sized-deallocation for GCC 12 + +Addresses: + +``` +/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/new_allocator.h:158:2: error: call to '__builtin_operator_delete' selects non-usual deallocation function + _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n)); +``` + +Fixes #3452 +--- + CMake/ITKSetStandardCompilerFlags.cmake | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/CMake/ITKSetStandardCompilerFlags.cmake b/CMake/ITKSetStandardCompilerFlags.cmake +index 7886b169e52..8c3eabe3aab 100644 +--- a/CMake/ITKSetStandardCompilerFlags.cmake ++++ b/CMake/ITKSetStandardCompilerFlags.cmake +@@ -344,6 +344,10 @@ macro(check_compiler_platform_flags) + endforeach() + endif() + ++ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12") ++ set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -fno-sized-deallocation") ++ endif() ++ + # gcc must have -msse2 option to enable sse2 support + if(VNL_CONFIG_ENABLE_SSE2 OR VNL_CONFIG_ENABLE_SSE2_ROUNDING) + set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -msse2") diff --git a/insighttoolkit.changes b/insighttoolkit.changes index 7a98760..8bb4204 100644 --- a/insighttoolkit.changes +++ b/insighttoolkit.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Aug 29 05:28:58 UTC 2022 - Atri Bhattacharya + +- Disable python bindings for openSUSE >= 1550 until swig related + issues are sorted [gh#InsightSoftwareConsortium/ITK#3452]. +- Add insighttoolkit-fno-sized-deallocation.patch: Add + -fno-sized-deallocation for GCC 12; patch taken from upstream + commit. + ------------------------------------------------------------------- Wed Apr 27 09:24:42 UTC 2022 - Jan Engelhardt diff --git a/insighttoolkit.spec b/insighttoolkit.spec index 7e5c750..ea77085 100644 --- a/insighttoolkit.spec +++ b/insighttoolkit.spec @@ -29,6 +29,13 @@ %bcond_without system_eigen %endif +# Python bindings must be turned off until https://github.com/InsightSoftwareConsortium/ITK/issues/3506 is resolved +%if 0%{?suse_version} >= 1550 +%bcond_with python +%else +%bcond_without python +%endif + Name: insighttoolkit Version: 5.2.1 Release: 0 @@ -36,6 +43,8 @@ Summary: Toolkit for scientific image processing, segmentation, and regis License: Apache-2.0 URL: https://www.itk.org Source: https://github.com/InsightSoftwareConsortium/ITK/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM insighttoolkit-fno-sized-deallocation.patch gh#InsightSoftwareConsortium/ITK#3452 badshah400@gmail.com -- Add -fno-sized-deallocation for GCC 12 to fix build failures; patch taken from upstream commit +Patch0: https://github.com/InsightSoftwareConsortium/ITK/commit/8f5e2618c2dee584e53ad13899384af82fbb77d9.patch#/insighttoolkit-fno-sized-deallocation.patch BuildRequires: CastXML-devel BuildRequires: bison BuildRequires: cmake @@ -49,15 +58,10 @@ BuildRequires: hdf5-devel BuildRequires: libnsl-devel BuildRequires: ninja BuildRequires: pkgconfig -BuildRequires: python3-devel -BuildRequires: swig BuildRequires: vtk-devel BuildRequires: vtk-qt BuildRequires: xz BuildRequires: cmake(double-conversion) -%if %{with system_eigen} -BuildRequires: pkgconfig(eigen3) -%endif BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(fftw3) BuildRequires: pkgconfig(libjpeg) @@ -68,6 +72,13 @@ BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(zlib) # https://github.com/InsightSoftwareConsortium/ITK/issues/2529 ExcludeArch: %{ix86} +%if %{with python} +BuildRequires: python3-devel +BuildRequires: swig +%endif +%if %{with system_eigen} +BuildRequires: pkgconfig(eigen3) +%endif %description The Insight Toolkit (ITK) is a toolkit for N-dimensional scientific @@ -145,7 +156,7 @@ This package provides the modules for ITK's python bindings. -DVXL_BUILD_CORE_NUMERICS:BOOL=OFF \ -DVCL_INCLUDE_CXX_0X:BOOL=ON \ -DITK_FORBID_DOWNLOADS=ON \ - -DITK_WRAP_PYTHON:BOOL=ON + -DITK_WRAP_PYTHON:BOOL=%{?with_python:ON}%{!?with_python:OFF} %cmake_build @@ -169,9 +180,11 @@ This package provides the modules for ITK's python bindings. %{_bindir}/itkTestDriver %doc %{_docdir}/%{name}/ +%if %{with python} %files -n python3-itk %license LICENSE NOTICE %{python3_sitearch}/*.py %{python3_sitearch}/itk/ +%endif %changelog