summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2025-07-08 12:04:06 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-07-08 12:05:34 +0100
commit6ab6ba14f8522794342fcd34779cf8a2fadb11cb (patch)
tree06d05cb2627c5caff8cc07b3d7d4d8218a5748cc
parent2e628ad02c5b3efa4e6e4359cd866c0d57c18bff (diff)
gnu: Add cianna.
* gnu/packages/astronomy.scm (cianna): New variable. Change-Id: If657bc243496a05ecf126f917038b6ccaf56f826 Co-authored-by: Simon Tournier <zimon.toutoune@gmail.com> Reviewed-by: Andreas Enge <andreas@enge.fr>
-rw-r--r--gnu/packages/astronomy.scm64
1 files changed, 63 insertions, 1 deletions
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 2fd2c248bf..55a6f5b0c9 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -11,7 +11,7 @@
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
;;; Copyright © 2023-2024 Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2023, 2025 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2024-2025 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2024 Andy Tai <lichengtai@gmail.com>
;;; Copyright © 2024-2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
@@ -677,6 +677,68 @@ in FITS files.")
(sha256
(base32 "098x1l8ijwsjp2ivp3v7pamrmpgwj5xmgb4yppm9w3w044zxr8b6"))))))
+(define-public cianna
+ (package
+ (name "cianna")
+ (version "1.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Deyht/CIANNA")
+ (commit (string-append "V-" version ".0"))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0i7czicyiy9lldsrarsh9lpjm4znx3gnsi1kqqyhiafxjxsji35k"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure) ; no configure
+ (delete 'check) ; no tests
+ (add-after 'unpack 'fix-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((blas #$(this-package-input "openblas")))
+ (substitute* "compile.cp"
+ (("/usr/bin/gcc")
+ #$(cc-for-target))
+ (("/opt/OpenBLAS/include/")
+ (string-append blas "/include/"))
+ (("/opt/OpenBLAS/lib")
+ (string-append blas "/lib")))
+ (substitute* "src/python_module_setup.py"
+ (("/opt/OpenBLAS/include")
+ (string-append blas "/include"))
+ (("/opt/OpenBLAS/lib")
+ (string-append blas "/lib"))))))
+ (replace 'build
+ (lambda* _
+ (invoke "./compile.cp" "BLAS" "OPEN_MP" "LPTHREAD" "PY_INTERF")))
+ (replace 'install
+ (lambda _
+ (rename-file "main" "cianna-cpu")
+ (install-file "cianna-cpu" (string-append #$output "/bin"))))
+ (add-after 'install 'install-python
+ (lambda _
+ (with-directory-excursion "src"
+ (invoke "python" "python_module_setup.py" "install"
+ "--root=/"
+ (string-append "--prefix=" #$output))))))))
+ (native-inputs
+ (list python-wrapper
+ python-numpy
+ python-setuptools))
+ (inputs (list openblas))
+ (home-page "https://github.com/Deyht/CIANNA")
+ (synopsis "Deep learning framework for astronomical data analysis")
+ (description
+ "This package provides a @acronym{CIANNA, Convolutional Interactive
+Artificial Neural Networks by/for Astrophysicists} - a general-purpose deep
+learning framework primarily developed and used for astronomical data
+analysis.")
+ (license license:asl2.0)))
+
(define-public erfa
(package
(name "erfa")