unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Paul A. Patience" <paul@apatience.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 56638@debbugs.gnu.org
Subject: [bug#56638] [PATCH] gnu: Add asli.
Date: Thu, 15 Sep 2022 13:37:08 +0000	[thread overview]
Message-ID: <87k064u5he.fsf@apatience.com> (raw)
In-Reply-To: <87pmfxvevb.fsf_-_@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]


Hi Ludo,

On 2022-09-14 17:13:28-04:00, Ludovic Courtès wrote:
> And I have:
>
> $ sha256sum gnu/packages/patches/asli-use-system-libs.patch
> 1a922b39a53b8cb0bd99e6c94e90769efaad88634b56d8df03811f68e45a003c  gnu/packages/patches/asli-use-system-libs.patch
>
> Am I missing something?

Thanks for the shasum; it allowed me to discover the problem.
There are trailing spaces in the original CMakeLists.txt, which also
appear in the patch.
When sending the patch inline, these spaces are trimmed.
(The spaces are highlighted in Magit, so I was aware of them, but I
didn't realize they would be trimmed somewhere in the email pipeline.)

I will attach the patch file separately, and also a tarred version just
in case.
So you can verify that you have the right one, here's my shasum:

--8<---------------cut here---------------start------------->8---
$ sha256sum gnu/packages/patches/asli-use-system-libs.patch
fb1531a4f71e95354af6927175f67b90f39250604aa6859d9def4778027f1810  gnu/packages/patches/asli-use-system-libs.patch
--8<---------------cut here---------------end--------------->8---

Best regards,
Paul


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: asli-use-system-libs.patch --]
[-- Type: text/x-patch; name=asli-use-system-libs.patch, Size: 2780 bytes --]

Adjust CMakeLists.txt to use system-provided mmg and yaml-cpp libraries.

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)

[-- Attachment #3: asli-use-system-libs.patch.tar --]
[-- Type: archive/tar, Size: 10240 bytes --]

  reply	other threads:[~2022-09-15 13:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-08-29 21:21     ` [bug#56638] [PATCH] gnu: Add asli Ludovic Courtès
2022-07-24 12:02   ` [bug#56638] [PATCH v2 2/2] " Paul A. Patience
2022-08-04 21:40     ` [bug#56638] [PATCH] " Ludovic Courtès
2022-08-29 21:21       ` Ludovic Courtès
2022-08-30 12:01         ` Paul A. Patience
2022-09-02 20:34 ` [bug#56638] [PATCH v3] " Paul A. Patience
2022-09-13 19:02   ` Paul A. Patience
2022-09-14 21:13   ` [bug#56638] [PATCH] " Ludovic Courtès
2022-09-15 13:37     ` Paul A. Patience [this message]
2023-06-20  0:39       ` Paul A. Patience
2023-09-08 17:16       ` bug#56638: " 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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87k064u5he.fsf@apatience.com \
    --to=paul@apatience.com \
    --cc=56638@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /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 public 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).