diff --git a/gnu/local.mk b/gnu/local.mk index 043aa975f4f..103912f37ad 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1093,6 +1093,7 @@ dist_patch_DATA = \ %D%/packages/patches/catdoc-CVE-2017-11110.patch \ %D%/packages/patches/chez-irregex-import-cond-expand.patch \ %D%/packages/patches/chez-scheme-bin-sh.patch \ + %D%/packages/patches/cianna-remove-error-for-missing-cuda.patch \ %D%/packages/patches/circos-remove-findbin.patch \ %D%/packages/patches/cdparanoia-fpic.patch \ %D%/packages/patches/cdrkit-libre-cross-compile.patch \ diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 313a934eb75..b7d2993659a 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -705,59 +705,40 @@ in FITS files.") (define-public cianna (package (name "cianna") - (version "1.0.0") + ;; Project does not publish regular releases, see: + ;; . + (properties '((commit . "c9aa934a931ed77663997f0f20172ee7f63b068a") + (revision . "0"))) + (version (git-version "1.0.1.2" + (assoc-ref properties 'revision) + (assoc-ref properties 'commit))) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/Deyht/CIANNA") - (commit (string-append "V-" version ".0")))) + (commit (assoc-ref properties 'commit)))) (file-name (git-file-name name version)) (sha256 - (base32 "0i7czicyiy9lldsrarsh9lpjm4znx3gnsi1kqqyhiafxjxsji35k")))) - (build-system gnu-build-system) + (base32 "1xdm5sfk2w49sg8bpalw5yy2nmfmrmlbyf5bshhg9621rzp5r6p7")) + (patches + ;; XXX: See: . + (search-patches "cianna-remove-error-for-missing-cuda.patch")))) + (build-system cmake-build-system) (arguments (list + #:tests? #f ;no tests + #:build-type "Release" + #:configure-flags + #~(list "-DUSE_BLAS=ON" "-DBUILD_MODULE=OFF" "-DUSE_CUDA=OFF") #: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* _ - (substitute* "compile.cp" - (("-Wno-unknown-pragmas") - "-Wno-unknown-pragmas -Wno-error=maybe-uninitialized")) - (invoke "./compile.cp" "BLAS" "OPEN_MP" "LPTHREAD" "PY_INTERF"))) - (replace 'install + (replace 'install ;no install rule (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)) + (let ((bin (string-append #$output "/bin"))) + (install-file "cianna" bin))))))) + (inputs + (list openblas)) (home-page "https://github.com/Deyht/CIANNA") (synopsis "Deep learning framework for astronomical data analysis") (description diff --git a/gnu/packages/patches/cianna-remove-error-for-missing-cuda.patch b/gnu/packages/patches/cianna-remove-error-for-missing-cuda.patch new file mode 100644 index 00000000000..b3b13a612ba --- /dev/null +++ b/gnu/packages/patches/cianna-remove-error-for-missing-cuda.patch @@ -0,0 +1,32 @@ +From 5eed2d2ca7c13c08ca7eb92fc4a78c30ca4b6b3d Mon Sep 17 00:00:00 2001 +From: Hellseher +Date: Sat, 18 Apr 2026 08:26:29 +0000 +Subject: [PATCH] Remove CUDA error handling from network.c + +Removed error handling for CUDA compilation check. + +Fixes: https://github.com/Deyht/CIANNA/issues/4 +--- + src/network.c | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/src/network.c b/src/network.c +index d454f64..5a9497c 100644 +--- a/src/network.c ++++ b/src/network.c +@@ -155,15 +155,6 @@ CIANNA V-1.0.1.2 stable build (04/2026), by D.Cornu\n\ + init_cuda(networks[network_number]); + #endif + +- #ifndef CUDA +- if(comp_int == C_CUDA) +- { +- printf("\n ERROR: compute method set to CUDA while CIANNA was not compiled for it.\n"); +- printf(" Install Nvidia CUDA and recompile CIANNA with the appropriate option.\n\n"); +- exit(EXIT_FAILURE); +- } +- #endif +- + #ifndef BLAS + if(comp_int == C_BLAS) + {