unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: add atlas
@ 2014-10-26  9:13 Federico Beffa
  2014-10-26 14:17 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Federico Beffa @ 2014-10-26  9:13 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 63 bytes --]

Hi,

here the ATLAS package as it stands today.

Regards,
Fede

[-- Attachment #2: 0001-gnu-add-atlas.patch --]
[-- Type: text/x-patch, Size: 6116 bytes --]

From 2c98134886d0805a26a86e99d31357872b8228cc Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Sun, 26 Oct 2014 11:03:02 +0100
Subject: [PATCH] gnu: add atlas

* gnu/packages/maths.scm(atlas): New Variable.
---
 gnu/packages/maths.scm | 121 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 121 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 20e700f..a173305 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -22,6 +22,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages maths)
+  #:use-module (ice-9 regex)
   #:use-module (gnu packages)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
@@ -935,3 +936,123 @@ point numbers")
     ;; At least one file (src/maxima.asd) says "version 2."
     ;; GPLv2 only is therefore the smallest subset.
     (license license:gpl2)))
+
+(define-public atlas
+  (package
+    (name "atlas")
+    (version "3.10.2")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append 
+            "mirror://sourceforge/math-atlas/atlas"
+            version ".tar.bz2"))
+      (sha256
+       (base32
+        "0bqh4bdnjdyww4mcpg6kn0x7338mfqbdgysn97dzrwwb26di7ars"))))
+    (build-system gnu-build-system)
+    (home-page "http://math-atlas.sourceforge.net/")
+    (inputs `(("gfortran" ,gfortran-4.8)
+              ("lapack-tar" ,(package-source lapack))))
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:parallel-build? #f
+       #:parallel-tests? #f
+       #:modules ((srfi srfi-26)
+                  (srfi srfi-1)
+                  (guix build gnu-build-system)
+                  (guix build utils))
+       #:configure-flags 
+       `(;; Generate position independent code suitable for dynamic libraries
+         ;; and use WALL timer to get more accurate timing.
+         "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
+         ;; Set word width.
+         "-b"
+         ,,(if (string-match "64" (%current-system))
+               "64"
+               "32")
+         ;; Disable parallel build as it gives errors: atlas_pthread.h is
+         ;; needed to compile C files before it is generated.
+         "-Ss" "pmake" "make -j 1"
+         ;; Generate shared libraries.
+         "--shared"
+         ;; Build a full LAPACK library.
+         ,(string-append "--with-netlib-lapack-tarfile="
+                         (assoc-ref %build-inputs "lapack-tar")))
+       #:phases
+        (alist-cons-after
+         'install 'install-doc
+         (lambda* (#:key outputs inputs #:allow-other-keys)
+           (let ((doc (string-append (assoc-ref outputs "doc") 
+                                     "/share/doc/atlas")))
+             (mkdir-p doc)
+             (fold (lambda (file previous) 
+                     (and previous (zero? (system* "cp" file doc))))
+                   #t (find-files "../ATLAS/doc" ".*"))))
+         (alist-cons-after
+          'check 'check-pt
+          (lambda _ (zero? (system* "make" "ptcheck")))
+          ;; Fix files required to run configure.
+          (alist-cons-before
+           'configure 'fix-/bin/sh
+           (lambda _
+             ;; Use `sh', not `/bin/sh'.
+             (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
+               (("/bin/sh")
+                "sh")))
+           ;; Fix /bin/sh in generated make files.
+           (alist-cons-after
+            'configure 'fix-/bin/sh-in-generated-files
+            (lambda _
+              (substitute* (find-files "." "^[Mm]ake\\.inc.*")
+                (("/bin/sh")
+                 "sh")))
+            ;; ATLAS configure program does not accepts the default flags
+            ;; passed by the 'gnu-build-system'.
+            (alist-replace
+             'configure
+             (lambda* (#:key native-inputs inputs outputs 
+                             (configure-flags '())
+                             #:allow-other-keys #:rest args)
+               (let* ((prefix     (assoc-ref outputs "out"))
+                      (bash       (or (and=> (assoc-ref 
+                                              (or native-inputs inputs) "bash")
+                                             (cut string-append <> "/bin/bash"))
+                                      "/bin/sh"))
+                      (flags      `(,(string-append "--prefix=" prefix)
+                                    ,@configure-flags))
+                      (abs-srcdir (getcwd))
+                      (srcdir     (string-append "../" (basename abs-srcdir))))
+                 (format #t "source directory: ~s (relative from build: ~s)~%"
+                         abs-srcdir srcdir)
+                 (mkdir "../build")
+                 (chdir "../build")
+                 (format #t "build directory: ~s~%" (getcwd))
+                 (format #t "configure flags: ~s~%" flags)
+                 (zero? (apply system* bash
+                               (string-append srcdir "/configure")
+                               flags))))
+             %standard-phases)))))))
+    (synopsis "Automatically Tuned Linear Algebra Software")
+    (description
+     "ATLAS is an automatically tuned linear algebra software library
+providing C and Fortran77 interfaces to a portably efficient BLAS
+implementation, as well as a few routines from LAPACK.
+
+Optimization occurs at build time.  For this reason you should build the
+library on the maschine on which you will use it.  The package must therefore
+be installed without making use of substitutes.  This can be achieved with the
+following command:
+
+\"guix package --no-substitutes -i atlas\"
+
+In addition, before building the library, CPU throttling should be disabled.
+This can be done in the BIOS, or, on Linux, with the following commands:
+
+cpufreq-selector -g performance -c 0
+...
+cpufreq-selector -g performance -c N-1
+
+where N is the number of cores of your CPU.  Failure to do so will result in a
+library with poor performance.")
+    (license license:bsd-3)))
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: add atlas
  2014-10-26  9:13 [PATCH] gnu: add atlas Federico Beffa
@ 2014-10-26 14:17 ` Ludovic Courtès
  2014-11-02 20:51   ` Federico Beffa
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2014-10-26 14:17 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> From 2c98134886d0805a26a86e99d31357872b8228cc Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Sun, 26 Oct 2014 11:03:02 +0100
> Subject: [PATCH] gnu: add atlas
>
> * gnu/packages/maths.scm(atlas): New Variable.
                          ^
Missing space.

Pushed with reindentation of ‘origin’ and whitespace-stripping.

BTW, if you want, you can create a Savannah account so you have commit
access, under the rules given in ‘HACKING’.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: add atlas
  2014-10-26 14:17 ` Ludovic Courtès
@ 2014-11-02 20:51   ` Federico Beffa
  2014-11-03 16:56     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Federico Beffa @ 2014-11-02 20:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On Sun, Oct 26, 2014 at 3:17 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> BTW, if you want, you can create a Savannah account so you have commit
> access, under the rules given in ‘HACKING’.

Thanks for the offer!  I've created an account.  My knowledge of git
is very limited and I've never pushed any change with it.  I will
therefore need some guidance.  I'm reading Git Pro
http://git-scm.com/book/en/v2
Do you have any other pointer, possibly more concise and in line with
guix's use?

Regards,
Fede

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: add atlas
  2014-11-02 20:51   ` Federico Beffa
@ 2014-11-03 16:56     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2014-11-03 16:56 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> Thanks for the offer!  I've created an account.  My knowledge of git
> is very limited and I've never pushed any change with it.  I will
> therefore need some guidance.  I'm reading Git Pro
> http://git-scm.com/book/en/v2

No problem.  If in doubt just ask by email or stop by #guix on Freenode.

> Do you have any other pointer, possibly more concise and in line with
> guix's use?

Please read the “Commit Access” section in ‘HACKING’ for a start, and
make sure you follow these guidelines.

I don’t really know of good Git documentation to recommend.

If you use Emacs, I recommend Magit as the Git user interface.  It’s
powerful, and I think it makes it easier to understand what’s going on
with Git.

Welcome on board!  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-03 16:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-26  9:13 [PATCH] gnu: add atlas Federico Beffa
2014-10-26 14:17 ` Ludovic Courtès
2014-11-02 20:51   ` Federico Beffa
2014-11-03 16:56     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).