Commit d5b1bd7c authored by P-A Bouttier's avatar P-A Bouttier
Browse files

Change lammps package

parent 27b0a205
(define-module (common lammps)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build utils)
#:use-module (guix build-system cmake)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages image-processing)
#:use-module (gnu packages image)
#:use-module (gnu packages graphics)
#:use-module (gnu packages maths)
#:use-module (gnu packages mpi)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages compression)
#:use-module (gnu packages commencement)
#:use-module (gnu packages gcc)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages video)
#:use-module (gnu packages llvm)
#:use-module (gnu packages multiprecision))
(use-modules ((guix licenses) #:prefix license:)
(guix packages)
(guix download)
(guix utils)
(guix build utils)
(guix build-system cmake)
(guix build-system gnu)
(gnu packages)
(gnu packages algebra)
(gnu packages image-processing)
(gnu packages image)
(gnu packages graphics)
(gnu packages maths)
(gnu packages mpi)
(gnu packages python)
(gnu packages python-xyz)
(gnu packages compression)
(gnu packages commencement)
(gnu packages gcc)
(gnu packages pkg-config)
(gnu packages video)
(gnu packages llvm)
(gnu packages multiprecision))
(define-public n2p2-lib
(package
(name "n2p2-lib")
(version "2.1.4")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/CompPhysVienna/n2p2/archive/refs/tags/v" version ".tar.gz"))
(sha256
(base32
"1vql7awa9yq795bxkgq4izlzx83m8rz9f1k675znmlafmw4jqrzi"))))
(build-system gnu-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'post-unpack
(lambda* (#:key outputs inputs #:allow-other-keys)
(chdir "./src")
(substitute* "makefile.gnu"
(("PROJECT_EIGEN=/usr/include/eigen3")
(string-append "PROJECT_EIGEN="
(assoc-ref inputs "eigen") "/include/eigen3")))
(substitute* "makefile.gnu"
(("-lblas")
(string-append "-L"
(assoc-ref inputs "openblas") "/lib -lopenblas")))))
(delete 'configure)
(delete 'check)
(replace 'build
(lambda _
(invoke "make" "MODE=shared")))
(replace 'install
(lambda* (#:key outputs inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bindir (string-append out "/bin"))
(libdir (string-append out "/lib"))
(incdir (string-append out "/include")))
;;(copy-recursively "../bin" bindir)
;;(copy-recursively "../lib" libdir)
;(for-each (lambda (f) (install-file f bindir))
; (find-files "../bin/" "."))
(for-each (lambda (f) (install-file f libdir))
(find-files "../lib/" "."))
(for-each (lambda (f) (install-file f incdir))
(find-files "../include/" "."))
;;(let ((ld.so (string-append (assoc-ref inputs "glibc")
;; ,(glibc-dynamic-linker)))
;; (runpath (string-append (assoc-ref inputs "glibc")
;; "/lib:"
;;; (assoc-ref inputs "gcc:lib")
; "/lib:"
; (assoc-ref inputs "openmpi")
; "/lib:"
; (assoc-ref inputs "openblas")
; "/lib:"
; (assoc-ref inputs "gsl")
; "/lib:" libdir)))
; (define (candidate? file stat)
; (and (not (string-suffix? ".o" file)) ;exclude crt*.o
; (not (string-suffix? ".dbg" file))
; (elf-file? file)))
; (for-each (lambda (file)
; (invoke "patchelf" "--set-rpath" runpath file))
; (find-files out candidate?))
))))))
(inputs
`(("openmpi" ,openmpi)
("gsl" ,gsl)
("openblas" ,openblas)
("eigen" ,eigen)))
(synopsis "Classical molecular dynamics simulator")
(description "LAMMPS is a classical molecular dynamics simulator designed to run efficiently on parallel computers. LAMMPS has potentials for solid-state materials (metals, semiconductors), soft matter (biomolecules, polymers), and coarse-grained or mesoscopic systems. It can be used to model atoms or, more generically, as a parallel particle simulator at the atomic, meso, or continuum scale.")
(home-page "http://lammps.sandia.gov/")
(license license:gpl2+)))
(define-public lammps
(package
(name "lammps")
(version "stable_29Oct2020")
(version "patch_2Jul2021")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/lammps/lammps/archive/" version ".tar.gz"))
(uri (string-append "https://github.com/lammps/lammps/archive/refs/tags/" version ".tar.gz"))
(sha256
(base32
"09ip1h2p8sll4226cdk7nxv3rmvq1k62il07dsmddv8zdkhhb5vm"))))
"0mzagwvrk97pyqjlpqpb487887xffc5na5l70k00k26yvfi8rpag"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags
......@@ -42,14 +119,16 @@
"-DPKG_MOLECULE=yes"
"-DPKG_RIGID=yes"
"-DPKG_MISC=yes"
"-DPKG_USER-MEAMC=yes"
"-DPKG_USER-REAXC=yes"
"-DPKG_USER-RANN=yes"
"-DPKG_USER-PHONON=yes"
"-DPKG_USER-HDNNP=yes"
"-DPKG_USER-DPD=yes"
"-DPKG_USER-DIFFRACTION=yes"
"-DPKG_USER-EFF=yes"
"-DPKG_MEAM=yes"
"-DPKG_REAXFF=yes"
"-DPKG_ML-RANN=yes"
"-DPKG_PHONON=yes"
"-DPKG_ML-HDNNP=yes"
"-DDOWNLOAD_N2P2=no"
(string-append "-DN2P2_DIR=" (assoc-ref %build-inputs "n2p2-lib"))
"-DPKG_DPD-BASIC=yes"
"-DPKG_DIFFRACTION=yes"
"-DPKG_EFF=yes"
(string-append "-DCMAKE_INSTALL_PREFIX="
(assoc-ref %outputs "out")))
#:phases
......@@ -72,6 +151,7 @@
("libomp" ,libomp)
("zstd" ,zstd)
("fftw" ,fftw)
("n2p2-lib" ,n2p2-lib)
("openmpi" ,openmpi)
("ffmpeg" ,ffmpeg)
("libpng" ,libpng)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment