1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: Add python-pyscf.

* gnu/packages/chemistry.scm (python-pyscf): New variable.

Change-Id: I4e265c97644a6f8765c5d509de126de0312a3f98
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
David Elsing
2025-06-03 22:56:54 +02:00
committed by Sharlatan Hellseher
parent aa82bfff21
commit 2f1193181d

View File

@@ -38,6 +38,7 @@
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages c)
#:use-module (gnu packages cpp)
@@ -58,6 +59,7 @@
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-science)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
#:use-module (gnu packages serialization)
@@ -69,7 +71,9 @@
#:use-module (gnu packages xml)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python))
#:use-module (guix build-system pyproject)
#:use-module (guix build-system python)
#:use-module (srfi srfi-1))
;;; Please: Try to add new module packages in alphabetic order.
;;;
@@ -732,6 +736,77 @@ used to prepare publication-quality figures, to share interactive results with
your colleagues, or to generate pre-rendered animations.")
(license license:bsd-3)))
(define-public python-pyscf
(package
(name "python-pyscf")
(version "2.9.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/pyscf/pyscf")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "1lj48c749aqf9zd5xbshjsfr0y972r2nsm8lf3760jbfadg9jdsi"))))
(build-system pyproject-build-system)
(arguments
(list
#:modules
'((guix build pyproject-build-system)
(guix build utils)
(ice-9 textual-ports))
;; Some tests take a very long time and libxc support is not enabled.
#:tests? #f
#:phases
#~(modify-phases %standard-phases
(add-before 'build 'set-cmake-arguments
(lambda _
;; Copied from cmake-build-system. This is passed to 'cmake' in
;; setup.py.
(setenv "CMAKE_CONFIGURE_ARGS"
(string-join
`("-DCMAKE_BUILD_TYPE=RelWithDebInfo"
,(string-append "-DCMAKE_INSTALL_PREFIX=" #$output)
;; ensure that the libraries are installed into /lib
"-DCMAKE_INSTALL_LIBDIR=lib"
;; add input libraries to rpath
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
;; add (other) libraries of the project itself to rpath
,(string-append "-DCMAKE_INSTALL_RPATH=" #$output "/lib")
;; enable verbose output from builds
"-DCMAKE_VERBOSE_MAKEFILE=ON"
"-DENABLE_LIBXC=OFF"
"-DBUILD_LIBXC=OFF"
"-DBUILD_XCFUN=OFF"
"-DBUILD_LIBCINT=OFF"))))))))
(native-inputs
(list cmake-minimal
python-setuptools
python-wheel))
(inputs
(list
;; Use qcint when tuning for x86_64.
(if (and (assq 'cpu-tuning (package-properties this-package))
(target-x86-64?))
qcint
libcint)
xcfun
openblas))
(propagated-inputs
(list python-numpy
python-scipy
python-h5py))
(home-page "https://github.com/pyscf/pyscf")
(synopsis "Python library for quantum chemistry calculations")
(description
"@code{PySCF} (Python-based Simulations of Chemistry Framework) is a
Python library for quantum chemistry calculations and method development.
Most of the functionality is implemented in Python, while computationally
critical parts are implemented in C.")
(properties '((tunable? . #t)))
(license license:asl2.0)))
;; Depends on at least SSE3 and should only be used for a tuned build of
;; python-pyscf.
(define-public qcint