Package Details: insight-toolkit 5.2.1-15

Git Clone URL: https://aur.archlinux.org/insight-toolkit.git (read-only, click to copy)
Package Base: insight-toolkit
Description: Cross-platform system that provides developers with an extensive suite of software tools for image analysis
Upstream URL: http://www.itk.org/
Licenses: Apache
Submitter: joelsc
Maintainer: crmullins
Last Packager: crmullins
Votes: 37
Popularity: 0.58
First Submitted: 2008-11-16 19:36
Last Updated: 2021-10-24 21:43

Dependencies (22)

Sources (1)

Latest Comments

1 2 3 4 5 6 Next › Last »

entshuld commented on 2022-01-27 03:25

I have some amendments to share

  • 1. Allow Python wrappers independent of locale.
  • 2. ```makepkg -C``` exists to clean if the user so wishes
  • 3. use pkgname and pkgver instead of InsightToolkit

--- a/PKGBUILD
+++ b/PKGBUILD
@@ -23,19 +23,56 @@ optdepends=('python2: build python wrapping'
             'clang: for swig'
        'castxml-git: for ITK')
 makedepends=('cmake' 'git')
-source=("https://github.com/InsightSoftwareConsortium/ITK/releases/download/v${pkgver}/InsightToolkit-${pkgver}.tar.gz")
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/InsightSoftwareConsortium/ITK/releases/download/v${pkgver}/InsightToolkit-${pkgver}.tar.gz")
 sha512sums=('6786e39cdf3d0c3a31abd1e23481e30f6dc9dac189ffe372dde3db688f2f57686a8beb321778327e1ff683ed844d41f1dee937b0ba542b2365e2195dfca398c7')
+provides=(python-itk=${pkgver})
+conflicts=(python-itk)
+options=(!emptydirs)

-_usepython=false
+safe_flags="-Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS"
+safe_flags+=" -fcf-protection -fno-plt"
+safe_flags+=" -fstack-clash-protection -Wformat"
+safe_flags+=" -Werror=format-security"
+generic_flags="-pipe -fno-plt -fPIC -fopenmp"
+generic_flags+=" -march=native"
+generic_flags+=" -mtune=native ${safe_flags}"
+opt_flags="${generic_flags} -O3"
+generic_flags="${generic_flags} -O2"
+
+export COPTFLAGS="${opt_flags}"
+export CXXOPTFLAGS="$COPTFLAGS"
+export FOPTFLAGS="$COPTFLAGS"
+export CPPFLAGS="$generic_flags"
+export CXXFLAGS="$CPPFLAGS"
+export CFLAGS="$generic_flags"
+export FFLAGS="$generic_flags"
+export FCFLAGS="$generic_flags"
+export F90FLAGS="$generic_flags"
+export F77FLAGS="$generic_flags"
+
+export LANG=C
+export OMPI_MCA_opal_cuda_support=0
+export OMPI_MCA_mpi_oversubscribe=0
+
+_usepython=true
+# https://github.com/InsightSoftwareConsortium/ITK/search?q=typeinfo&type=issues
+# https://insightsoftwareconsortium.atlassian.net/browse/ITK-3538?focusedCommentId=27765&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-27765
+# from here: https://github.com/InsightSoftwareConsortium/ITK/issues/1701#issuecomment-598311460
+export LC_ALL=C LANG=C LANGUAGE=C
+
+prepare() {
+  cd "$srcdir"
+  [[ -d InsightToolkit-"${pkgver}" ]] &&
+    mv InsightToolkit-"${pkgver}" "${pkgname}"-"${pkgver}"
+}

 build() {
   cd "$srcdir"
-  rm -rf build
-  mkdir build
-  cd build

-  cmake \
+  cmake -S "${srcdir}/${pkgname}-${pkgver}" \
+    -B "${srcdir}/${pkgname}-${pkgver}"/build \
     -DCMAKE_BUILD_TYPE:STRING=Release \
+    -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF \
     -DBUILD_TESTING:BOOL=OFF \
     -DBUILD_EXAMPLES:BOOL=OFF \
     -DBUILD_SHARED_LIBS:BOOL=ON \
@@ -56,16 +93,25 @@ build() {
     -DITK_USE_SYSTEM_EXPAT:BOOL=ON \
     -DITK_USE_SYSTEM_FFTW:BOOL=ON \
     -DITK_USE_SYSTEM_HDF5:BOOL=ON \
+    -DITK_USE_64BITS_IDS:BOOL=ON \
+    -DITK_LEGACY_REMOVE:BOOL=ON \
     -DModule_ITKIOMINC:BOOL=ON \
     -DModule_ITKIOTransformMINC:BOOL=ON \
-    -DModule_SimpleITKFilters:BOOL=ON \
-    ../InsightToolkit-${pkgver}
+    -DModule_SimpleITKFilters:BOOL=ON

-  make
+  # 4: to your liking
+  make -j4 -s -C "${srcdir}/${pkgname}-${pkgver}"/build
 }

 package() {
-  cd "$srcdir"/build
+  cd "${srcdir}/${pkgname}-${pkgver}"/build
+
+  make -C "${srcdir}"/"${pkgname}-${pkgver}"/build DESTDIR="${pkgdir}" install

-  make DESTDIR="${pkgdir}" install
+  # Based on AUR's itk-git package
+  # (quick fix for https://github.com/InsightSoftwareConsortium/ITK/issues/2960)
+  install -dm755 "${pkgdir}"/usr/lib
+  _pyver=$(python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))')
+  find "${pkgdir}" -type d -name "python${_pyver}" -print0 -quit | xargs -0 mv -vt "${pkgdir}/usr/lib"
+  python -O -m compileall "${pkgdir}/usr/lib"
 }

hottea commented on 2022-01-01 06:26

@m-pilia @crmullins Maybe merge insight-toolkit, itk, and python-itk, and keep only itk and python-itk? I currently maintain itk-git and python-itk-git here.

m-pilia commented on 2021-12-31 13:17

Hi @crmullins! I was wondering if we could improve a bit the Python distribution of ITK.

The current situation is: the Python wheels can be built from your PKGBUILD but are disabled by default and require manual intervention. There is also a separate package for the Python part only (python-itk, that I maintain) but it does not make sense to build the wheels separately from insight-toolkit, since it is a lot of duplicated build time. (context in this comment).

The best solution would be to turn insight-toolkit into a split package, so that it is possible to build both insight-toolkit and python-itk from the same PKGBUILD.

Hottea has kindly created a split PKGBUILD here. Could you consider updating this package to use Hottea's approach? (pushing the split package will require to delete python-itk first: feel free to nominate my package for deletion because of this reason).

buzo commented on 2021-06-17 13:18

Please add git to makedepends, otherwise it does not build (in a https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot).

MartinDiehl commented on 2021-04-10 12:07

could you please change the dependency from 'hdf5-cpp-fortran' to 'hdf5'? The special cpp/fortran versions doe not exist anymore.

m-pilia commented on 2021-04-03 21:47

Hi! Could you please add the SimpleITKFilters module to the package (CMake command line flag -DModule_SimpleITKFilters:BOOL=ON)? It is required to build simpleitk version >=2.0.

liamtimms commented on 2019-10-02 21:34

Hi, it would be great if you could add the Generic Label Interpolator flag to the build process: https://itk.org/Doxygen/html/group__GenericLabelInterpolator.html

This is necessary for ITK to be used by ANTs: https://github.com/ANTsX/ANTs/issues/817

crmullins commented on 2018-12-16 05:33

This should be fixed now that the GDCM package is updated to use 2.8.8. The issue was that before we were not using the system GDCM, so ITK was building the version bundled with it, which builds (and then tries to install) its own openjpeg2 -- ignoring the ITK_USE_SYSTEM_JPEG and GDCM_USE_SYSTEM_OPENJPEG config variables. Please reach out if you have any other issues.

flipmess commented on 2018-12-14 20:32

hi, i get this error after build.

(1/1) checking for file conflicts [############################################################################] 100% error: failed to commit transaction (conflicting files) insight-toolkit: /usr/lib/pkgconfig/libopenjp2.pc exists in filesystem (owned by openjpeg2) Errors occurred, no packages were upgraded.

geosam commented on 2018-07-30 22:21

Fix the GCC 8: https://gist.github.com/samtux/b7cf81b208671425589508d2c1978bfe