Ticket #10508: atlas-3.10.1.p0.diff

File atlas-3.10.1.p0.diff, 74.2 KB (added by jdemeyer, 8 years ago)

spkg diff 3.8.4.p1 -> 3.10.1.p0, except for the removal of old patches

  • .hgignore

    # HG changeset patch
    # User Jean-Pierre Flori <jean-pierre.flor@ssi.gouv.fr>
    # Date 1368607040 -7200
    # Node ID 511e479516100247f47ebb3c1be86242f29025dd
    # Parent  aa0dd68fa3342f8925da2521fc9ba2e1482c20a3
    #10508: Update ATLAS to version 3.10.1 and LAPACK to version 3.4.2
    
    diff --git a/.hgignore b/.hgignore
    a b  
    11src
     2lapack.*tar
     3patches/ATLAS-lib/Makefile.in
     4patches/ATLAS-lib/aclocal.m4
     5patches/ATLAS-lib/configure$
     6patches/ATLAS-lib/config.guess
     7patches/ATLAS-lib/config.sub
     8patches/ATLAS-lib/install-sh
     9patches/ATLAS-lib/ltmain.sh
     10patches/ATLAS-lib/m4
     11patches/ATLAS-lib/missing
  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    22
    33== Description ==
    44
    5 This spkg builds ATLAS for Sage. It is build per default on Linux, but should
    6 also work on OSX and Solaris.
     5This spkg builds ATLAS for Sage. It is build per default on Linux and
     6Solaris, but should also work on OSX and Cygwin.
    77
    88== License ==
    99
    10103-clause BSD
    1111
    1212== SPKG Maintainers ==
     13
    1314 * David Kirkby
    1415 * William Stein
     16 * Volker Braun
    1517
    1618== Upstream Contact ==
    1719
    1820 * Atlas devel mailing list.
    19 
    2021 * Clint Whaley has frequently answered questions from the Sage project
    2122
    2223== Dependencies ==
    2324
    2425 * Python
    2526 * Fortran
    26  * Lapack
    2727
    2828== Build Instructions/Notes ==
    2929
    3030 * patches/archinfo_linux.c.patch: Fix Itanium2 support on modern
    3131   RHEL 5 and SLES 10 systems
    32  * patches/archinfo_x86.c.patch: add cpuid support for Pentium D, E models
    33  * patches/Make.top.patch: add make install target for shared libs
    3432 * patches/probe_comp.c.patch: work around -m64 issue on Itanium2
    35  * Tuning info for K732SSE1.tgz, PM32SSE2.tgz and PPCG432.tgz
    36  * Changes linker flags on Solaris if the Sun linker is used.
    37  * AN UPDATE TO THE LATEST ATLAS IS WELL OVERDUE, BUT THIS IS NON-TRIVIAL
    38  * Changing this package, which takes a long time to build, so it (and the
    39    Fortran package) did not use Python, would allow the ATLAS build to be
    40    started sooner in parallel builds. This should reduce the overall time to
    41    build Sage.
    42  * The package is never installed on Cygwin or OS X.
     33 * patches/long_filenames.patch: fix for long filenames (>128 chars)
     34 * patches/shell.patch: replace two instances of "test -e" by "test -f",
     35   as the former is not portable (in particular for the Solaris shell).
     36 * lapack-x.y.z.tgz: The netlib lapack tarball. If you update this,
     37   make sure you also update the LAPACK_TARBALL variable in
     38   spkg-install.
     39 * If you update atlas to a new version make sure that the
     40   ATLAS_OSTYPE, ATLAS_MACHTYPE, and ATLAS_ISAEXT variables in
     41   spkg-install remain in sync with atlas' CONFIG/include/atlconf.h
     42 * The package is never installed on Cygwin or OS X, unless you set
     43   SAGE_ATLAS_ARCH.
    4344
    44 The package can be configured via two environment variables:
     45We are using a dummy autotools/libtools project (see
     46patches/ATLAS-lib) to repack the static ATLAS libraries into shared
     47libraries.
     48
     49The package can be configured via three environment variables:
    4550
    4651 * SAGE_ATLAS_LIB=path
    4752   If this environment variable is set, the libraries libatlas,
     
    5459   The given architectural default and instruction set extensions are
    5560   used instead of the empirical tuning. Available architectures are
    5661
    57      POWER3, POWER4, POWER5, PPCG4, PPCG5, P5, P5MMX, PPRO, PII, PIII,
    58      PM, CoreSolo, CoreDuo, Core2Solo, Core2, Corei7, P4, P4E,
    59      Efficeon, K7, HAMMER, AMD64K10h, UNKNOWNx86, IA64Itan, IA64Itan2,
    60      USI, USII, USIII, USIV, UnknownUS, MIPSR1xK, MIPSICE9
     62     POWER3, POWER4, POWER5, PPCG4, PPCG5, POWER6, POWER7, IBMz9,
     63     IBMz10, IBMz196, x86x87, x86SSE1, x86SSE2, x86SSE3, P5, P5MMX,
     64     PPRO, PII, PIII, PM, CoreSolo, CoreDuo, Core2Solo, Core2, Corei1,
     65     Corei2, Atom, P4, P4E, Efficeon, K7, HAMMER, AMD64K10h, AMDDOZER,
     66     UNKNOWNx86, IA64Itan, IA64Itan2, USI, USII, USIII, USIV, UST2,
     67     UnknownUS, MIPSR1xK, MIPSICE9, ARMv7
    6168
    6269   and instruction set extensions are
    6370
    64      AltiVec, SSE3, SSE2, SSE1, 3DNow
     71     VSX, AltiVec, AVXMAC, AVXFMA4, AVX, SSE3, SSE2, SSE1, 3DNow, NEON
    6572
    6673   In addition, you can also set
    6774
     
    7380
    7481   For example,
    7582
    76      SAGE_ATLAS_ARCH=Corei7,SSE3,SSE2,SSE1
     83     SAGE_ATLAS_ARCH=Corei2,AVX,SSE3,SSE2,SSE1
    7784
    7885   would be appropriate for a Core i7 CPU.
    7986
    80 == TODO ==
    81 
    82  * The build is currently disabled on OSX until we sort out some
    83    linking issues on OSX.
    84 
    85  * On FreeBSD dynamic libraries don't work since the wrong flags are
    86    passed to the linker. This will be fixed soon.
     87 * If SAGE_ATLAS_SAVE_ARCHDEF = <path> is given, then a new archdef
     88   file is created and saved to the given path.
    8789
    8890== ChangeLog ==
    8991
     92=== atlas-3.10.1.p0, lapack-3.4.2 (Jean-Pierre Flori, 26 February 2013) ===
     93 * Trac #10508: Update ATLAS to version 3.10.1 and LAPACK to version 3.4.2.
     94 * Removed patches integrated upstream.
     95 * Add shell.patch to correctly build LAPACK on Solaris.
     96 * Replace os.system() by subprocess.call()
     97
     98=== atlas-3.10.0.p1, lapack-3.4.1 (Volker Braun, September 20 2012) ===
     99 * Trac #10508: Fix for long file names.
     100 * Disable tuning on Itanium, go straight to "fast".
     101
     102=== atlas-3.10.0.p0, lapack-3.4.1 (Jeroen Demeyer, 19 September 2012) ===
     103 * Trac #10508: re-run autotools in patches/ATLAS-lib to fix timestamps.
     104 * Re-download sources to fix timestamps.
     105 * Remove backup files (ending with ~).
     106 * Uncompress lapack tarball, yielding a smaller spkg.
     107
     108=== atlas-3.10.0, lapack-3.4.1 (Volker Braun, July 11 2012) ===
     109 * Stable release
     110 * Now OSX and Cygwin will attempt to build if SAGE_ATLAS_ARCH is set.
     111
     112=== atlas-3.9.85, lapack-3.4.1 (Volker Braun, July 9 2012) ===
     113 * Should be identical to the next stable release
     114
     115=== atlas-3.9.84, lapack-3.4.1 (Volker Braun, July 8 2012) ===
     116 * Update to the newest upstream version
     117 * flush before os.system()
     118 * completely new shared library build system
     119
     120=== atlas-3.9.80, lapack-3.4.1 (Volker Braun, June 23rd 2012) ===
     121 * Update to the newest upstream version
     122 * remove obsoleted patches
     123
     124=== atlas-3.9.68, lapack-3.4.0 (Volker Braun, Jeroen Demeyer, March 6th 2012) ===
     125 * In src/CONFIG/src/Makefile, change "rm -f" to "rm -rf" in
     126   the "clean" rule to support Xcode creating directories like
     127   xspew.dSYM.
     128 * update to latest upstream version
     129 * Make atlas respect CC environment variable.
     130 * Cygwin library name fix.
     131
     132=== atlas-3.9.32, lapack-3.3.0 (Volker Braun, December 5th 2010) ===
     133 * Introduce the SAGE_ATLAS_ARCH environment variable.
     134 * Update to the developer release atlas-3.9.32 according to advice of
     135   Clint Whaley (ATLAS developer).
     136 * Now includes LAPACK source tarball.
     137
    90138=== atlas-3.8.4.p1 (Jeroen Demeyer, 15 January 2012) ===
    91139 * Trac #12312: Completely disable parallel make everywhere
    92140
     
    311359=== atlas-3.7.37 (Michael Abshoff, Aug. 15th, 2007) ===
    312360 * new upstream release (3.7.37), initial release
    313361 * {{{make check}}} added in spkg-check
    314 
    315 ToDo
    316 
    317 * compile threading support conditionally
    318 
  • configuration.py

    diff --git a/configuration.py b/configuration.py
    a b  
    1313# strings:
    1414#
    1515# system:  Linux, SunOS, Darwin, FreeBSD, CYGWIN
     16# release: (Version number of the operating system, output of uname -r)
    1617# machine: i386, x86_64,   # Linux, Darwin, *BSD
    1718#          sun4u, i86pc    # SunOS
    1819# processor: i386, x86_64, powerpc, sparc
    1920# bits:    32bit, 64bit
    2021# fortran: g95, gfortran
    21 # ld:      GNU, Solaris
     22# ld:      GNU, Solaris, Darwin
    2223
    2324# The following pre-defined boolean values are determined from the
    2425# strings. The keys are distinguished by a question mark at the
    2526# end. If possible use these keys as they guard against typos.
    2627#
    2728# Linux?, Solaris?, Darwin?, FreeBSD?, CYGWIN?  # system
     29# OS_X_Lion?                                    # release
    2830# Intel?, PPC?, SPARC?                          # processor
    2931# 64bit?, 32bit?                                # bit width
    3032# fortran_g95?, fortran_GNU?                    # sage_fortran
    31 # linker_GNU?, linker_Solaris?                  # ld
     33# linker_GNU?, linker_Solaris?, linker_Darwin?  # ld
    3234
    3335
    3436######################################################################
     
    7375        shutil.copy2(filename, destination)
    7476
    7577
     78def ln(source, destination):
     79    """
     80    Portable implementation of "ln -sf"
     81    """
     82    if os.path.exists(destination):
     83        os.remove(destination)
     84    print 'Linking', source, 'to', destination
     85    os.symlink(source, destination)
     86
     87
     88def is_executable_file(fpath):
     89    """
     90    Check that `fpath` is a file and executable (ie not a directory with +x set)
     91    """
     92    return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
     93
     94def which(program):
     95    """
     96    Portable implementation of "which"
     97    """
     98    fpath, fname = os.path.split(program)
     99    if fpath != '':
     100        return program
     101    for path in os.environ['PATH'].split(os.pathsep):
     102        f = os.path.join(path, program)
     103        if is_executable_file(f):
     104            return f
     105    raise ValueError('The program '+program+' is not in the $PATH.')
     106
    76107class edit_in_place(object):
    77108    """
    78109    Edit a file in-place by search/replacing regular expressions.
     
    102133except KeyError:
    103134    conf['system'] = platform.system()
    104135
     136try:
     137    conf['release'] = subprocess.check_output(['uname', '-r']).strip()
     138except subprocess.CalledProcessError:
     139    conf['release'] = ""
     140
    105141conf['Linux?'  ] = (conf['system'] == 'Linux')
    106142conf['Solaris?'] = (conf['system'] == 'SunOS')
    107143conf['Darwin?' ] = (conf['system'] == 'Darwin')
     144conf['OS_X_Lion?'] = (conf['Darwin?'] and conf['release'].startswith('11.'))
    108145conf['FreeBSD?'] = (conf['system'] == 'FreeBSD')
    109146conf['CYGWIN?' ] = (conf['system'] == 'CYGWIN')
    110147
     
    114151
    115152conf['Intel?'] = (platform.machine() in ('i386', 'i486', 'i586', 'i686', 'x86_64',
    116153                                         'AMD64', 'i86pc'))
    117 conf['IA64?']   = (platform.processor() == 'ia64')
     154conf['IA64?']   = ((platform.processor() == 'ia64')
     155                   or (platform.machine() == 'ia64'))
    118156conf['PPC?']   = (platform.processor() == 'powerpc')
    119157conf['SPARC?'] = (platform.processor() == 'sparc')
    120158
     159conf['generic_binary?'] = (os.environ.get('SAGE_FAT_BINARY', 'no') == 'yes')
    121160
    122161######################################################################
    123162### bit width
     
    178217    conf['ld'] = 'GNU'
    179218elif 'Solaris' in ld_version:
    180219    conf['ld'] = 'Solaris'
     220elif 'Apple' in ld_version:
     221    conf['ld'] = 'Darwin'
    181222else:
    182223    print 'Unknown linker: '+ld_version
    183224    conf['ld'] = None
    184225
    185226conf['linker_GNU?'] = (conf['ld'] == 'GNU')
    186227conf['linker_Solaris?'] = (conf['ld'] == 'Solaris')
     228conf['linker_Darwin?'] = (conf['ld'] == 'Darwin')
    187229
    188230
    189231if conf['Solaris?'] and conf['linker_GNU?']:
  • new file patches/ARCHS/IA64Itan264.tar.bz2

    diff --git a/patches/ARCHS/IA64Itan264.tar.bz2 b/patches/ARCHS/IA64Itan264.tar.bz2
    new file mode 100644
    index 0000000000000000000000000000000000000000..8fa1890001f04dbdf4a135e376c400ba43313389
    GIT binary patch
    literal 6886
    zc$@*|8X4t6T4*^jL0KkKSuRRY#{gcL|NsA(0RUT%|L_0r-}V3h|L}ks_nXjgbO0yP
    zgbo0N061VM9rZXKgMFC@y|AO!flw%yRM%H(a3)y=Ewus(ARRIQC;$S0002+`KoS5b
    z1L5WX5&%dQcKSZqTbS*RiU24Gr=(2K)M-5v)YCxF00000007Vc001<}ri~9s*{TT;
    znh-=Fnx3XlN}DxCn@}_W(?db(13&?w0000000gEfRL}>c8W|Y?0iXZ?00000000Jn
    z00I>$sM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G4TP(>a1iPX9OZr7$J=b
    zq|i2#6G{MKgDFVuE6_P{JVb1wn3QlZ^+Nk#ewaHIN7wcCEuwB-zL8ykJRy8#@WR2o
    zy~V`YD%uQ+E(Pshh5$H0N{zTE2w?^xiUZqiYl20*?4)(1T)@I~0}BAdKt4*nRl>Kb
    zm~R7cZiUx$=<Rkhog(xS^$&C|aJ37?3(X6X`HqR=FvdSP;S1;wJHhDqqibf`$J+br
    z=(}NdogsI($)gN;XQ1jxvP*&7Zaqfe|F1Y+fIb6p*pYi7d<}@jl#TADH>-Fa==T`6
    z;&z|zNVHzFbCVfu;xyTfonz@*!$ufu#WpsbfqPOdH`m$+TIS~Ro+P8$3$W@jGYrG9
    zFKKQs#*u81c4Me=fmd_|VZb0>&=s2i3xRugeTtGvB$7$C+iPvM=GL~|?>15Mof0qK
    zNWN)$QZE^*R=6K@JPClrp2J2MFO{)-mG8bod4|EYir^h}9@Es6c_D?#SIVz_yE0=3
    g&U<8bd}y@L&v~O5VXE*-hyTUgkxmpO3zC#E!1ooBpa1{>
  • new file patches/ARCHS/x86SSE264SSE2.tar.bz2

    diff --git a/patches/ARCHS/x86SSE264SSE2.tar.bz2 b/patches/ARCHS/x86SSE264SSE2.tar.bz2
    new file mode 100644
    index 0000000000000000000000000000000000000000..467387b15fdb217279f4a49cfc71fde15b2a1037
    GIT binary patch
    literal 8121
    zc$@*bA4cFpT4*^jL0KkKS$s4g!T_O*|NsA<DF9lJ|L_0*-}L|Q-|!#<f3I*`z<>qw
    zY!59*fjD3;ef2nEEoR!5G}?*e!cro;Ln<v8R0&`flx2mlr5GGk6n8teFa>Ks3IL!0
    z0002c8Xy4B07wM@1b_tslD0htAmpJS1ETo*qbc|)flWN1&@|IVfB*rZpa1{>0002c
    z02&Q6^%{7|K`Ed?0z?rsO-A)SQ_^~erl0_500000000000001LpPH3ZY5)KL00006
    zfB*mh0000Q0000q1e!?%flozG)juR{r6-fpo<l-CMw$Q(Gy^6;0009J000001d@eK
    zFa*;Y69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ATLAS-lib/Makefile.am b/patches/ATLAS-lib/Makefile.am
    new file mode 100644
    - +  
     1ACLOCAL_AMFLAGS = -I m4
     2
     3# Replace with the actual destination directory
     4SO_VERSION=3:0:1
     5
     6# You shouldn't have to customize anything from here on
     7
     8ATLAS_SERIAL_LIBS=libatlas.la libcblas.la libf77blas.la liblapack.la
     9
     10ATLAS_PARALLEL_LIBS=libptcblas.la libptf77blas.la libptlapack.la
     11
     12all: all_parallel
     13
     14all_serial: $(ATLAS_SERIAL_LIBS)
     15
     16all_parallel: all_serial $(ATLAS_PARALLEL_LIBS)
     17
     18clean:
     19        $(RM) -r -f .libs *.la *-obj
     20
     21install: install_parallel
     22
     23install_serial: $(ATLAS_SERIAL_LIBS)
     24        $(MKDIR_P) @libdir@
     25        @LIBTOOL@ --mode=install $(INSTALL) -c libatlas.la @libdir@/libatlas.la
     26        @LIBTOOL@ --mode=install $(INSTALL) -c libcblas.la @libdir@/libcblas.la
     27        @LIBTOOL@ --mode=install $(INSTALL) -c libf77blas.la @libdir@/libf77blas.la
     28        @LIBTOOL@ --mode=install $(INSTALL) -c liblapack.la @libdir@/liblapack.la
     29        @LIBTOOL@ --finish @libdir@
     30
     31install_parallel: install_serial $(ATLAS_PARALLEL_LIBS)
     32        $(MKDIR_P) @libdir@
     33        @LIBTOOL@ --mode=install $(INSTALL) -c libptcblas.la @libdir@/libptcblas.la
     34        @LIBTOOL@ --mode=install $(INSTALL) -c libptf77blas.la @libdir@/libptf77blas.la
     35        @LIBTOOL@ --mode=install $(INSTALL) -c libptlapack.la @libdir@/libptlapack.la
     36        @LIBTOOL@ --finish @libdir@
     37
     38
     39# In presence of multiple definitions of thread related functions, use the ones from *_mut.o
     40# Works with all nm output formats (BSD/POSIX/System V)
     41libatlas.la: libatlas.a
     42        -$(RM) -r -f libatlas-obj
     43        $(MKDIR) libatlas-obj
     44        cd libatlas-obj && $(AR) x ../$<
     45        if [ `$(NM) -g $< | $(EGREP) -w 'ATL_(Set|Reset|Free|Dec)AtomicCount' | $(GREP) -w T | wc -l` -gt 4 ]; then \
     46          $(RM) `ls -1 libatlas-obj/ATL_{Set,Reset,Free,Dec}AtomicCount_*.o | $(GREP) -v '_mut.o$$'`; \
     47        fi
     48        @LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
     49            -o $@ libatlas-obj/*.o \
     50            @PTHREAD_LIB@ -lm \
     51            -rpath @libdir@ -version-info $(SO_VERSION)
     52
     53
     54libcblas.la: libcblas.a libatlas.la
     55        -$(RM) -r -f libcblas-obj
     56        $(MKDIR) libcblas-obj
     57        cd libcblas-obj && $(AR) x ../$<
     58        @LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
     59            -o $@ libcblas-obj/*.o \
     60            -latlas \
     61            -rpath @libdir@ -version-info $(SO_VERSION)
     62
     63
     64libptcblas.la: libptcblas.a libatlas.la
     65        -$(RM) -r -f libptcblas-obj
     66        $(MKDIR) libptcblas-obj
     67        cd libptcblas-obj && $(AR) x ../$<
     68        @LIBTOOL@ --tag=CC --mode=link $(CC) @LIBTOOL_TYPE@ \
     69            -o $@ libptcblas-obj/*.o \
     70            @PTHREAD_LIB@ -latlas \
     71            -rpath @libdir@ -version-info $(SO_VERSION)
     72
     73
     74libf77blas.la: libf77blas.a libatlas.la
     75        -$(RM) -r -f libf77blas-obj
     76        $(MKDIR) libf77blas-obj
     77        cd libf77blas-obj && $(AR) x ../$<
     78        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
     79            -o $@ libf77blas-obj/*.o \
     80            -latlas \
     81            -rpath @libdir@ -version-info $(SO_VERSION)
     82
     83libptf77blas.la: libptf77blas.a libatlas.la
     84        -$(RM) -r -f libptf77blas-obj
     85        $(MKDIR) libptf77blas-obj
     86        cd libptf77blas-obj && $(AR) x ../$<
     87        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
     88            -o $@ libptf77blas-obj/*.o \
     89            @PTHREAD_LIB@ -latlas \
     90            -rpath @libdir@ -version-info $(SO_VERSION)
     91
     92libf77refblas.la: libf77refblas.a
     93        -$(RM) -r -f libf77refblas-obj
     94        $(MKDIR) libf77refblas-obj
     95        cd libf77refblas-obj && $(AR) x ../$<
     96        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
     97            -o $@ libf77refblas-obj/*.o \
     98            -latlas \
     99            -rpath @libdir@ -version-info $(SO_VERSION)
     100
     101liblapack.la: liblapack.a libatlas.la libcblas.la libf77blas.la
     102        -$(RM) -r -f liblapack-obj
     103        $(MKDIR) liblapack-obj
     104        cd liblapack-obj && $(AR) x ../$<
     105        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
     106            -o $@ liblapack-obj/*.o \
     107            -latlas -lcblas -lf77blas -lm \
     108            -rpath @libdir@ -version-info $(SO_VERSION)
     109
     110libptlapack.la: libptlapack.a libatlas.la libptcblas.la libptf77blas.la
     111        -$(RM) -r -f libptlapack-obj
     112        $(MKDIR) libptlapack-obj
     113        cd libptlapack-obj && $(AR) x ../$<
     114        @LIBTOOL@ --tag=F77 --mode=link $(F77) @LIBTOOL_TYPE@ \
     115            -o $@ libptlapack-obj/*.o \
     116            @PTHREAD_LIB@ -latlas -lptcblas -lptf77blas -lm \
     117            -rpath @libdir@ -version-info $(SO_VERSION)
     118
     119
     120.PHONY: all all_serial all_parallel build install install_serial install_parallel clean
  • new file patches/ATLAS-lib/README

    diff --git a/patches/ATLAS-lib/README b/patches/ATLAS-lib/README
    new file mode 100644
    - +  
     1This is a stub autotools project to generate the system-dependent
     2libtool script. Nothing is compiled here. The Makefile.am unpacks the
     3atlas static libraries and repacks them into shared libraries.
  • new file patches/ATLAS-lib/configure.ac

    diff --git a/patches/ATLAS-lib/configure.ac b/patches/ATLAS-lib/configure.ac
    new file mode 100644
    - +  
     1AC_INIT([ATLAS],[3.10.1])
     2AM_INIT_AUTOMAKE(foreign)
     3
     4LT_INIT
     5
     6AC_PROG_CC
     7AC_PROG_F77
     8
     9AC_CONFIG_FILES([Makefile])
     10AC_CONFIG_MACRO_DIR([m4])
     11
     12AC_CHECK_LIB(pthread, pthread_create, [PTHREAD_LIB="-lpthread"])
     13AC_SUBST(PTHREAD_LIB)
     14
     15AC_ARG_ENABLE([static],
     16    [AS_HELP_STRING([--enable-static],
     17                    [also install static libtool library (default: no)])])
     18AS_IF([test "x$enable_static" = "xyes"],
     19    [libtool_type=""],
     20    [libtool_type=-shared])
     21AC_SUBST(LIBTOOL_TYPE, [$libtool_type])
     22
     23AC_OUTPUT
  • new file patches/Makefile.patch

    diff --git a/patches/Makefile.patch b/patches/Makefile.patch
    new file mode 100644
    - +  
     1--- src/CONFIG/src/Makefile     2012-06-23 17:27:27.000000000 +0100
     2+++ new/CONFIG/src/Makefile     2012-06-24 03:05:52.043151077 +0100
     3@@ -580,6 +580,6 @@
     4 confclean: $(CLEANdep)
     5        rm -f *core* *.o config?.out
     6 clean : $(CLEANdep)
     7-       rm -f *.o x* config?.out *core*
     8+       rm -rf *.o x* config?.out *core*
     9 cleanall: clean
     10        $(MAKE) -f Make.top clean
  • patches/archinfo_linux.c.patch

    diff --git a/patches/archinfo_linux.c.patch b/patches/archinfo_linux.c.patch
    a b  
    1 --- archinfo_linux.c.orig       2011-06-15 10:25:07.837647902 -0700
    2 +++ archinfo_linux.c    2011-06-15 10:26:16.728647870 -0700
    3 @@ -100,12 +100,12 @@
     1--- src/CONFIG/src/backend/archinfo_linux.c     2012-06-23 17:27:27.000000000 +0100
     2+++ new/CONFIG/src/backend/archinfo_linux.c     2012-06-24 03:17:47.297954105 +0100
     3@@ -117,7 +117,7 @@
     4       }
    45       break;
    56    case AFIA64:
    6        res[0] = '\0';
    7 -      ierr = CmndOneLine(NULL, "fgrep 'Itanium' /proc/cpuinfo", res);
    8 +      ierr = CmndOneLine(NULL, "fgrep 'IA-64' /proc/cpuinfo", res);
    9        if (ierr || res[0] == '\0')
    10           ierr = CmndOneLine(NULL, "fgrep \"model name\" /proc/cpuinfo", res);
    11        if (!ierr && res[0] != '\0')
     7-      res = atlsys_1L(NULL, "fgrep 'Itanium' /proc/cpuinfo", 0, 0);
     8+      res = atlsys_1L(NULL, "fgrep 'IA-64' /proc/cpuinfo", 0, 0);
     9       if (res && res[0] == '\0')
    1210       {
    13 -         if (strstr(res, "Itanium 2") || strstr(res, "McKinley"))
    14 +         if (strstr(res, "IA-64") || strstr(res, "McKinley"))
    15              mach = IA64Itan2;
    16           else if (strstr(res, "Itanium")) mach = IA64Itan;
    17        }
     11          free(res);
     12@@ -129,7 +129,7 @@
     13       {
     14          if (res[0] != '\0')
     15          {
     16-            if (strstr(res, "Itanium 2") || strstr(res, "McKinley"))
     17+            if (strstr(res, "IA-64") || strstr(res, "McKinley"))
     18                mach = IA64Itan2;
     19             else if (strstr(res, "Itanium")) mach = IA64Itan;
     20          }
  • new file patches/atlas-config

    diff --git a/patches/atlas-config b/patches/atlas-config
    new file mode 100755
    - +  
     1#!/usr/bin/env python
     2
     3import sys, errno, os, platform, time, glob, subprocess, signal, argparse
     4
     5parser = argparse.ArgumentParser(
     6    description='(Re-)Build ATLAS (http://math-atlas.sourceforge.net) '
     7    'according to the SAGE_ATLAS_ARCH environment variable')
     8
     9parser.add_argument('--unthrottle', nargs=1, type=int,
     10                    help='switch CPU throttling off until PID finishes',
     11                    metavar='PID')
     12
     13parser.add_argument('--archdef', action='store_const', const=True,
     14                    help='build archdef tarball and save it to the current directory')
     15
     16
     17def pid_exists(pid):
     18    """
     19    Check whether pid exists in the current process table.
     20    """
     21    if pid < 0:
     22        return False
     23    try:
     24        os.kill(pid, 0)
     25    except OSError, e:
     26        return e.errno == errno.EPERM
     27    else:
     28        return True
     29
     30
     31def unthrottle_posix(pid):
     32    cpus = list(glob.glob('/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'))
     33    scaling_governor = []
     34    for cpu in cpus:
     35        with open(cpu, 'r') as f:
     36            scaling_governor.append(f.readline())
     37    for cpu in cpus:
     38        with open(cpu, 'w') as f:
     39            f.write('performance')
     40
     41    def signal_handler(signum, frame):
     42        print 'Signal hanadler called with signal', signum
     43        for cpu, governor in zip(cpus, scaling_governor):
     44            with open(cpu, 'w') as f:
     45                f.write(governor)
     46        print 'Reverted throttling to the previous behaviour.'
     47        sys.exit(0)
     48
     49    signal.signal(signal.SIGPIPE, signal_handler)
     50    signal.signal(signal.SIGINT, signal_handler)
     51    signal.signal(signal.SIGTERM, signal_handler)
     52   
     53    try:
     54        while pid_exists(pid):
     55            time.sleep(1)
     56    except KeyboardInterrupt:
     57        pass
     58   
     59    signal_handler(None, None)
     60   
     61     
     62def unthrottle(pid):
     63    if os.name == 'posix':
     64        unthrottle_posix(pid)
     65    else:
     66        print 'I don\'t know how to unthrottle your system ('+platform.system()+')'
     67        sys.exit(3)
     68
     69
     70
     71def is_throttled_posix():
     72    cpus = list(glob.glob('/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'))
     73    for cpu in cpus:
     74        with open(cpu, 'r') as f:
     75            if f.readline().strip() != 'performance':
     76                return True
     77    return False
     78
     79
     80def is_throttled():
     81    if os.name == 'posix':
     82        return is_throttled_posix()
     83    else:
     84        print 'I don\'t know how to unthrottle your system ('+platform.system()+')'
     85        sys.exit(3)
     86       
     87
     88def check_root():
     89    if os.name == 'posix':
     90        if os.getuid() == 0:
     91            return
     92        print '\nError: You need to be root to (un)throttle the CPU.\n'
     93        sys.exit(1)
     94    else:
     95        print 'I don\'t know how to probe administrator rights on your system ('+platform.system()+')'
     96        sys.exit(3)
     97       
     98
     99def check_nonroot():
     100    if os.name == 'posix':
     101        if os.getuid() > 0:
     102            return
     103        print '\nError: You are crazy to run this as root, exiting.\n'
     104        sys.exit(2)
     105    else:
     106        print 'I don\'t know how to probe administrator rights on your system ('+platform.system()+')'
     107        sys.exit(3)
     108
     109
     110command = None
     111
     112def wait_for_command():
     113    global command
     114    if command is None:
     115        return
     116    else:
     117        command.send_signal(signal.SIGTERM)
     118
     119import atexit
     120atexit.register(wait_for_command)
     121
     122
     123def unthrottle_self():
     124    if os.name == 'posix':
     125        global command
     126        print 'Running sudo atlas-config --unthrottle to turn CPU throttling off.'
     127        command = subprocess.Popen(['sudo', os.path.abspath( __file__ ),
     128                                    '--unthrottle', str(os.getpid())])
     129    else:
     130        print 'I don\'t know how to unthrottle your system ('+platform.system()+')'
     131        sys.exit(2)
     132
     133    print 'Waiting for CPU throttling to be turned off...'
     134    while is_throttled():
     135        time.sleep(1)
     136       
     137
     138
     139if __name__ == '__main__':
     140    args = parser.parse_args()
     141
     142    if args.unthrottle:
     143        check_root()
     144        unthrottle(args.unthrottle[0])
     145       
     146    check_nonroot()
     147    unthrottle_self()
     148    print
     149    if os.environ.get('SAGE_FAT_BINARY', 'no') == 'yes':
     150        print 'Building ATLAS with SAGE_FAT_BINARY (generic archdefs).'
     151    elif os.environ.has_key('SAGE_ATLAS_ARCH'):
     152        print 'Building ATLAS with SAGE_ATLAS_ARCH =', os.environ['SAGE_ATLAS_ARCH']
     153    else:
     154        print 'Building ATLAS without specifying architecture.'
     155    print 'This may take many hours during which you should leave the computer otherwise'
     156    print 'idle to obtain accurate timings.'
     157    if args.archdef:
     158        os.environ['SAGE_ATLAS_SAVE_ARCHDEF'] = os.getcwd()
     159        print 'The resulting <archdef>.tar.bz2 will be saved in '+os.getcwd()
     160    print
     161    print 'You have 5 seconds to interrupt...'
     162    time.sleep(1)
     163    print 'You have 4 seconds to interrupt...'
     164    time.sleep(1)
     165    print 'You have 3 seconds to interrupt...'
     166    time.sleep(1)
     167    print 'You have 2 seconds to interrupt...'
     168    time.sleep(1)
     169    print 'You have 1 second to interrupt...'
     170    time.sleep(1)
     171
     172    sys.stdout.flush()
     173    sys.stderr.flush()
     174    os.system('sage -f atlas')
     175
     176   
     177   
     178   
     179       
     180       
     181       
  • new file patches/long_filenames.patch

    diff --git a/patches/long_filenames.patch b/patches/long_filenames.patch
    new file mode 100644
    - +  
     1--- old/bin/extract.c   2012-07-10 20:22:50.000000000 +0100
     2+++ src/bin/extract.c   2012-09-20 17:28:33.989175811 +0100
     3@@ -21,10 +21,10 @@
     4 #include <assert.h>
     5 #include <stdarg.h>
     6 
     7-#define NAMLEN 128
     8+#define NAMLEN 1024
     9 #define LNLEN  2048
     10-#define HANLEN 50
     11-#define SUBLEN 128
     12+#define HANLEN 1024
     13+#define SUBLEN 1024
     14 
     15 #define F_nFlags     16
     16 #define F_Case        0
  • patches/probe_comp.c.patch

    diff --git a/patches/probe_comp.c.patch b/patches/probe_comp.c.patch
    a b  
    1 --- probe_comp.c.orig   2011-06-15 10:20:18.336648039 -0700
    2 +++ probe_comp.c        2011-06-15 10:22:01.323647990 -0700
    3 @@ -532,6 +532,8 @@
     1--- src/CONFIG/src/probe_comp.c 2012-06-23 17:27:27.000000000 +0100
     2+++ new/CONFIG/src/probe_comp.c 2012-06-24 03:20:46.118154762 +0100
     3@@ -607,6 +607,8 @@
    44       return(sp);
    55    else if (OS == OSAIX)
    66       sp = (ptrbits == 64) ? "-maix64" : "-maix32";
  • new file patches/shell.patch

    diff --git a/patches/shell.patch b/patches/shell.patch
    new file mode 100644
    - +  
     1diff -dNru src.orig/makes/Make.Flp src/makes/Make.Flp
     2--- src.orig/makes/Make.Flp     2013-01-08 19:15:41.000000000 +0100
     3+++ src/makes/Make.Flp  2013-03-27 18:01:17.224597923 +0100
     4@@ -756,7 +756,7 @@
     5 
     6 $(FLAdir)/lapack_$(ARCH).a : $(FLAdir)/make.inc
     7        cd $(FLAdir) ; $(PMAKE) lib
     8-       if [ -e $(FLAdir)/liblapack.a ]; then \
     9+       if [ -f $(FLAdir)/liblapack.a ]; then \
     10            ln -s $(FLAdir)/liblapack.a $(FLAdir)/lapack_$(ARCH).a ; \
     11         fi
     12 
     13diff -dNru src.orig/makes/Make.ttune src/makes/Make.ttune
     14--- src.orig/makes/Make.ttune   2013-01-08 19:15:42.000000000 +0100
     15+++ src/makes/Make.ttune        2013-03-27 18:01:17.020597929 +0100
     16@@ -26,7 +26,7 @@
     17        - rm -f $(sumf)
     18        echo "#ifndef ATLAS_SUMM_H" > $(sumf)
     19        echo "   #define ATLAS_SUMM_H" >> $(sumf)
     20-       if [ -e res/aff.h ]; then \
     21+       if [ -f res/aff.h ]; then \
     22            cat res/aff.h >> $(sumf) ; \
     23         else \
     24            echo "#define ATL_TAFFINITY 0" >> $(sumf) ; \
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    99### Import stuff
    1010######################################################################
    1111
    12 import os, sys, shutil, time
    13 from configuration import conf, cp, try_run, edit_in_place
     12import os, sys, shutil, time, glob
     13from configuration import conf, cp, ln, which, try_run, edit_in_place
    1414
    1515
    1616######################################################################
     
    1818### update ATLAS or LAPACK to a newer version
    1919######################################################################
    2020
     21PATCH_DIR = os.path.join(conf['SPKG_DIR'], 'patches')
     22
     23# the current lapack source tarball
     24LAPACK_TARFILE = os.path.join(conf['SPKG_DIR'], 'lapack-3.4.2.tar')
     25
    2126# temporary directory to build everything in
    2227BUILD_DIR = os.path.join(conf['SPKG_DIR'], 'ATLAS-build')
     28BUILD_LIB_DIR = os.path.join(conf['SPKG_DIR'], 'ATLAS-lib')
    2329
    2430# constants from src/CONFIG/include/atlconf.h
    2531# Note: must be lists, not tuples, for Python-2.4 support
    26 ATLAS_OSTYPE = ['UNKNOWN', 'Linux', 'SunOS', 'SunOS4', 'OSF1',
    27                 'IRIX', 'AIX', 'Win9x', 'WinNT', 'HPUX', 'FreeBSD', 'OSX']
     32ATLAS_OSTYPE = (  # static char *osnam
     33    'UNKNOWN', 'Linux', 'SunOS', 'SunOS4', 'OSF1',
     34    'IRIX', 'AIX', 'Win9x', 'WinNT', 'Win64',
     35    'HPUX', 'FreeBSD', 'OSX')
     36ATLAS_MACHTYPE = (  # static char *machnam
     37    'UNKNOWN', 'POWER3', 'POWER4', 'POWER5', 'PPCG4', 'PPCG5',
     38    'POWER6', 'POWER7', 'IBMz9', 'IBMz10', 'IBMz196',
     39    'x86x87', 'x86SSE1', 'x86SSE2', 'x86SSE3',
     40    'P5', 'P5MMX', 'PPRO', 'PII', 'PIII', 'PM', 'CoreSolo',
     41    'CoreDuo', 'Core2Solo', 'Core2', 'Corei1', 'Corei2', 'Atom', 'P4', 'P4E',
     42    'Efficeon', 'K7', 'HAMMER', 'AMD64K10h', 'AMDDOZER', 'UNKNOWNx86',
     43    'IA64Itan', 'IA64Itan2',
     44    'USI', 'USII', 'USIII', 'USIV', 'UST2', 'UnknownUS',
     45    'MIPSR1xK', 'MIPSICE9', 'ARMv7')
    2846
    29 ATLAS_MACHTYPE = ['UNKNOWN', 'POWER3', 'POWER4', 'POWER5', 'PPCG4', 'PPCG5',
    30                   'P5', 'P5MMX', 'PPRO', 'PII', 'PIII', 'PM', 'CoreSolo',
    31                   'CoreDuo', 'Core2Solo', 'Core2', 'Corei7', 'P4', 'P4E', 'Efficeon', 'K7',
    32                   'HAMMER', 'AMD64K10h', 'UNKNOWNx86', 'IA64Itan', 'IA64Itan2',
    33                   'USI', 'USII', 'USIII', 'USIV', 'UnknownUS', 'MIPSR1xK', 'MIPSICE9']
    34 
    35 ATLAS_ISAEXT = ['', 'AltiVec', 'SSE3', 'SSE2', 'SSE1', '3DNow']
     47ATLAS_ISAEXT = (  # static char *ISAXNAM
     48    'None', 'VSX', 'AltiVec', 'AVXMAC', 'AVXFMA4', 'AVX', 'SSE3', 'SSE2', 'SSE1',
     49    '3DNow', 'NEON' )
    3650
    3751# we need to disable parallel builds
    3852os.environ['MAKE'] += ' -j1'
     53MAKE = os.environ['MAKE']
    3954
     55######################################################################
     56### Some auxiliary functions to facilitate IO and error checking
     57######################################################################
     58
     59# Run shell command "command", but flush stdout and stderr before doing
     60# this. Also echo commands which are executed.
     61def system_with_flush(command):
     62    print 'Running', command
     63    sys.stdout.flush()
     64    sys.stderr.flush()
     65    import subprocess
     66    return subprocess.call(command, shell=True)
     67
     68def assert_success(rc, good=None, bad=None):
     69    if rc == 0: 
     70        if good is not None:
     71            print good
     72        return
     73    print '-'*60
     74    import traceback
     75    traceback.print_stack(file=sys.stdout)
     76    print '-'*60
     77    if bad is not None:
     78        print 'Error: ', bad
     79    sys.exit(rc)
    4080
    4181######################################################################
    4282### Skip building ATLAS on specific systems
    4383######################################################################
    4484
    4585# On Cygwin we simply require that the system-wide lapack is installed.
    46 # This includes BLAS and is enough to build the rest of Sage.
    47 if conf['CYGWIN?']:
    48     lib = '/usr/lib/libblas.dll.a'
    49     if not os.path.exists(lib):
    50         print '*'*75
    51         print 'On Cygwin you must install the standard LAPACK Cygwin package'
    52         print 'via the Cygwin setup.exe program in the "Math" category.'
    53         print '*'*75
    54         sys.exit(1)
    55     cp(lib, os.path.join(conf['SAGE_LOCAL'], 'lib'))
     86# This includes BLAS and LAPACK and is enough to build the rest of Sage.
     87if conf['CYGWIN?'] and not os.environ.has_key('SAGE_ATLAS_ARCH'):
     88    libraries = ['/usr/lib/libblas.dll.a', '/usr/lib/liblapack.dll.a']
     89    for lib in libraries:
     90        if not os.path.exists(lib):
     91            print '*'*75
     92            print 'Could not locate required file: "' + lib + '".'
     93            print 'On Cygwin you must install the following standard LAPACK Cygwin packages'
     94            print 'via the Cygwin setup.exe program in the "Math" category:'
     95            print '* lapack,'
     96            print '* liblapack-devel.'
     97            print 'Alternatively you can try building your own ATLAS by setting'
     98            print 'SAGE_ATLAS_ARCH to something sensible although that is not'
     99            print 'officially supported.'
     100            print '*'*75
     101            sys.exit(1)
     102    for lib in libraries:
     103        cp(lib, os.path.join(conf['SAGE_LOCAL'], 'lib'))
    56104    sys.exit(0)
    57105
    58106
    59 
    60 if conf['Darwin?']:
    61     print 'Skipping build of ATLAS on OSX'
     107if conf['Darwin?'] and not os.environ.has_key('SAGE_ATLAS_ARCH'):
     108    print 'Skipping build of ATLAS on OS X, using system library instead.'
     109    print 'You can try building your own ATLAS by setting SAGE_ATLAS_ARCH'
     110    print 'to something sensible although that is not officially supported.'
     111    if conf['PPC?']:   # OSX 10.4 PPC linker needs help to find the accelerate blas
     112        veclib_dir = '/System/Library/Frameworks/Accelerate.framework/' + \
     113            'Versions/A/Frameworks/vecLib.framework/Versions/A'
     114        for lib in [ 'libBLAS.dylib', 'libLAPACK.dylib']:
     115            ln(os.path.join(veclib_dir, lib),
     116               os.path.join(conf['SAGE_LOCAL'], 'lib', lib))
    62117    sys.exit(0)
    63118
    64119
     
    68123
    69124if os.environ.has_key('SAGE_ATLAS_LIB'):
    70125    ATLAS_LIB = os.environ['SAGE_ATLAS_LIB']
    71     library_extensions = ['.a', '.so', '.dylib']
    72126    libraries = ['libatlas', 'liblapack', 'libcblas', 'libf77blas']
    73127    libraries_optional = ['libptcblas', 'libptf77blas']
    74128
     
    77131            return False
    78132        if not os.path.isdir(path):
    79133            return False
    80         def library_exists(lib):
    81             library_base = os.path.join(path, lib)
    82             return any(os.path.exists(library_base+ext) for ext in library_extensions)
    83         return all(library_exists(lib) for lib in libraries)
     134        filenames = os.listdir(path)
     135        for lib in libraries:
     136            if not any(fname.startswith(lib) for fname in filenames):
     137                print 'Cannot find '+lib+'.* in '+path
     138                return False
     139        return True
    84140
    85     paths = [ os.path.join(ATLAS_LIB, 'lib'),
    86               ATLAS_LIB,
    87               None ]   # None indicates error
     141    paths = [ ATLAS_LIB, os.path.join(ATLAS_LIB, 'lib64'), os.path.join(ATLAS_LIB, 'lib') ]
     142    ATLAS_LIB = None
    88143    for path in paths:
    89144        if is_atlas_lib_path(path):
    90145            ATLAS_LIB = path
    91146            break
    92147
    93     if path is None:
     148    if ATLAS_LIB is None:
    94149        print 'Unable to find one of liblapack, libcblas, libatlas or libf77blas'
    95150        print 'in the directory', ATLAS_LIB
    96151        print 'Set SAGE_ATLAS_LIB to the directory containing liblapack, libcblas,'
    97         print 'libatlas and libf77blas (either .a or .so extensions) if you wish to'
    98         print 'use existing ATLAS libraries. For more details, see'
     152        print 'libatlas and libf77blas (either .a, .so, .dylib extensions) if'
     153        print 'you wish to use existing ATLAS libraries. For more details, see'
    99154        print 'http://sagemath.org/doc/installation/source.html#environment-variables'
    100155        print 'Unset SAGE_ATLAS_LIB to build ATLAS from source.'
    101156        print 'Then type make.'
     
    120175
    121176    SAGE_LOCAL_LIB = os.path.join(conf['SAGE_LOCAL'], 'lib')
    122177    def symlinkOSlibrary(library_basename):
    123         for ext in library_extensions:
    124             lib = library_basename + ext
    125             source = os.path.join(ATLAS_LIB, lib)
    126             destination = os.path.join(SAGE_LOCAL_LIB, lib)
    127             if not os.path.exists(source):
    128                 continue
    129             # ln -sf source destination
     178        filenames = [ fname for fname in os.listdir(path)
     179                      if fname.startswith(library_basename) ]
     180        for fname in filenames:
     181            source = os.path.join(ATLAS_LIB, fname)
     182            destination = os.path.join(SAGE_LOCAL_LIB, fname)
    130183            print 'Symlinking '+source+' -> '+destination
    131184            try:
    132185                os.remove(destination)   
     
    145198### Patch source
    146199######################################################################
    147200
    148 # Apply a TEMPORARY fix to allow ATLAS to build with
    149 # gcc 4.4.0 on Solaris. Implemented 16th June 2009, by David Kirkby.
    150 # One would expect to remove this within a couple of months,
    151 # once the underlying issue in ATLAS is resolved. The patch
    152 # forces GuessSmallNB() in src/tune/blas/gemm/mmsearch.c
    153 # to return 28 as suggested by Clint Whaley.
    154 # Changed on July 19th 2009 (see trac 6558) to be more selective and only
    155 # apply the fix on sun4v machines which are based on the Sun T1, T2 and T2+
    156 # processors (codenamed Niagra). This is because there are no known problems
    157 # on other Sun architectures such as sun4u, or any x86 based Solaris system.
    158 if conf['Solaris?'] and conf['machine'] == 'sun4v':
    159     cp('patches/mmsearch-with-temp-Solaris-fix.c',
    160        'src/tune/blas/gemm/mmsearch.c')
     201# apply all patches
     202for fname in glob.glob(os.path.join(PATCH_DIR,'*.patch')):
     203    rc = system_with_flush('patch -p0 --input '+os.path.join(PATCH_DIR, fname))
     204    assert_success(rc, bad='Applying '+fname+' failed.', good='Applied '+fname+'.')
    161205
    162 # add dynamic libs make install targets to Make.top
    163 cp('patches/Make.top',
    164    'src')
     206# patches/Makefile
     207# fix for Xcode creating directories like xspew.dSYM
    165208
     209# patches/archinfo_linux.c
    166210# add PPC4 7447 CPU and better Itanium2 detection:
    167 cp('patches/archinfo_linux.c',
    168    'src/CONFIG/src/backend/archinfo_linux.c')
    169211
    170 # add Core2Duo and Dunnington CPUids
    171 cp('patches/archinfo_x86.c',
    172    'src/CONFIG/src/backend/archinfo_x86.c')
     212# patches/archinfo_x86.c
     213# add Core2Duo and Dunnington CPUid
    173214
     215# patches/probe_comp.c
    174216# work around "-m64" cflag issue on Itanium
    175 cp('patches/probe_comp.c',
    176    'src/CONFIG/src/probe_comp.c')
    177217
    178 # add K7, Pentium M and non-AltiVec G4 profiles
    179 cp('patches/*tgz',
    180   'src/CONFIG/ARCHS')
     218# add extra architectural defaults
     219# currently IA64Itan264 and x86SSE264SSE2
     220cp('patches/ARCHS/*.tar.bz2', 'src/CONFIG/ARCHS')
    181221
    182222# hardcoded gcc in SpewMakeInc.c
    183223edit_in_place('src/CONFIG/src/SpewMakeInc.c') \
     
    185225    .close()
    186226
    187227
     228# override throttling check if architecture is specified
     229edit_in_place('src/CONFIG/src/config.c') \
     230    .replace('if \(mach == MACHOther\)', 'if (mach != MACHOther) thrchk=0; else') \
     231    .close()
     232
     233shutil.copytree(os.path.join(PATCH_DIR, 'ATLAS-lib'), BUILD_LIB_DIR)
     234
    188235######################################################################
    189236### configure
    190237######################################################################
     
    194241    # ATLAS_ISAEXT) from environment variables:
    195242    arch = None
    196243    isa_ext = None
    197     if os.environ.get('SAGE_FAT_BINARY', 'no') == 'yes' and conf['Intel?']:
    198         print 'Sage "fat" binary mode set: Building SSE2 only Hammer binary'
     244    archdef_dir = None
     245    if conf['generic_binary?']:
     246        print 'Sage "fat" binary mode set: Building "base" binary'
    199247        print 'NOTE: This can result in a Sage that is significantly slower at certain numerical'
    200248        print 'linear algebra since full FAT binary support has not been implemented yet.'
    201         arch = 'HAMMER'
    202         isa_ext = ('SSE2', 'SSE1')
     249        arch, isa_ext, archdef_dir = configure_base()
    203250    elif os.environ.has_key('SAGE_ATLAS_ARCH'):
    204251        opts = os.environ['SAGE_ATLAS_ARCH'].split(',')
    205252        arch = opts[0]
     253        if arch not in ATLAS_MACHTYPE + ('fast', 'base'):
     254            print 'SAGE_ATLAS_ARCH architecture must be one of '+ ', '.join(ATLAS_MACHTYPE)
     255            sys.exit(1)
    206256        if len(opts)>0:
    207257            isa_ext = opts[1:]
    208     return (arch, isa_ext)
     258        if not all(ext in ATLAS_ISAEXT for ext in isa_ext):
     259            print 'SAGE_ATLAS_ARCH ISA extension must be one of '+ ', '.join(ATLAS_ISAEXT)
     260            sys.exit(1)
     261    return (arch, isa_ext, archdef_dir)
    209262
    210263
    211 def configure(arch=None, isa_ext=None):
     264def configure(arch=None, isa_ext=None, archdef_dir=None):
    212265    """
    213266    Configure for ``arch``.
    214267
     
    219272    - ``isa_ext`` -- ``None`` or a sublist of ``ATLAS_ISAEXT``
    220273    """
    221274    if arch is None:
    222         arch, isa_ext = configure_options_from_environment()
     275        arch, isa_ext, archdef_dir = configure_options_from_environment()
    223276    if arch=='fast':
    224         return configure_fast()
    225     if arch=='base':
    226         return configure_base()
     277        arch, isa_ext, archdef_dir = configure_fast()
     278    if arch=='generic' or arch=='base':
     279        arch, isa_ext, archdef_dir = configure_base()
    227280
    228     print 'Running configure with arch =', arch, 'and isa extensions', isa_ext
     281    print 'Running configure with arch = '+str(arch)+ \
     282        ', isa extensions '+str(isa_ext)+ \
     283        ', archdef dir '+str(archdef_dir)
    229284    os.chdir(conf['SPKG_DIR'])
    230285    if os.path.isdir(BUILD_DIR):
    231286        shutil.rmtree(BUILD_DIR)
    232287    os.mkdir(BUILD_DIR)
    233288    os.chdir(BUILD_DIR)
    234289
     290    # We need to provide full pathes to FC and CC to ATLAS configure script,
     291    # so that it does not use 'find' and travel around the filesystem to find
     292    # them.
     293    # We first split the compiler executable names from potential options, e.g.
     294    # as in 'gcc -m64', then use 'which' to locate them, and finally add the
     295    # options back.
     296    FC = os.environ['FC']
     297    FCsplit = FC.find(' ')
     298    if  FCsplit != -1:
     299        FCbin, FCopt = FC[:FCsplit], FC[FCsplit:]
     300    else:
     301        FCbin, FCopt = FC, ''
     302
     303    CC = os.environ['CC']
     304    CCsplit = CC.find(' ')
     305    if  CCsplit != -1:
     306        CCbin, CCopt = CC[:CCsplit], CC[CCsplit:]
     307    else:
     308        CCbin, CCopt = CC, ''
     309
    235310    cmd = '../src/configure'
    236311    cmd += ' --prefix=' + conf['SAGE_LOCAL']
    237     cmd += ' --with-netlib-lapack=' + os.path.join(conf['SAGE_LOCAL'],'lib','liblapack.a')
    238     cmd += ' --cc="' + os.environ['CC'] + '"'
     312    cmd += ' --with-netlib-lapack-tarfile=' + LAPACK_TARFILE
     313    cmd += ' --cc="' + CC + '"'
    239314
    240     # -Si cputhrchk 0: Ignore/heed CPU throttle probe
    241     cmd += ' -Si cputhrchk 0'
     315    ## -Si latune 1: enable lapack tuning
     316    ## typically adds 3-4 hours of install time
     317    cmd += ' -Si latune 0'
    242318
    243319    # -Fa alg -fPIC: set flags so we can build dynamic libraries
    244320    cmd += ' -Fa alg -fPIC'
     
    247323    #cmd += ' -t 0'
    248324
    249325    # set fortran compiler
    250     cmd += ' -C if sage_fortran'
     326    cmd += ' -C if "' + which(FCbin) + FCopt + '"'
    251327
    252328    # set C compiler
    253     cmd += ' -C xc "' + os.environ['CC'] + '"'
    254     cmd += ' -C ic "' + os.environ['CC'] + '"'
    255     cmd += ' -C dm "' + os.environ['CC'] + '"'
    256     cmd += ' -C sm "' + os.environ['CC'] + '"'
    257     cmd += ' -C dk "' + os.environ['CC'] + '"'
    258     cmd += ' -C sk "' + os.environ['CC'] + '"'
     329    cmd += ' -C acg "' + which(CCbin) + CCopt + '"'
    259330
    260331    # set bit width
    261332    cmd += ' -b ' + conf['bits'][0:2]
    262333
    263334    # set OS type
    264     system = None
    265335    try:
    266        system = ATLAS_OSTYPE.index(conf['system'])
    267     except KeyError:
    268        if conf['Darwin?']: system = ATLAS_OSTYPE.index('OSX')
    269        if conf['CYGWIN?']: system = ATLAS_OSTYPE.index('WinNT')
    270     if not system is None:
    271        cmd += ' -O '+str(system)
     336        if conf['Darwin?']:
     337            atlas_osnam = 'OSX'
     338        elif conf['CYGWIN?']:
     339            atlas_osnam = 'WinNT'
     340        else:
     341            atlas_osnam = conf['system']
     342        atlas_system = ATLAS_OSTYPE.index(atlas_osnam)
     343        cmd += ' -O '+str(atlas_system)
     344    except ValueError:
     345        pass
    272346
    273347    # set machine architecture
    274     if not arch is None:
    275        cmd += ' -A '+str(ATLAS_MACHTYPE.index(arch))
     348    if arch is not None:
     349        cmd += ' -A '+str(ATLAS_MACHTYPE.index(arch))
    276350
    277351    # set cpu instruction set extensions
    278     if not isa_ext is None:
     352    if isa_ext is not None:
    279353        isa_extension = sum(1 << ATLAS_ISAEXT.index(x) for x in isa_ext)
    280354        cmd += ' -V '+str(isa_extension)
    281355
    282     print 'Running', cmd
    283     rc = os.system(cmd)
     356    # use a predefined archdef file in the archdef_dir directory
     357    if archdef_dir is not None:
     358        cmd += ' -Ss ADdir '+str(archdef_dir)
     359
     360    rc = system_with_flush(cmd)
    284361    return rc
    285362
    286363
    287364def configure_fast():
    288    if conf['Intel?']:
    289       print 'Fast configuration on Intel compatible CPUs.'
    290       arch = 'HAMMER'
    291       isa_ext = ('SSE3', 'SSE2', 'SSE1')
    292    elif conf['SPARC?']:
    293       print 'Fast configuration on SPARC.'
    294       arch = 'USIV'
    295       isa_ext = ()
    296    elif conf['PPC?']:
    297       print 'Fast configuration on PPC.'
    298       arch = 'POWER5'
    299       isa_ext = ('AltiVec', )
    300    elif conf['IA64?']:
    301       print 'Fast configuration on Itanium.'
    302       arch = 'IA64Itan2'
    303       isa_ext = ()
    304    else:
    305       raise NotImplementedError, 'I don\'t know a "fast" configuration for your cpu.'
    306    return configure(arch, isa_ext)
     365    if conf['Intel?'] and conf['64bit?']:
     366        print 'Fast configuration on Intel x86_64 compatible CPUs.'
     367        arch = 'P4E'
     368        isa_ext = ('SSE3', 'SSE2', 'SSE1')
     369        archdef_dir = None
     370    elif conf['Intel?'] and conf['32bit?']:
     371        print 'Fast configuration on Intel i386 compatible CPUs.'
     372        arch = 'x86SSE3'
     373        isa_ext = ('SSE3', 'SSE2', 'SSE1')
     374        archdef_dir = None
     375    elif conf['SPARC?']:
     376        print 'Fast configuration on SPARC.'
     377        arch = 'USIV'
     378        isa_ext = ()
     379        archdef_dir = None
     380    elif conf['PPC?']:
     381        print 'Fast configuration on PPC.'
     382        arch = 'PPCG5'
     383        isa_ext = ('AltiVec', )
     384        archdef_dir = None
     385    elif conf['IA64?']:
     386        print 'Fast configuration on Itanium.'
     387        arch = 'IA64Itan2'
     388        isa_ext = ()
     389        archdef_dir = None
     390    else:
     391        raise NotImplementedError, 'I don\'t know a "fast" configuration for your cpu.'
     392    return (arch, isa_ext, archdef_dir)
    307393
    308394
    309395def configure_base():
    310    if conf['Intel?']:
    311       print 'Base configuration on Intel compatible CPUs.'
    312       arch = 'P4'
    313       isa_ext = ('SSE2', 'SSE1')
    314    elif conf['SPARC?']:
    315       print 'Base configuration on SPARC.'
    316       arch = 'USIII'
    317       isa_ext = ()
    318    elif conf['PPC?']:
    319       print 'Base configuration on PPC.'
    320       arch = 'POWER4'
    321       isa_ext = ()
    322    elif conf['IA64?']:
    323       print 'Base configuration on Itanium.'
    324       arch = 'IA64Itan'
    325       isa_ext = ()
    326    else:
    327       raise NotImplementedError, 'I don\'t know a "base" configuration for your cpu.'
    328    return configure(arch, isa_ext)
     396    if conf['Intel?'] and conf['64bit?']:
     397        print 'Generic configuration on Intel x86_64 compatible CPUs.'
     398        arch = 'x86SSE2'
     399        isa_ext = ('SSE2', 'SSE1')
     400        archdef_dir = PATCH_DIR
     401    elif conf['Intel?'] and conf['32bit?']:
     402        print 'Generic configuration on Intel i386 compatible CPUs.'
     403        arch = 'x86x87'
     404        isa_ext = ('3DNow',)
     405        archdef_dir = None
     406    elif conf['SPARC?']:
     407        print 'Base configuration on SPARC.'
     408        arch = 'USIII'
     409        isa_ext = ()
     410        archdef_dir = None
     411    elif conf['PPC?']:
     412        print 'Base configuration on PPC.'
     413        arch = 'PPCG4'
     414        isa_ext = ()
     415        archdef_dir = None
     416    elif conf['IA64?']:
     417        print 'Base configuration on Itanium.'
     418        arch = 'IA64Itan'
     419        isa_ext = ()
     420        archdef_dir = None
     421    else:
     422        raise NotImplementedError, 'I don\'t know a "base" configuration for your cpu.'
     423    return (arch, isa_ext, archdef_dir)
    329424
    330425
    331426
     
    334429### make
    335430######################################################################
    336431
    337 def make_core():
     432def make_atlas():
    338433    os.chdir(BUILD_DIR)
    339     rc = os.system('$MAKE')
     434    rc = system_with_flush(MAKE)
    340435    return rc
    341436
    342 def make_atlas_library():
    343     os.chdir(os.path.join(BUILD_DIR, 'lib'))
    344437
    345     # don't put the path into the soname or we can't relocate it
    346     edit_in_place('Makefile') \
    347         .replace('-soname \$\(LIBINSTdir\)/lib', '-soname lib') \
    348         .close()
     438def configure_atlas_library():
     439    os.chdir(BUILD_LIB_DIR)
     440    static_library_dir = os.path.join(BUILD_DIR, 'lib')
     441    for static_lib in glob.glob(os.path.join(static_library_dir, 'lib*.a')):
     442        shutil.copy(static_lib, BUILD_LIB_DIR)
     443    cmd = './configure'
     444    cmd += ' --prefix=' + conf['SAGE_LOCAL']
     445    cmd += ' --libdir=' + os.path.join(conf['SAGE_LOCAL'],'lib')
     446    cmd += ' --disable-static'
     447    return system_with_flush(cmd)
     448   
    349449
    350     if conf['linker_Solaris?']:
    351         print "The Makefile generated in ATLAS for building shared libraries"
    352         print "assumes the linker is the GNU linker, which it not true in"
    353         print "your setup. (It is generally considered better to use the"
    354         print "Sun linker in /usr/ccs/bin rather than the GNU linker from binutils)"
    355         print "The linker flags in `pwd`/Makefile will be changed. "
    356         print "'-shared' will be changed to '-G'"
    357         print "'-soname' will be changed to '-h'"
    358         print "'--whole-archive' will be changed to '-zallextract'"
    359         print "'--no-whole-archive' will be changed to '-zdefaultextract'"
    360         edit_in_place('Makefile') \
    361             .replace('-shared', '-G') \
    362             .replace('-soname', '-h') \
    363             .replace('--whole-archive', '-z allextract') \
    364             .replace('--no-whole-archive', '-z defaultextract') \
    365             .close()
    366         if conf['Intel?']:
    367             print "Change ldflag -melf_x86_64 to -64 as needed for Sun ld"
    368             print "on 64-bit builds of ATLAS on x64 hardware"
    369             edit_in_place('Make.inc').replace('-melf_x86_64', '-64').close()
    370             print "Remove the linker flag -melf_i386 as needed for Sun ld"
    371             print "on 32-bit builds of ATLAS on x86/x64 hardware"
    372             edit_in_place('Make.inc').replace('-melf_i386', '').close()
    373        
    374     rc = os.system('$MAKE shared cshared')
    375     return rc
     450def make_atlas_library(target=None):
     451    os.chdir(BUILD_LIB_DIR)
     452    if target is None:
     453        return system_with_flush(MAKE)
     454    else:
     455        return system_with_flush(MAKE + ' ' + target)
    376456
    377457
    378 def make_lapack_library():
    379     os.chdir(os.path.join(BUILD_DIR, 'lib'))
    380     sage_local_lib_dir = ' -L' + os.path.join(conf['SAGE_LOCAL'],'lib')
     458######################################################################
     459### make and save archdef
     460######################################################################
    381461
    382     libraries = []
    383     if conf['Linux?'] or conf['FreeBSD?']:
    384         if conf['fortran_g95?']:
    385             fortran_dir = '-L'+conf['fortran_g95_dir']
    386             fortran_lib = '-lf95'
    387         else:
    388             fortran_dir = ''
    389             fortran_lib = '-lgfortran'
    390         libraries = ['liblapack', 'libf77blas']
    391         # call gcc instead of ld in order to find libgfortran.so
    392         cmd = os.environ['CC'] + ' ' + fortran_dir + sage_local_lib_dir + \
    393             ' -shared -Wl,-soname,{0}.so ' + \
    394             '  -Wl,-whole-archive {0}.a -Wl,-no-whole-archive' + \
    395             ' -o {0}.so -lc -lm ' + fortran_lib
    396 
    397     if conf['Solaris?']:
    398         if conf['64bit?']:
    399             linker_flag_64 = '-64'
    400         else:
    401             linker_flag_64 = ''
    402         libraries = ['libatlas', 'libf77blas', 'libcblas']
    403         cmd = '/usr/ccs/bin/ld ' + linker_flag_64 + sage_local_lib_dir + \
    404             ' -G -h {0}.so -o {0}.so  -zallextract {0}.a -zdefaultextract -lc -lm -lgfortran'
    405        
    406     rc = 0
    407     for LIB in libraries:
    408         cmd_LIB = cmd.format(LIB)
    409         print 'Running', cmd_LIB
    410         rc_LIB = os.system(cmd_LIB)
    411         if rc_LIB!=0:
    412             print 'Failed to build ATLAS library '+LIB+'.so'
    413         rc = max(rc, abs(rc_LIB))
    414        
    415     # liblapack.so causes problems with R on Solaris.
    416     if conf['Solaris?']:
    417         try:
    418             os.remove('liblapack.so')
    419         except OSError:
    420             pass
    421 
    422     return rc
    423 
     462def build_and_save_archdef():
     463    try:
     464        ARCHDEF_SAVE_DIR = os.environ['SAGE_ATLAS_SAVE_ARCHDEF']
     465    except KeyError:
     466        return
     467    os.chdir(os.path.join(BUILD_DIR, 'ARCHS'))
     468    rc = system_with_flush(MAKE + ' ArchNew')
     469    assert_success(rc, bad='Making archdef failed.', good='Finished building archdef.')
     470    rc = system_with_flush(MAKE + ' tarfile')
     471    assert_success(rc, bad='Making archdef tarfile failed.', good='Finished building archdef tarfile.')
     472    for tarfile in glob.glob('*.tar.bz2'):
     473        cp(tarfile, ARCHDEF_SAVE_DIR)
     474   
    424475
    425476######################################################################
    426477### build atlas and lapack
    427478######################################################################
    428479
    429 def build(arch=None, isa_ext=None):
    430     rc = configure(arch, isa_ext)   
    431     assert rc==0, 'Configure failed!'
    432     print 'Finished configuring ATLAS.'
    433     rc = make_core()
     480def build(arch=None, isa_ext=None, archdef_dir=None):
     481    """
     482    Configure/build with given architectural information.
     483
     484    Return ``0`` if successfull.
     485    """
     486    rc = configure(arch, isa_ext, archdef_dir)   
     487    assert_success(rc, bad='Configure failed.', good='Finished configuring ATLAS.')
     488    return make_atlas()
     489
     490def build_tuning():
     491    """
     492    Configure/build by going through the full tuning process.
     493
     494    Return ``0`` if successfull.
     495    """
     496    rc = configure()
    434497    if rc!=0:
    435         print 'ATLAS failed to build, possibly because of a loaded system.'
     498        print 'Configure failed, possibly because you have CPU throttling enabled.'
     499        print 'Skipping tuning attempts.'
     500        return rc
     501    print 'First attempt: automatic tuning.'
     502    rc = make_atlas()
     503    if rc==0:
     504        return rc
     505    print 'ATLAS failed to build, possibly because of throttling or a loaded system.'
     506    print 'Waiting 1 minute...'
     507    sys.stdout.flush()
     508    time.sleep(60)
     509    print 'Second attempt: Re-running make.'
     510    return make_atlas()
     511
     512
     513#
     514# Workaround for specific platforms: Disable tuning and go straight to
     515# fast/base architectural defaults
     516#
     517skip_tuning = conf['IA64?']    # Itanium is dead and tuning is broken
     518
     519
     520rc = None
     521if os.environ.has_key('SAGE_ATLAS_ARCH') or conf['generic_binary?']:
     522    print 'Building using specific architecture.'
     523    rc = build()
     524else:
     525    print 'Configuring ATLAS.'
     526    if skip_tuning:
     527        print 'Skipping tuning attempts (skip_tuning = True).'
     528        rc = 1    # Fake failed tuning attempts
    436529    else:
    437         print 'Finished building ATLAS core.'
    438     return rc
     530        rc = build_tuning()
     531    if rc!=0:
     532        print 'Third attempt: use "fast" options.'
     533        rc = build(arch='fast')
     534    if rc!=0:
     535        print 'Fourth attempt: use "base" options.'
     536        rc = build(arch='base')
    439537
     538assert_success(rc, bad='Failed to build ATLAS.', good='Finished building ATLAS core.')
    440539
    441 print 'First attempt: automatic tuning.'
    442 rc = build()
    443 if rc!=0:
    444     print 'Waiting 5 minutes...'
    445     time.sleep(5*60)
    446     print 'Second attempt: Re-running make.'
    447     rc = make_core()
    448     if rc!=0:
    449         print 'Waiting 5 minutes...'
    450         time.sleep(5*60)
    451         try:
    452             print 'Third attempt: use "fast" options.'
    453             rc = build(arch='fast')
    454             if rc!=0:
    455                 print 'Fourth attempt: use "base" options.'
    456                 rc = build(arch='base')
    457         except NotImplementedError:
    458             pass
     540build_and_save_archdef()
    459541
    460 assert rc==0, 'Failed to build ATLAS.'
    461 print 'Finished building ATLAS core.'
     542rc = configure_atlas_library()
     543assert_success(rc, bad='Configuring shared ATLAS library failed.',
     544               good='Finished configuring shared ATLAS library.')
    462545
    463546rc = make_atlas_library()
    464 assert rc==0, 'Building shared ATLAS library failed.'
    465 print 'Finished building shared ATLAS library.'
    466 
    467 rc = make_lapack_library()
    468 assert rc==0, 'Building LAPACK+ATLAS library failed.'
    469 print 'Finished building LAPACK+ATLAS library.'
     547if rc!=0:
     548    print 'Failed to build serial+parallel shared libraries, possibly because your'
     549    print 'system does not support both. Trying to build serial libraries only.'
     550    rc = make_atlas_library('all_serial')
     551    have_parallel_libs = False
     552else:
     553    have_parallel_libs = True
     554assert_success(rc, bad='Building shared ATLAS library failed.',
     555               good='Finished building shared ATLAS library.')
    470556
    471557
    472558######################################################################
    473559### install
    474560######################################################################
    475561
    476 def install():
    477     library_extensions = ['.a', '.so', '.dylib']
    478     libraries = ['libatlas', 'liblapack', 'libcblas', 'libf77blas', 'libptcblas', 'libptf77blas']
    479     for lib in libraries:
    480         for ext in library_extensions:
    481             try:
    482                 filename = os.path.join(conf['SAGE_LOCAL'], 'lib', lib+ext)
    483                 os.remove(filename)
    484                 print('Removed file from previous installation: '+filename)
    485             except OSError:
    486                 pass
    487     os.chdir(BUILD_DIR)
    488     rc = os.system('$MAKE install')
    489     os.chdir('..')
    490     return rc
     562if have_parallel_libs:
     563    rc = make_atlas_library('install')
     564else:
     565    rc = make_atlas_library('install_serial')
     566assert_success(rc, bad='Installing the shared ATLAS library failed.',
     567               good='Finished installing shared ATLAS library.')
    491568
    492 rc = install()
    493 assert rc==0, 'Make install for ATLAS failed.'
    494 # will automatically print "Finished installing atlas-<version>.spkg"
    495569
     570cp(os.path.join(PATCH_DIR, 'atlas-config'),
     571   os.path.join(conf['SAGE_LOCAL'], 'bin'))
    496572