unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#56638] [PATCH] gnu: Add asli.
@ 2022-07-19  7:59 Paul A. Patience
  2022-07-19  8:10 ` Paul A. Patience
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Paul A. Patience @ 2022-07-19  7:59 UTC (permalink / raw)
  To: 56638; +Cc: Paul A. Patience

* gnu/packages/graphics.scm (asli): New variable.
---
 gnu/packages/graphics.scm | 67 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index c193be1efb..bae1ba1f99 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -31,6 +31,7 @@
 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
+;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2120,3 +2121,69 @@ (define-public azpainter
 @end itemize
 ")
     (license license:gpl3+)))
+
+(define-public asli
+  (package
+    (name "asli")
+    (version "0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tpms-lattice/ASLI")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "02hwdavpsy3vmivd6prp03jn004ykrl11lbkvksy5i2zm38zbknr"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Remove bundled libraries except ALGLIB, TetGen and yaml-cpp, which
+        ;; are statically linked, and KU Leuven's mTT, which is an obscure
+        ;; (i.e., unfindable by searching online for “mTT KU Leuven”), BSD-3
+        ;; licensed, header-only library.
+        ;;
+        ;; AdaptTools and mmg are missing from Guix, but anyway they are
+        ;; unused because mmg support is disabled (-DMMG_MESH=OFF).
+        #~(begin
+            (delete-file-recursively "libs/AdaptTools")
+            (delete-file-recursively "libs/CGAL")
+            (delete-file-recursively "libs/eigen")
+            (delete-file-recursively "libs/mmg")))))
+    (build-system cmake-build-system)
+    (native-inputs
+     ;; Header-only library
+     (list cgal))
+    (inputs
+     (list boost
+           eigen
+           gmp
+           mpfr
+           tbb-2020))
+    (arguments
+     (list #:tests? #f                  ; No tests
+           #:configure-flags
+           #~(list "-DCGAL_ACTIVATE_CONCURRENT_MESH_3=ON"
+                   "-DMMG_MESH=OFF"     ; Build fails when enabled (the default)
+                   (string-append "-DEIGEN3_INCLUDE_DIR="
+                                  #$(this-package-input "eigen")
+                                  "/include/eigen3"))
+           #:phases
+           #~(modify-phases %standard-phases
+               (replace 'install        ; No install phase
+                 (lambda _
+                   (with-directory-excursion "../source/bin"
+                     (install-file "ASLI" (string-append #$output "/bin"))
+                     ;; The manual is included in the repository.
+                     ;; Building it requires -DASLI_DOC=ON, but this is marked
+                     ;; as unsupported (presumably for users).
+                     (install-file "docs/ASLI [User Manual].pdf"
+                                   (string-append #$output "/share/doc/"
+                                                  #$name "-" #$version))))))))
+    (home-page "http://www.biomech.ulg.ac.be/ASLI/")
+    (synopsis "Create lattice infills with varying unit cell type, size and feature")
+    (description "ASLI (A Simple Lattice Infiller) is a command-line tool that
+allows users to fill any 3D geometry with a functionally graded lattice.  The
+lattice infill is constructed out of unit cells, described by implicit
+functions, whose type, size and feature can be varied locally to obtain the
+desired local properties.")
+    (license license:agpl3+)))
--
2.37.0






^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH] gnu: Add asli.
  2022-07-19  7:59 [bug#56638] [PATCH] gnu: Add asli Paul A. Patience
@ 2022-07-19  8:10 ` Paul A. Patience
  2022-07-19 14:21   ` Ludovic Courtès
  2022-07-19 14:32 ` Maxime Devos
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Paul A. Patience @ 2022-07-19  8:10 UTC (permalink / raw)
  To: 56638


Hi Ludovic,

ASLI optionally depends on mmg, which I discovered a Guix package for in
the Guix HPC project [1], and for which you seem to be the point of
contact.
I'd like to add mmg to Guix, first to eventually be able to drop ASLI's
bundled version (although I can't get ASLI to build with mmg yet) and
second because I have looked into mmg recently and may want to use it
myself.

Is it just a question of moving the package over to Guix verbatim?
I tried that and it compiled correctly.

Thanks,
Paul

[1]: https://gitlab.inria.fr/guix-hpc/guix-hpc/-/blob/master/inria/mmg.scm





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH] gnu: Add asli.
  2022-07-19  8:10 ` Paul A. Patience
@ 2022-07-19 14:21   ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2022-07-19 14:21 UTC (permalink / raw)
  To: Paul A. Patience; +Cc: 56638

Hello,

"Paul A. Patience" <paul@apatience.com> skribis:

> ASLI optionally depends on mmg, which I discovered a Guix package for in
> the Guix HPC project [1], and for which you seem to be the point of
> contact.

Right!

> I'd like to add mmg to Guix, first to eventually be able to drop ASLI's
> bundled version (although I can't get ASLI to build with mmg yet) and
> second because I have looked into mmg recently and may want to use it
> myself.

Makes sense to me.

> Is it just a question of moving the package over to Guix verbatim?
> I tried that and it compiled correctly.

Sure, I guess you can copy it verbatim, tweaking the description
(removing “open source”, fixing the first sentence.)

TIA!

Ludo’.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH] gnu: Add asli.
  2022-07-19  7:59 [bug#56638] [PATCH] gnu: Add asli Paul A. Patience
  2022-07-19  8:10 ` Paul A. Patience
@ 2022-07-19 14:32 ` Maxime Devos
  2022-07-19 14:34 ` Maxime Devos
  2022-07-24 12:02 ` [bug#56638] [PATCH v2 0/2] " Paul A. Patience
  3 siblings, 0 replies; 9+ messages in thread
From: Maxime Devos @ 2022-07-19 14:32 UTC (permalink / raw)
  To: Paul A. Patience, 56638

Paul A. Patience schreef op di 19-07-2022 om 07:59 [+0000]:
> +    (native-inputs
> +     ;; Header-only library
> +     (list cgal))

Being header-only makes no difference w.r.t. cross-compilation (and
hence, inputs/native-inputs).  For examples, headers can potentially
contain architecture-specific code (generated at the compile time of
the cgal library).  As such, this may need to be in 'inputs' instead of
'native-inputs'.

Another reason: this should be in 'inputs', otherwise when cross-
compiling it will end in in (IIUC) C_INCLUDE_PATH instead of
CROSS_C_INLUDE_PATH, whereas the cross-compiler will look in
CROSS_C_INCLUDE_PATH and not C_INCLUDE_PATH.

Greetings,
Maxime.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH] gnu: Add asli.
  2022-07-19  7:59 [bug#56638] [PATCH] gnu: Add asli Paul A. Patience
  2022-07-19  8:10 ` Paul A. Patience
  2022-07-19 14:32 ` Maxime Devos
@ 2022-07-19 14:34 ` Maxime Devos
  2022-07-24 12:02 ` [bug#56638] [PATCH v2 0/2] " Paul A. Patience
  3 siblings, 0 replies; 9+ messages in thread
From: Maxime Devos @ 2022-07-19 14:34 UTC (permalink / raw)
  To: Paul A. Patience, 56638

Paul A. Patience schreef op di 19-07-2022 om 07:59 [+0000]:
> +        ;; Remove bundled libraries except ALGLIB, TetGen and yaml-
> cpp, which
> +        ;; are statically linked,

What does it matter that they are statically linked w.r.t. bundling?
Those seem orthogonal concerns to me.  We can easily define a static
variant of alglib etc, or alternatively (probably more difficult but
feasible) tweak the build process of asli to look for shared libraries
instead of static libraries.

Greetings,
Maxime.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH v2 0/2] gnu: Add asli.
  2022-07-19  7:59 [bug#56638] [PATCH] gnu: Add asli Paul A. Patience
                   ` (2 preceding siblings ...)
  2022-07-19 14:34 ` Maxime Devos
@ 2022-07-24 12:02 ` Paul A. Patience
  2022-07-24 12:02   ` [bug#56638] [PATCH v2 1/2] gnu: Add mmg Paul A. Patience
  2022-07-24 12:02   ` [bug#56638] [PATCH v2 2/2] gnu: Add asli Paul A. Patience
  3 siblings, 2 replies; 9+ messages in thread
From: Paul A. Patience @ 2022-07-24 12:02 UTC (permalink / raw)
  To: 56638; +Cc: Paul A. Patience

I've fixed the issues raised by Maxime Devos and also added the mmg package
(and fixed the build of ASLI with mmg).

The mmg package originally began as Guix HPC's mmg package [1], but I ended up
completely rewriting it (well, except for the source section).

[1]: https://gitlab.inria.fr/guix-hpc/guix-hpc/-/blob/master/inria/mmg.scm

Paul A. Patience (2):
  gnu: Add mmg.
  gnu: Add asli.

 gnu/local.mk                                  |   1 +
 gnu/packages/graphics.scm                     | 178 ++++++++++++++++++
 .../patches/asli-use-system-libs.patch        |  70 +++++++
 3 files changed, 249 insertions(+)
 create mode 100644 gnu/packages/patches/asli-use-system-libs.patch

--
2.37.0






^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH v2 1/2] gnu: Add mmg.
  2022-07-24 12:02 ` [bug#56638] [PATCH v2 0/2] " Paul A. Patience
@ 2022-07-24 12:02   ` Paul A. Patience
  2022-07-24 12:02   ` [bug#56638] [PATCH v2 2/2] gnu: Add asli Paul A. Patience
  1 sibling, 0 replies; 9+ messages in thread
From: Paul A. Patience @ 2022-07-24 12:02 UTC (permalink / raw)
  To: 56638; +Cc: Paul A. Patience

* gnu/packages/graphics.scm (mmg): New variable.
---
 gnu/packages/graphics.scm | 104 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index c193be1efb..7417fbe690 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -31,6 +31,7 @@
 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
+;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2120,3 +2121,106 @@ (define-public azpainter
 @end itemize
 ")
     (license license:gpl3+)))
+
+(define-public mmg
+  (package
+    (name "mmg")
+    (version "5.6.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/MmgTools/mmg")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "173biz5skbwg27i5w6layg7mydjzv3rmi1ywhra4rx9rjf5c0cc5"))))
+    (build-system cmake-build-system)
+    (outputs '("out" "lib" "doc"))
+    (arguments
+     (list #:configure-flags
+           #~(list (string-append "-DCMAKE_INSTALL_PREFIX=" #$output:lib)
+                   (string-append "-DCMAKE_INSTALL_RPATH=" #$output:lib "/lib")
+                   ;; The build doesn't honor -DCMAKE_INSTALL_BINDIR, hence
+                   ;; the adjust-bindir phase.
+                   ;;(string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin")
+                   "-DBUILD_SHARED_LIBS=ON"
+                   "-DBUILD_TESTING=ON"
+                   ;; The longer tests are for continuous integration and
+                   ;; depend on input data which must be downloaded.
+                   "-DONLY_VERY_SHORT_TESTS=ON"
+                   ;; TODO: Add Elas (from
+                   ;; https://github.com/ISCDtoolbox/LinearElasticity).
+                   "-DUSE_ELAS=OFF"
+                   ;; TODO: Figure out how to add VTK to inputs without
+                   ;; causing linking errors in ASLI of the form:
+                   ;;
+                   ;;   ld: /gnu/store/…-vtk-9.0.1/lib/libvtkWrappingPythonCore-9.0.so.1:
+                   ;;     undefined reference to `PyUnicode_InternFromString'
+                   ;;
+                   ;; Also, adding VTK to inputs requires adding these as well:
+                   ;;
+                   ;;   double-conversion eigen expat freetype gl2ps glew hdf5
+                   ;;   jsoncpp libjpeg-turbo libpng libtheora libtiff libx11
+                   ;;   libxml2 lz4 netcdf proj python sqlite zlib
+                   "-DUSE_VTK=OFF")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'build 'build-doc
+                 (lambda _
+                   ;; Fontconfig wants to write to a cache directory.
+                   (setenv "HOME" "/tmp")
+                   (invoke "make" "doc")))
+               (add-after 'install 'install-doc
+                 (lambda _
+                   (copy-recursively
+                    "../source/doc/man" (string-append #$output
+                                                       "/share/man/man1"))
+                   (copy-recursively
+                    "doc" (string-append #$output:doc "/share/doc/"
+                                         #$name "-" #$version))))
+               (add-after 'install 'adjust-bindir
+                 (lambda _
+                   (let ((src (string-append #$output:lib "/bin"))
+                         (dst (string-append #$output "/bin")))
+                     (copy-recursively src dst)
+                     (delete-file-recursively src))))
+               ;; Suffixing program names with build information, i.e.,
+               ;; optimization flags and whether debug symbols were generated,
+               ;; is unusual and fragilizes scripts calling these programs.
+               (add-after 'adjust-bindir 'fix-program-names
+                 (lambda _
+                   (with-directory-excursion (string-append #$output "/bin")
+                     (rename-file "mmg2d_O3d" "mmg2d")
+                     (rename-file "mmg3d_O3d" "mmg3d")
+                     (rename-file "mmgs_O3d" "mmgs")))))))
+    (native-inputs
+     ;; For the documentation
+     (list doxygen graphviz
+           ;; TODO: Fix failing LaTeX invocation (which results in equations
+           ;; being inserted literally into PNGs rather than being typeset).
+           ;;texlive-tiny
+           ))
+    (inputs
+     (list scotch))
+    (home-page "http://www.mmgtools.org/")
+    (synopsis "Surface and volume remeshers")
+    (description "Mmg is a collection of applications and libraries for
+bidimensional and tridimensional surface and volume remeshing.  It consists
+of:
+
+@itemize
+@item the @code{mmg2d} application and library: mesh generation from a set of
+edges, adaptation and optimization of a bidimensional triangulation and
+isovalue discretization;
+
+@item the @code{mmgs} application and library: adaptation and optimization of
+a surface triangulation and isovalue discretization;
+
+@item the @code{mmg3d} application and library: adaptation and optimization of
+a tetrahedral mesh, isovalue discretization and Lagrangian movement;
+
+@item the @code{mmg} library gathering the @code{mmg2d}, @code{mmgs} and
+@code{mmg3d} libraries.
+@end itemize")
+    (license license:lgpl3+)))
--
2.37.0






^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH v2 2/2] gnu: Add asli.
  2022-07-24 12:02 ` [bug#56638] [PATCH v2 0/2] " Paul A. Patience
  2022-07-24 12:02   ` [bug#56638] [PATCH v2 1/2] gnu: Add mmg Paul A. Patience
@ 2022-07-24 12:02   ` Paul A. Patience
  2022-08-04 21:40     ` [bug#56638] [PATCH] " Ludovic Courtès
  1 sibling, 1 reply; 9+ messages in thread
From: Paul A. Patience @ 2022-07-24 12:02 UTC (permalink / raw)
  To: 56638; +Cc: Paul A. Patience

* gnu/packages/graphics.scm (asli): New variable.
* gnu/packages/patches/asli-use-system-libs.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/graphics.scm                     | 74 +++++++++++++++++++
 .../patches/asli-use-system-libs.patch        | 70 ++++++++++++++++++
 3 files changed, 145 insertions(+)
 create mode 100644 gnu/packages/patches/asli-use-system-libs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 412d512775..75ca3e6a29 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -858,6 +858,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch	\
   %D%/packages/patches/apr-skip-getservbyname-test.patch	\
   %D%/packages/patches/ark-skip-xar-test.patch			\
+  %D%/packages/patches/asli-use-system-libs.patch		\
   %D%/packages/patches/aspell-default-dict-dir.patch		\
   %D%/packages/patches/ath9k-htc-firmware-binutils.patch	\
   %D%/packages/patches/ath9k-htc-firmware-gcc.patch		\
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 7417fbe690..d3a11824b4 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -2224,3 +2224,77 @@ (define-public mmg
 @code{mmg3d} libraries.
 @end itemize")
     (license license:lgpl3+)))
+
+(define-public asli
+  (package
+    (name "asli")
+    (version "0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tpms-lattice/ASLI")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "02hwdavpsy3vmivd6prp03jn004ykrl11lbkvksy5i2zm38zbknr"))
+       (patches (search-patches "asli-use-system-libs.patch"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Remove bundled libraries except (the ones missing from Guix and)
+        ;; KU Leuven's mTT, which is an obscure (i.e., unfindable by searching
+        ;; online for “mTT KU Leuven”), BSD-3 licensed, header-only library.
+        #~(begin
+            ;;(delete-file-recursively "libs/AdaptTools") ; Missing from Guix
+            (delete-file-recursively "libs/CGAL")
+            ;;(delete-file-recursively "libs/alglib") ; Missing from Guix
+            (delete-file-recursively "libs/eigen")
+            (delete-file-recursively "libs/mmg")
+            ;;(delete-file-recursively "libs/tetgen") ; Missing from Guix
+            (delete-file-recursively "libs/yaml")))))
+    (build-system cmake-build-system)
+    (inputs
+     (list boost
+           cgal
+           eigen
+           gmp
+           `(,mmg "lib")
+           mpfr
+           tbb-2020
+           yaml-cpp))
+    (arguments
+     (list #:tests? #f                  ; No tests
+           #:configure-flags
+           #~(list "-DCGAL_ACTIVATE_CONCURRENT_MESH_3=ON"
+                   (string-append "-DEIGEN3_INCLUDE_DIR="
+                                  #$(this-package-input "eigen")
+                                  "/include/eigen3")
+                   (string-append "-DMMG_INCLUDE_DIR="
+                                  (ungexp (this-package-input "mmg") "lib")
+                                  "/include")
+                   (string-append "-DMMG_LIBRARY_DIR="
+                                  (ungexp (this-package-input "mmg") "lib")
+                                  "/lib"))
+           #:phases
+           #~(modify-phases %standard-phases
+               (replace 'install        ; No install phase
+                 (lambda _
+                   (with-directory-excursion "../source/bin"
+                     (install-file "ASLI" (string-append #$output "/bin"))
+                     ;; The manual is included in the repository.
+                     ;; Building it requires -DASLI_DOC=ON, but this is marked
+                     ;; as unsupported (presumably for users).
+                     ;; Besides, some of the LaTeX packages it uses are
+                     ;; missing from Guix, for example emptypage, fvextra and
+                     ;; menukeys.
+                     (install-file "docs/ASLI [User Manual].pdf"
+                                   (string-append #$output "/share/doc/"
+                                                  #$name "-" #$version))))))))
+    (home-page "http://www.biomech.ulg.ac.be/ASLI/")
+    (synopsis "Create lattice infills with varying unit cell type, size and feature")
+    (description "ASLI (A Simple Lattice Infiller) is a command-line tool that
+allows users to fill any 3D geometry with a functionally graded lattice.  The
+lattice infill is constructed out of unit cells, described by implicit
+functions, whose type, size and feature can be varied locally to obtain the
+desired local properties.")
+    (license license:agpl3+)))
diff --git a/gnu/packages/patches/asli-use-system-libs.patch b/gnu/packages/patches/asli-use-system-libs.patch
new file mode 100644
index 0000000000..d8234fd608
--- /dev/null
+++ b/gnu/packages/patches/asli-use-system-libs.patch
@@ -0,0 +1,70 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b11c5ba..702423e 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -122,28 +122,8 @@ if(MMG_MESH)
+   add_definitions(-DMMG_MESH)
+
+   # MMG
+-  set(MMG_PREFIX mmg3d)
+-  set(MMG_PREFIX_DIR ${CMAKE_CURRENT_BINARY_DIR}/${MMG_PREFIX})
+-  set(MMG_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${MMG_PREFIX})
+-  ExternalProject_Add(${MMG_PREFIX}
+-    PREFIX       ${MMG_PREFIX_DIR}
+-    SOURCE_DIR   ${CMAKE_CURRENT_SOURCE_DIR}/libs/mmg
+-
+-    BUILD_ALWAYS OFF
+-    INSTALL_DIR  ${MMG_INSTALL_DIR}
+-
+-    CMAKE_ARGS(-DCMAKE_BUILD_TYPE=Release -DBUILD=MMG3D -DLIBMMG3D_STATIC=ON
+-               -DLIBMMG3D_SHARED=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>)
+-
+-    BUILD_COMMAND   make
+-    INSTALL_COMMAND make install
+-  )
+-  set(MMG3D_INCLUDE_DIRS "${MMG_INSTALL_DIR}/include")
+-  set(MMG3D_LIBRARIES "${MMG_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${MMG_PREFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+-
+-  include_directories(${MMG3D_INCLUDE_DIRS})
+-  #add_library(MMG3D STATIC IMPORTED)
+-  #set_target_properties(MMG3D PROPERTIES IMPORTED_LOCATION "${MMG3D_LIBRARIES}")
++  include_directories(${MMG_INCLUDE_DIR})
++  set(MMG3D_LIBRARIES ${MMG_LIBRARY_DIR}/libmmg3d.so)
+
+   # MshMet
+   set(MSHMET_PREFIX mshmet)
+@@ -192,14 +172,8 @@ target_include_directories(tet PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libs/tetgen)
+ target_compile_definitions(tet PUBLIC TETLIBRARY) # -DTETLIBRARY: flag to compile tetgen as a library
+
+ # yaml
+-file(GLOB yaml_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libs/yaml/src/*.cpp) # Using file GLOB is not recomended!
+-add_library(yaml STATIC)
+-target_include_directories(yaml
+-  PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libs/yaml/include
+-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libs/yaml/src
+-)
+-target_sources(yaml PRIVATE ${yaml_SRC})
+-set_target_properties(yaml PROPERTIES CXX_STANDARD 11)
++find_package(yaml-cpp REQUIRED)
++include_directories(${YAML_CPP_INCLUDE_DIRS})
+
+ # Compile options for debuging
+ if(CMAKE_BUILD_TYPE MATCHES Debug)
+@@ -259,7 +233,7 @@ if(MARCH_NATIVE)
+ endif()
+
+ # Create entries for C++ files in "ASLI" routine
+-target_link_libraries(ASLI PUBLIC alg tet yaml)
++target_link_libraries(ASLI PUBLIC alg tet ${YAML_CPP_LIBRARIES})
+ if(NOT MSVC)
+   target_link_libraries(ASLI PUBLIC stdc++fs)
+ endif()
+@@ -272,7 +246,7 @@ if(CGAL_MESH)
+ endif()
+
+ if(MMG_MESH)
+-  add_dependencies(ASLI ${MMG_PREFIX} ${MSHMET_PREFIX})
++  add_dependencies(ASLI ${MSHMET_PREFIX})
+   target_link_libraries(ASLI PUBLIC ${MMG3D_LIBRARIES} ${MSHMET_LIBRARIES})
+   if(SCOTCH_FOUND)
+     target_link_libraries(ASLI PUBLIC ${SCOTCH_LIBRARIES} scotch)
--
2.37.0






^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#56638] [PATCH] gnu: Add asli.
  2022-07-24 12:02   ` [bug#56638] [PATCH v2 2/2] gnu: Add asli Paul A. Patience
@ 2022-08-04 21:40     ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2022-08-04 21:40 UTC (permalink / raw)
  To: Paul A. Patience; +Cc: 56638

Hi Paul,

"Paul A. Patience" <paul@apatience.com> skribis:

> * gnu/packages/graphics.scm (asli): New variable.
> * gnu/packages/patches/asli-use-system-libs.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register patch.

The source derivation fails to build for me:

--8<---------------cut here---------------start------------->8---
File CMakeLists.txt is read-only; trying to patch anyway
patching file CMakeLists.txt
Hunk #2 FAILED at 172.
Hunk #3 succeeded at 240 (offset 1 line).
Hunk #4 succeeded at 253 (offset 1 line).
1 out of 4 hunks FAILED -- saving rejects to file CMakeLists.txt.rej
--8<---------------cut here---------------end--------------->8---

> diff --git a/gnu/packages/patches/asli-use-system-libs.patch b/gnu/packages/patches/asli-use-system-libs.patch
> new file mode 100644
> index 0000000000..d8234fd608
> --- /dev/null
> +++ b/gnu/packages/patches/asli-use-system-libs.patch
> @@ -0,0 +1,70 @@
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index b11c5ba..702423e 100755

Also, as suggested by ‘guix lint’, please add a comment at the top
stating what this does and what the upstream status is (if it’s been
submitted), at least something like:

  Tweak build system to use system dependencies instead of those that
  are bundled.

Could you please send an updated patch?

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-08-04 21:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19  7:59 [bug#56638] [PATCH] gnu: Add asli Paul A. Patience
2022-07-19  8:10 ` Paul A. Patience
2022-07-19 14:21   ` Ludovic Courtès
2022-07-19 14:32 ` Maxime Devos
2022-07-19 14:34 ` Maxime Devos
2022-07-24 12:02 ` [bug#56638] [PATCH v2 0/2] " Paul A. Patience
2022-07-24 12:02   ` [bug#56638] [PATCH v2 1/2] gnu: Add mmg Paul A. Patience
2022-07-24 12:02   ` [bug#56638] [PATCH v2 2/2] gnu: Add asli Paul A. Patience
2022-08-04 21:40     ` [bug#56638] [PATCH] " Ludovic Courtès

Code repositories for project(s) associated with this inbox:

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).