java-maths.scm 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages java-maths)
  19. #:use-module ((guix licenses) #:prefix license:)
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix git-download)
  23. #:use-module (guix utils)
  24. #:use-module (guix build-system gnu)
  25. #:use-module (gnu packages)
  26. #:use-module (gnu packages gcc)
  27. #:use-module (gnu packages java)
  28. #:use-module (gnu packages maths)
  29. #:use-module (gnu packages ruby))
  30. (define-public java-jblas
  31. (package
  32. (name "java-jblas")
  33. (version "1.2.4")
  34. (source (origin
  35. (method git-fetch)
  36. (uri (git-reference
  37. (url "https://github.com/mikiobraun/jblas")
  38. (commit (string-append "jblas-" version))))
  39. (file-name (git-file-name name version))
  40. (sha256
  41. (base32
  42. "0afh48hq8i8li5z11x415c8slwsfrlib0w1xjfbg186mximqvv3g"))))
  43. (build-system gnu-build-system)
  44. (arguments
  45. `(#:tests? #f ; there are none
  46. #:configure-flags
  47. (list (string-append "--libpath="
  48. (assoc-ref %build-inputs "openblas")
  49. "/lib")
  50. "--build-type=openblas")
  51. #:phases
  52. (modify-phases %standard-phases
  53. (add-after 'unpack 'make-writable
  54. (lambda _
  55. (map make-file-writable
  56. (find-files "." ".*"))
  57. #t))
  58. (add-before 'build 'setenv-JAVA_HOME
  59. (lambda* (#:key inputs #:allow-other-keys)
  60. (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
  61. #t))
  62. (add-after 'build 'build-jar
  63. (lambda* (#:key inputs outputs #:allow-other-keys)
  64. (setenv "M2_HOME" (assoc-ref outputs "out"))
  65. (invoke "ant" "jar" (string-append "-Dversion=" ,version))))
  66. (replace 'install
  67. (lambda* (#:key outputs #:allow-other-keys)
  68. (let ((target (string-append (assoc-ref outputs "out")
  69. "/share/java")))
  70. (mkdir-p target)
  71. (install-file (string-append "jblas-" ,version ".jar") target))
  72. #t)))))
  73. (inputs
  74. (list openblas))
  75. (native-inputs
  76. `(("ant" ,ant)
  77. ("ruby" ,ruby) ; for configure script
  78. ("gfortran" ,gfortran)
  79. ("jdk" ,icedtea "jdk")))
  80. (home-page "http://jblas.org")
  81. (synopsis "Linear algebra for Java")
  82. (description
  83. "jblas is a fast linear algebra library for Java. jblas is based on BLAS
  84. and LAPACK, the de-facto industry standard for matrix computations, and uses
  85. state-of-the-art implementations for all its computational routines, making
  86. jBLAS very fast.")
  87. (license license:bsd-3)))