all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 62183@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludovic.courtes@inria.fr>
Subject: [bug#62183] [PATCH v2 2/2] gnu: vtk: Remove reference to GCC.
Date: Mon, 20 Mar 2023 23:09:56 +0100	[thread overview]
Message-ID: <20230320220956.13920-2-ludo@gnu.org> (raw)
In-Reply-To: <20230320220956.13920-1-ludo@gnu.org>

From: Ludovic Courtès <ludovic.courtes@inria.fr>

This removes GCC from the closure of VTK, reducing its size by 200 MiB (17%).

* gnu/packages/image-processing.scm (vtk)[arguments]: Change to gexps.
Add #:phases.
(vtk-7)[arguments]: Turn #:configure-flags into a gexp.
---
 gnu/packages/image-processing.scm | 87 +++++++++++++++++++------------
 1 file changed, 53 insertions(+), 34 deletions(-)

diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index c8786d8edd..7652b24e1a 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -352,40 +352,59 @@ (define-public vtk
     (properties `((release-monitoring-url . "https://vtk.org/download/")))
     (build-system cmake-build-system)
     (arguments
-     '(#:build-type "Release"           ;Build without '-g' to save space.
-       #:configure-flags '(;"-DBUILD_TESTING:BOOL=TRUE"
-                           ;    ; not honored
-                           "-DVTK_USE_EXTERNAL=OFF" ;; default
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
-                           ;"-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON"    ; breaks IO/CityGML
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
-                           "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"
-                           "-DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES" ; For F3D
-                           "-DVTK_WRAP_PYTHON=ON"
-                           "-DVTK_PYTHON_VERSION:STRING=3"
+     (list #:build-type "Release"           ;Build without '-g' to save space.
+           #:configure-flags
+           #~'( ;;"-DBUILD_TESTING:BOOL=TRUE"  ;not honored
+               "-DVTK_USE_EXTERNAL=OFF"           ;default
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
+               ;;"-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON" ;breaks IO/CityGML
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
+               "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"
+               "-DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES" ;for F3D
+               "-DVTK_WRAP_PYTHON=ON"
+               "-DVTK_PYTHON_VERSION:STRING=3"
 
-                           "-DVTK_SMP_ENABLE_OPENNMP=ON"
-                           "-DVTK_SMP_ENABLE_TBB=ON"
-                           "-DVTK_USE_MPI=ON"
-                           )
-       #:tests? #f))        ;XXX: test data not included
+               "-DVTK_SMP_ENABLE_OPENNMP=ON"
+               "-DVTK_SMP_ENABLE_TBB=ON"
+               "-DVTK_USE_MPI=ON"
+               )
+
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'clear-reference-to-compiler
+                 (lambda _
+                   (define (choose . files)
+                     (let loop ((files files))
+                       (if (null? files)
+                           #f
+                           (if (file-exists? (car files))
+                               (car files)
+                               (loop (cdr files))))))
+
+                   ;; Do not retain a reference to GCC.
+                   (substitute* (choose
+                                 "Common/Core/vtkConfigureDeprecated.h.in" ;v9.x
+                                 "Common/Core/vtkConfigure.h.in") ;v7.x
+                     (("@CMAKE_CXX_COMPILER@") "c++")))))
+
+           #:tests? #f))                          ;XXX: test data not included
     (inputs
      (list double-conversion
            eigen
@@ -453,7 +472,7 @@ (define-public vtk-7
        ((#:configure-flags flags)
         ;; Otherwise, the build would fail with: "error: invalid conversion
         ;; from ‘const char*’ to ‘char*’ [-fpermissive]".
-        `(cons "-DCMAKE_CXX_FLAGS=-fpermissive" ,flags))
+        #~(cons "-DCMAKE_CXX_FLAGS=-fpermissive" #$flags))
        ((#:phases phases)
         #~(modify-phases #$phases
             (add-after 'unpack 'remove-kernel-version
-- 
2.39.2





  reply	other threads:[~2023-03-20 22:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 11:04 [bug#62183] [PATCH 0/2] VTK packaging improvements for HPC Ludovic Courtès
2023-03-14 11:06 ` [bug#62183] [PATCH 1/2] gnu: vtk: Enable OpenMP, TBB, and Open MPI support Ludovic Courtès
2023-03-14 11:06   ` [bug#62183] [PATCH 2/2] gnu: vtk: Remove reference to GCC Ludovic Courtès
2023-03-20 22:09 ` [bug#62183] [PATCH v2 1/2] gnu: vtk: Enable OpenMP, TBB, and Open MPI support Ludovic Courtès
2023-03-20 22:09   ` Ludovic Courtès [this message]
2023-03-21 18:12     ` bug#62183: [PATCH 0/2] VTK packaging improvements for HPC Ludovic Courtès
2023-04-07 15:38     ` [bug#62183] [PATCH v2 2/2] gnu: vtk: Remove reference to GCC Simon Tournier
2023-04-17  8:17       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230320220956.13920-2-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=62183@debbugs.gnu.org \
    --cc=ludovic.courtes@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.