Ticket #13210: atlas-3.8.4.p1-p2-nodelete.diff

File atlas-3.8.4.p1-p2-nodelete.diff, 13.8 KB (added by jdemeyer, 10 years ago)

Diff for the atlas spkg (without deleted files). For reference / review only.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    2121
    2222== Dependencies ==
    2323
     24 * GNU patch
    2425 * Python
    25  * Fortran
    2626 * Lapack
    2727
    2828== Build Instructions/Notes ==
    2929
     30Patches:
    3031 * patches/archinfo_linux.c.patch: Fix Itanium2 support on modern
    3132   RHEL 5 and SLES 10 systems
    3233 * patches/archinfo_x86.c.patch: add cpuid support for Pentium D, E models
    3334 * patches/Make.top.patch: add make install target for shared libs
    3435 * patches/probe_comp.c.patch: work around -m64 issue on Itanium2
    35  * Tuning info for K732SSE1.tgz, PM32SSE2.tgz and PPCG432.tgz
    3636 * Changes linker flags on Solaris if the Sun linker is used.
     37
    3738 * 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.
     39 * Changing this package, which takes a long time to build, so it did
     40   not use Python, would allow the ATLAS build to be started sooner in
     41   parallel builds. This should reduce the overall time to build Sage.
    4242 * The package is never installed on Cygwin or OS X.
    4343
    4444The package can be configured via two environment variables:
     
    7979
    8080== TODO ==
    8181
    82  * The build is currently disabled on OSX until we sort out some
    83    linking issues on OSX.
     82 * The build is currently disabled on OS X until we sort out some
     83   linking issues on OS X.
    8484
    8585 * On FreeBSD dynamic libraries don't work since the wrong flags are
    86    passed to the linker. This will be fixed soon.
     86   passed to the linker.
    8787
    8888== ChangeLog ==
    8989
     90=== atlas-3.8.4.p2 (Jeroen Demeyer, 6 July 2012) ===
     91 * Trac #13210: Flush stdout and stderr before calling system().
     92 * Detect the Apple linker (which is still unsupported).
     93 * Remove unneeded .orig files in patches/
     94 * Remove mmsearch-with-temp-Solaris-fix.c patch (was needed for
     95   gcc-4.4.0 on Solaris).
     96 * Remove copying of patches/*tgz since there are no such files.
     97 * Use 'patch' for patching.
     98
    9099=== atlas-3.8.4.p1 (Jeroen Demeyer, 15 January 2012) ===
    91100 * Trac #12312: Completely disable parallel make everywhere
    92101
  • 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
     
    2829# Intel?, PPC?, SPARC?                          # processor
    2930# 64bit?, 32bit?                                # bit width
    3031# fortran_g95?, fortran_GNU?                    # sage_fortran
    31 # linker_GNU?, linker_Solaris?                  # ld
     32# linker_GNU?, linker_Solaris?, linker_Darwin?  # ld
    3233
    3334
    3435######################################################################
     
    102103except KeyError:
    103104    conf['system'] = platform.system()
    104105
     106try:
     107    conf['release'] = subprocess.check_output(['uname', '-r'])
     108except subprocess.CalledProcessError:
     109    conf['release'] = ""
     110
    105111conf['Linux?'  ] = (conf['system'] == 'Linux')
    106112conf['Solaris?'] = (conf['system'] == 'SunOS')
    107113conf['Darwin?' ] = (conf['system'] == 'Darwin')
     
    178184    conf['ld'] = 'GNU'
    179185elif 'Solaris' in ld_version:
    180186    conf['ld'] = 'Solaris'
     187elif 'Apple' in ld_version:
     188    conf['ld'] = 'Darwin'
    181189else:
    182190    print 'Unknown linker: '+ld_version
    183191    conf['ld'] = None
    184192
    185193conf['linker_GNU?'] = (conf['ld'] == 'GNU')
    186194conf['linker_Solaris?'] = (conf['ld'] == 'Solaris')
     195conf['linker_Darwin?'] = (conf['ld'] == 'Darwin')
    187196
    188197
    189198if conf['Solaris?'] and conf['linker_GNU?']:
    190     print "WARNING: You are using the GNU linker from 'binutils'"
    191     print "Generally it is considered better to use the Sun linker"
    192     print "but Sage has been built on Solaris using the GNU linker"
    193     print "although that was a very old version of Sage, which"
    194     print "never passes all the Sage test-suite."
    195 
     199    print "WARNING: You are using the GNU linker from 'binutils'. You should use"
     200    print "the Sun linker instead. Your build of Sage will likely fail."
    196201
    197202
    198203######################################################################
  • patches/Make.top.patch

    diff --git a/patches/Make.top.patch b/patches/Make.top.patch
    a b  
    1 --- Make.top.orig       2011-06-15 10:39:42.662647485 -0700
    2 +++ Make.top    2011-05-31 21:26:57.647613110 -0700
     1diff -ru src/Make.top b/Make.top
     2--- src/Make.top        2011-05-14 19:33:23.000000000 +0200
     3+++ b/Make.top  2012-07-06 15:39:39.583372141 +0200
    34@@ -299,4 +299,11 @@
    45        - cp $(LIBdir)/libptcblas.a $(INSTdir)/.
    56        - cp $(LIBdir)/libptf77blas.a $(INSTdir)/.
  • 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
     1diff -ru src/CONFIG/src/backend/archinfo_linux.c b/CONFIG/src/backend/archinfo_linux.c
     2--- src/CONFIG/src/backend/archinfo_linux.c     2011-05-14 19:33:24.000000000 +0200
     3+++ b/CONFIG/src/backend/archinfo_linux.c       2012-07-06 15:40:34.383360004 +0200
    34@@ -100,12 +100,12 @@
    45       break;
    56    case AFIA64:
  • patches/archinfo_x86.c.patch

    diff --git a/patches/archinfo_x86.c.patch b/patches/archinfo_x86.c.patch
    a b  
    1 --- archinfo_x86.c.orig 2011-06-15 10:28:37.211647802 -0700
    2 +++ archinfo_x86.c      2011-06-15 10:28:55.407647793 -0700
     1diff -ru src/CONFIG/src/backend/archinfo_x86.c b/CONFIG/src/backend/archinfo_x86.c
     2--- src/CONFIG/src/backend/archinfo_x86.c       2011-05-14 19:33:24.000000000 +0200
     3+++ b/CONFIG/src/backend/archinfo_x86.c 2012-07-06 15:41:10.443359458 +0200
    34@@ -303,6 +303,7 @@
    45          break;
    56       case 15:
  • 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
     1diff -ru src/CONFIG/src/probe_comp.c b/CONFIG/src/probe_comp.c
     2--- src/CONFIG/src/probe_comp.c 2011-05-14 19:33:24.000000000 +0200
     3+++ b/CONFIG/src/probe_comp.c   2012-07-06 15:41:46.213361912 +0200
    34@@ -532,6 +532,8 @@
    45       return(sp);
    56    else if (OS == OSAIX)
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    2222BUILD_DIR = os.path.join(conf['SPKG_DIR'], 'ATLAS-build')
    2323
    2424# constants from src/CONFIG/include/atlconf.h
    25 # Note: must be lists, not tuples, for Python-2.4 support
    2625ATLAS_OSTYPE = ['UNKNOWN', 'Linux', 'SunOS', 'SunOS4', 'OSF1',
    2726                'IRIX', 'AIX', 'Win9x', 'WinNT', 'HPUX', 'FreeBSD', 'OSX']
    2827
     
    3635
    3736# we need to disable parallel builds
    3837os.environ['MAKE'] += ' -j1'
     38MAKE = os.environ['MAKE']
    3939
    4040
     41def system_with_flush(str, verbose=True):
     42    """
     43    Execute ``os.system(str)``, but flush stdout and stderr before.
     44    If ``verbose=True`` (the default), also echo commands being run.
     45    """
     46    if verbose:
     47        print "Running", str
     48    sys.stdout.flush()
     49    sys.stderr.flush()
     50    return os.system(str)
     51
    4152######################################################################
    4253### Skip building ATLAS on specific systems
    4354######################################################################
     
    5869
    5970
    6071if conf['Darwin?']:
    61     print 'Skipping build of ATLAS on OSX'
     72    print 'Skipping build of ATLAS on OS X'
    6273    sys.exit(0)
    6374
    64 
    6575######################################################################
    6676### Use SAGE_ATLAS_LIB='directory' if provided
    6777######################################################################
     
    145155### Patch source
    146156######################################################################
    147157
    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')
    161 
    162 # add dynamic libs make install targets to Make.top
    163 cp('patches/Make.top',
    164    'src')
    165 
    166 # add PPC4 7447 CPU and better Itanium2 detection:
    167 cp('patches/archinfo_linux.c',
    168    'src/CONFIG/src/backend/archinfo_linux.c')
    169 
    170 # add Core2Duo and Dunnington CPUids
    171 cp('patches/archinfo_x86.c',
    172    'src/CONFIG/src/backend/archinfo_x86.c')
    173 
    174 # work around "-m64" cflag issue on Itanium
    175 cp('patches/probe_comp.c',
    176    'src/CONFIG/src/probe_comp.c')
    177 
    178 # add K7, Pentium M and non-AltiVec G4 profiles
    179 cp('patches/*tgz',
    180    'src/CONFIG/ARCHS')
     158rc = system_with_flush("""
     159cd src
     160for patch in ../patches/*.patch; do
     161    patch -p1 <"$patch"
     162    if [ $? -ne 0 ]; then
     163        echo >&2 "Error applying '$patch'"
     164        exit 1
     165    fi
     166done
     167""", verbose=False)
     168if rc != 0:
     169    sys.exit(rc)
    181170
    182171# hardcoded gcc in SpewMakeInc.c
    183172edit_in_place('src/CONFIG/src/SpewMakeInc.c') \
     
    261250    cmd += ' -b ' + conf['bits'][0:2]
    262251
    263252    # set OS type
    264     system = None
    265253    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)
     254        if conf['Darwin?']:
     255            atlas_osnam = 'OSX'
     256        elif conf['CYGWIN?']:
     257            atlas_osnam = 'WinNT'
     258        else:
     259            atlas_osnam = conf['system']
     260        atlas_system = ATLAS_OSTYPE.index(atlas_osnam)
     261        cmd += ' -O %i' % atlas_system
     262    except ValueError:
     263        pass
    272264
    273265    # set machine architecture
    274266    if not arch is None:
    275        cmd += ' -A '+str(ATLAS_MACHTYPE.index(arch))
     267        cmd += ' -A '+str(ATLAS_MACHTYPE.index(arch))
    276268
    277269    # set cpu instruction set extensions
    278270    if not isa_ext is None:
    279271        isa_extension = sum(1 << ATLAS_ISAEXT.index(x) for x in isa_ext)
    280272        cmd += ' -V '+str(isa_extension)
    281273
    282     print 'Running', cmd
    283     rc = os.system(cmd)
     274    rc = system_with_flush(cmd)
    284275    return rc
    285276
    286277
     
    336327
    337328def make_core():
    338329    os.chdir(BUILD_DIR)
    339     rc = os.system('$MAKE')
     330    rc = system_with_flush(MAKE)
    340331    return rc
    341332
    342333def make_atlas_library():
     
    370361            print "Remove the linker flag -melf_i386 as needed for Sun ld"
    371362            print "on 32-bit builds of ATLAS on x86/x64 hardware"
    372363            edit_in_place('Make.inc').replace('-melf_i386', '').close()
     364    elif conf['linker_Darwin?']:  # Not yet supported
     365        print "Fixing Make.inc for Apple linker"
     366        edit_in_place('Make.inc') \
     367            .replace('-melf_i386', '-arch i386') \
     368            .replace('-melf_x86_64', '-arch x86_64') \
     369            .close()
    373370       
    374     rc = os.system('$MAKE shared cshared')
     371    rc = system_with_flush(MAKE + ' shared cshared')
    375372    return rc
    376373
    377374
     
    406403    rc = 0
    407404    for LIB in libraries:
    408405        cmd_LIB = cmd.format(LIB)
    409         print 'Running', cmd_LIB
    410         rc_LIB = os.system(cmd_LIB)
     406        rc_LIB = system_with_flush(cmd_LIB)
    411407        if rc_LIB!=0:
    412408            print 'Failed to build ATLAS library '+LIB+'.so'
    413409        rc = max(rc, abs(rc_LIB))
     
    428424
    429425def build(arch=None, isa_ext=None):
    430426    rc = configure(arch, isa_ext)   
    431     assert rc==0, 'Configure failed!'
    432     print 'Finished configuring ATLAS.'
     427    if rc != 0:
     428        print 'Error configuring ATLAS'
     429        sys.exit(rc)
     430    print 'Finished configuring ATLAS'
    433431    rc = make_core()
    434432    if rc!=0:
    435         print 'ATLAS failed to build, possibly because of a loaded system.'
    436     else:
    437         print 'Finished building ATLAS core.'
     433        print 'ATLAS failed to build, possibly because of a loaded system'
    438434    return rc
    439435
    440436
     
    457453        except NotImplementedError:
    458454            pass
    459455
    460 assert rc==0, 'Failed to build ATLAS.'
    461 print 'Finished building ATLAS core.'
     456if rc != 0:
     457    print 'Error building ATLAS core'
     458    sys.exit(rc)
     459print 'Finished building ATLAS core'
    462460
    463461rc = make_atlas_library()
    464 assert rc==0, 'Building shared ATLAS library failed.'
    465 print 'Finished building shared ATLAS library.'
     462if rc != 0:
     463    print 'Error building shared ATLAS library'
     464    sys.exit(rc)
     465print 'Finished building shared ATLAS library'
    466466
    467467rc = make_lapack_library()
    468 assert rc==0, 'Building LAPACK+ATLAS library failed.'
    469 print 'Finished building LAPACK+ATLAS library.'
     468if rc != 0:
     469    print 'Error building LAPACK+ATLAS library'
     470    sys.exit(rc)
     471print 'Finished building LAPACK+ATLAS library'
    470472
    471473
    472474######################################################################
     
    485487            except OSError:
    486488                pass
    487489    os.chdir(BUILD_DIR)
    488     rc = os.system('$MAKE install')
     490    rc = system_with_flush(MAKE + ' install')
    489491    os.chdir('..')
    490492    return rc
    491493
    492494rc = install()
    493 assert rc==0, 'Make install for ATLAS failed.'
     495if rc != 0:
     496    print 'Error installing ATLAS'
     497    sys.exit(rc)
    494498# will automatically print "Finished installing atlas-<version>.spkg"
    495 
    496