Ticket #14699: atlas-3.10.1.p1.diff

File atlas-3.10.1.p1.diff, 7.2 KB (added by jdemeyer, 6 years ago)
  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    8989
    9090== ChangeLog ==
    9191
     92=== atlas-3.10.1.p1, lapack-3.4.2 (Volker Braun, Jean-Pierre Flori, 7 June 2013) ===
     93 * Trac #14699: Install ATLAS header files
     94
    9295=== atlas-3.10.1.p0, lapack-3.4.2 (Jean-Pierre Flori, 26 February 2013) ===
    9396 * Trac #10508: Update ATLAS to version 3.10.1 and LAPACK to version 3.4.2.
    9497 * Removed patches integrated upstream.
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    5252os.environ['MAKE'] += ' -j1'
    5353MAKE = os.environ['MAKE']
    5454
     55
    5556######################################################################
    5657### Some auxiliary functions to facilitate IO and error checking
    5758######################################################################
     
    6667    return subprocess.call(command, shell=True)
    6768
    6869def assert_success(rc, good=None, bad=None):
    69     if rc == 0: 
     70    if rc == 0:
    7071        if good is not None:
    7172            print good
    7273        return
     
    7879        print 'Error: ', bad
    7980    sys.exit(rc)
    8081
     82
    8183######################################################################
    8284### Skip building ATLAS on specific systems
    8385######################################################################
     
    232234
    233235shutil.copytree(os.path.join(PATCH_DIR, 'ATLAS-lib'), BUILD_LIB_DIR)
    234236
     237
    235238######################################################################
    236 ### configure
     239### configure functions
    237240######################################################################
    238241
    239242def configure_options_from_environment():
     
    423426    return (arch, isa_ext, archdef_dir)
    424427
    425428
    426 
    427 
    428429######################################################################
    429 ### make
     430### make function
    430431######################################################################
    431432
    432 def make_atlas():
     433def make_atlas(target=None):
    433434    os.chdir(BUILD_DIR)
    434     rc = system_with_flush(MAKE)
    435     return rc
    436 
    437 
    438 def 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    
    449 
    450 def make_atlas_library(target=None):
    451     os.chdir(BUILD_LIB_DIR)
    452435    if target is None:
    453436        return system_with_flush(MAKE)
    454437    else:
     
    456439
    457440
    458441######################################################################
    459 ### make and save archdef
     442### make and save archdef function
    460443######################################################################
    461444
    462445def build_and_save_archdef():
     
    471454    assert_success(rc, bad='Making archdef tarfile failed.', good='Finished building archdef tarfile.')
    472455    for tarfile in glob.glob('*.tar.bz2'):
    473456        cp(tarfile, ARCHDEF_SAVE_DIR)
    474    
     457
    475458
    476459######################################################################
    477 ### build atlas and lapack
     460### static libraries functions
    478461######################################################################
    479462
    480463def build(arch=None, isa_ext=None, archdef_dir=None):
     
    483466
    484467    Return ``0`` if successfull.
    485468    """
    486     rc = configure(arch, isa_ext, archdef_dir)   
     469    rc = configure(arch, isa_ext, archdef_dir)
    487470    assert_success(rc, bad='Configure failed.', good='Finished configuring ATLAS.')
    488471    return make_atlas()
    489472
     
    510493    return make_atlas()
    511494
    512495
     496######################################################################
     497### shared libraries functions
     498######################################################################
     499
     500def configure_atlas_library():
     501    os.chdir(BUILD_LIB_DIR)
     502    static_library_dir = os.path.join(BUILD_DIR, 'lib')
     503    for static_lib in glob.glob(os.path.join(static_library_dir, 'lib*.a')):
     504        shutil.copy(static_lib, BUILD_LIB_DIR)
     505    cmd = './configure'
     506    cmd += ' --prefix=' + conf['SAGE_LOCAL']
     507    cmd += ' --libdir=' + os.path.join(conf['SAGE_LOCAL'],'lib')
     508    cmd += ' --disable-static'
     509    return system_with_flush(cmd)
     510
     511def make_atlas_library(target=None):
     512    os.chdir(BUILD_LIB_DIR)
     513    cmd = (MAKE + ' ' + target) if target else MAKE
     514    return system_with_flush(cmd)
     515
     516
     517######################################################################
     518### build atlas and lapack static libraries
     519######################################################################
     520
    513521#
    514522# Workaround for specific platforms: Disable tuning and go straight to
    515523# fast/base architectural defaults
     
    539547
    540548build_and_save_archdef()
    541549
     550
     551######################################################################
     552### install atlas and lapack headers
     553######################################################################
     554
     555edit_in_place(os.path.join(BUILD_DIR, 'Makefile')) \
     556    .replace('.*Make.top install_lib.*', '') \
     557    .close()
     558
     559rc = make_atlas('install')
     560assert_success(rc, bad='Failed to install ATLAS headers',
     561               good='Installed ATLAS headers')
     562
     563
     564######################################################################
     565### configure and build atlas and lapack shared libraries
     566######################################################################
     567
    542568rc = configure_atlas_library()
    543569assert_success(rc, bad='Configuring shared ATLAS library failed.',
    544570               good='Finished configuring shared ATLAS library.')
    545571
     572have_serial_libs = False
     573have_parallel_libs = False
     574
    546575rc = make_atlas_library()
    547576if rc!=0:
    548577    print 'Failed to build serial+parallel shared libraries, possibly because your'
    549578    print 'system does not support both. Trying to build serial libraries only.'
    550579    rc = make_atlas_library('all_serial')
    551     have_parallel_libs = False
     580    assert_success(rc, bad='Failed to build any shared library.',
     581                   good='Finished building serial shared ATLAS library.')
     582    have_serial_libs = True
    552583else:
    553584    have_parallel_libs = True
    554 assert_success(rc, bad='Building shared ATLAS library failed.',
    555                good='Finished building shared ATLAS library.')
    556585
    557586
    558587######################################################################
    559 ### install
     588### install shared libraries
    560589######################################################################
    561590
    562591if have_parallel_libs:
    563592    rc = make_atlas_library('install')
    564 else:
     593    assert_success(rc, bad='Installing the parallel+serial shared ATLAS library failed.',
     594                   good='Finished installing parallel+serial shared ATLAS library.')
     595
     596if have_serial_libs:
    565597    rc = make_atlas_library('install_serial')
    566 assert_success(rc, bad='Installing the shared ATLAS library failed.',
    567                good='Finished installing shared ATLAS library.')
     598    assert_success(rc, bad='Installing the serial shared ATLAS library failed.',
     599                   good='Finished installing serial shared ATLAS library.')
    568600
    569601
    570 cp(os.path.join(PATCH_DIR, 'atlas-config'),
     602######################################################################
     603### install script to tune and build ATLAS
     604######################################################################
     605
     606cp(os.path.join(PATCH_DIR, 'atlas-config'),
    571607   os.path.join(conf['SAGE_LOCAL'], 'bin'))
    572