unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: othacehe@gnu.org, 52124-done@debbugs.gnu.org,
	Pierre-Antoine Bouttier
	<pierre-antoine.bouttier@univ-grenoble-alpes.fr>
Subject: bug#52124: [PATCH 0/1] Add n2p2-lib
Date: Thu, 05 May 2022 23:28:37 +0200	[thread overview]
Message-ID: <87wnez654q.fsf_-_@gnu.org> (raw)
In-Reply-To: <20211206152422.121776-1-zimon.toutoune@gmail.com> (zimoun's message of "Mon, 6 Dec 2021 16:24:22 +0100")

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

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> From: Pierre-Antoine Bouttier <pierre-antoine.bouttier@univ-grenoble-alpes.fr>
>
> * gnu/packages/maths.scm (n2p2-lib): New variable.

The ‘install’ phase was not installing anything, so I had to adjust it.
I also fixed a couple of other issues—patch below.

Finally applied, thanks!

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2742 bytes --]

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 613b52f5aa..efa453659c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1855,7 +1855,7 @@ (define-public netcdf-fortran
 
 (define-public n2p2-lib
   (package
-    (name "n2p2-lib")
+    (name "n2p2")
     (version "2.1.4")
     (source (origin
               (method git-fetch)
@@ -1879,8 +1879,13 @@ (define-public n2p2-lib
                                (assoc-ref inputs "eigen") "/include/eigen3")))
              (substitute* "src/makefile.gnu"
                (("-lblas")
-                (string-append "-L"
-                               (assoc-ref inputs "openblas") "/lib -lopenblas")))))
+                (string-append "-L" (assoc-ref inputs "openblas")
+                               "/lib -lopenblas"))
+               (("-march=native")
+                ""))
+             (substitute* "src/application/makefile"
+               (("LDFLAGS=")
+                "LDFLAGS=-Wl,-rpath='$$ORIGIN/../lib' "))))
          (delete 'configure)
          (delete 'check)
          (replace 'install
@@ -1889,23 +1894,23 @@ (define-public n2p2-lib
                     (bindir (string-append out "/bin"))
                     (libdir (string-append out "/lib"))
                     (incdir (string-append out "/include")))
+               (for-each (lambda (f) (install-file f bindir))
+                         (find-files "bin" "^nnp-"))
                (for-each (lambda (f) (install-file f libdir))
-                         (find-files "../lib/" "."))
+                         (find-files "lib" "\\.so$"))
                (for-each (lambda (f) (install-file f incdir))
-                         (find-files "../include/" "."))))))))
+                         (find-files "include" "\\.h$"))))))))
     (inputs
-     `(("openmpi" ,openmpi)
-       ("gsl" ,gsl)
-       ("openblas" ,openblas)
-       ("eigen" ,eigen)))
+     (list openmpi gsl openblas eigen))
     (synopsis "Neural network potentials for chemistry and physics")
     (description "This package contains software that will allow you to use
 existing neural network potential parameterizations to predict energies and
 forces (with standalone tools but also in conjunction with the MD software
-LAMMPS). In addition it is possible to train new neural network potentials
+LAMMPS).  In addition it is possible to train new neural network potentials
 with the provided training tools.")
-    (home-page "https://compphysvienna.github.io/n2p2")
-    (license license:gpl3)))
+    (home-page "https://compphysvienna.github.io/n2p2/")
+    (properties '((tunable? . #t)))        ;to benefit from SIMD code in Eigen
+    (license license:gpl3+)))
 
 (define-public nlopt
   (package

  parent reply	other threads:[~2022-05-05 21:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 13:08 [bug#52124] [PATCH 0/1] Add n2p2-lib zimoun
2021-12-02 14:46 ` Mathieu Othacehe
2021-12-02 15:54   ` zimoun
2021-12-06 15:24 ` [bug#52124] [PATCH] gnu: " zimoun
2022-05-03 12:38   ` [bug#52124] [PATCH 0/1] " zimoun
2022-05-05 21:28   ` Ludovic Courtès [this message]
2022-05-06  8:30     ` zimoun

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=87wnez654q.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=52124-done@debbugs.gnu.org \
    --cc=othacehe@gnu.org \
    --cc=pierre-antoine.bouttier@univ-grenoble-alpes.fr \
    --cc=zimon.toutoune@gmail.com \
    /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).