diff options
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r-- | gnu/packages/python.scm | 94 |
1 files changed, 49 insertions, 45 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 232a785778..d503c787b1 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2068,7 +2068,7 @@ sources.") (define-public python-scikit-learn (package (name "python-scikit-learn") - (version "0.15.2") + (version "0.16.1") (source (origin (method url-fetch) @@ -2077,40 +2077,27 @@ sources.") version ".tar.gz")) (sha256 (base32 - "1rb93h2q15f219sz60sczjb65rg70xjmnp0q4pkkaairx5s05q55")))) + "140skabifgc7lvvj873pnzlwx0ni6q8qkrsyad2ccjb3h8rxzkih")))) (build-system python-build-system) (arguments `(#:phases (alist-cons-before - 'build 'set-environment-variables - (lambda* (#:key inputs #:allow-other-keys) - (let* ((atlas-threaded - (string-append (assoc-ref inputs "atlas") - "/lib/libtatlas.so")) - ;; On single core CPUs only the serial library is created. - (atlas-lib - (if (file-exists? atlas-threaded) - atlas-threaded - (string-append (assoc-ref inputs "atlas") - "/lib/libsatlas.so")))) - (setenv "ATLAS" atlas-lib))) - (alist-cons-before - 'check 'set-HOME - ;; some tests require access to "$HOME" - (lambda _ (setenv "HOME" "/tmp")) - ;; Tests can only be run after the library has been installed and not - ;; within the source directory. - (alist-cons-after - 'install 'check - (lambda _ - (with-directory-excursion "/tmp" - ;; With Python 3 one test of 3334 fails - ;; (sklearn.tests.test_common.test_transformers); see - ;; https://github.com/scikit-learn/scikit-learn/issues/3693 - (system* "nosetests" "-v" "sklearn"))) - (alist-delete 'check %standard-phases)))))) + 'check 'set-HOME + ;; some tests require access to "$HOME" + (lambda _ (setenv "HOME" "/tmp")) + ;; Tests can only be run after the library has been installed and not + ;; within the source directory. + (alist-cons-after + 'install 'check + (lambda _ + (with-directory-excursion "/tmp" + ;; With Python 3 one test of 3334 fails + ;; (sklearn.tests.test_common.test_transformers); see + ;; https://github.com/scikit-learn/scikit-learn/issues/3693 + (system* "nosetests" "-v" "sklearn"))) + (alist-delete 'check %standard-phases))))) (inputs - `(("atlas" ,atlas) + `(("openblas" ,openblas) ("python-nose" ,python-nose))) (propagated-inputs `(("python-numpy" ,python-numpy) @@ -2285,7 +2272,8 @@ writing C extensions for Python as easy as Python itself.") (build-system python-build-system) (inputs `(("python-nose" ,python-nose) - ("openblas" ,openblas))) + ("openblas" ,openblas) + ("lapack" ,lapack))) (native-inputs `(("gfortran" ,gfortran-4.8))) (arguments @@ -2295,11 +2283,21 @@ writing C extensions for Python as easy as Python itself.") (lambda* (#:key inputs #:allow-other-keys) (call-with-output-file "site.cfg" (lambda (port) - (format port "[openblas] + (format port + "[openblas] libraries = openblas library_dirs = ~a/lib include_dirs = ~a/include -" (assoc-ref inputs "openblas") (assoc-ref inputs "openblas")))) + +[lapack] +lapack_libs = lapack +library_dirs = ~a/lib +include_dirs = ~a/include +" + (assoc-ref inputs "openblas") + (assoc-ref inputs "openblas") + (assoc-ref inputs "lapack") + (assoc-ref inputs "lapack")))) ;; Use "gcc" executable, not "cc". (substitute* "numpy/distutils/system_info.py" (("c = distutils\\.ccompiler\\.new_compiler\\(\\)") @@ -2619,7 +2617,8 @@ toolkits.") ("python-pyparsing" ,python-pyparsing) ("python-nose" ,python-nose) ("python-sphinx" ,python-sphinx) - ("atlas" ,atlas))) + ("lapack" ,lapack) + ("openblas" ,openblas))) (native-inputs `(("gfortran" ,gfortran-4.8) ("texlive" ,texlive) @@ -2628,18 +2627,23 @@ toolkits.") (arguments `(#:phases (alist-cons-before - 'build 'set-environment-variables + 'build 'configure-openblas (lambda* (#:key inputs #:allow-other-keys) - (let* ((atlas-threaded - (string-append (assoc-ref inputs "atlas") - "/lib/libtatlas.so")) - ;; On single core CPUs only the serial library is created. - (atlas-lib - (if (file-exists? atlas-threaded) - atlas-threaded - (string-append (assoc-ref inputs "atlas") - "/lib/libsatlas.so")))) - (setenv "ATLAS" atlas-lib))) + (call-with-output-file "site.cfg" + (lambda (port) + (format port + "[blas] +libraries = openblas +library_dirs = ~a/lib +include_dirs = ~a/include +[atlas] +library_dirs = ~a/lib +atlas_libs = openblas +" + (assoc-ref inputs "openblas") + (assoc-ref inputs "openblas") + (assoc-ref inputs "openblas")))) + #t) (alist-cons-after 'install 'install-doc (lambda* (#:key outputs #:allow-other-keys) |