Ticket #1499: Sage-2.9.alpha7-fix-ATLAS-linking.patch

File Sage-2.9.alpha7-fix-ATLAS-linking.patch, 7.0 KB (added by mabshoff, 13 years ago)
  • setup.py

    # HG changeset patch
    # User mabshoff@sage.math.washington.edu
    # Date 1197589513 28800
    # Node ID 5971d008a5908596ca8ca3cdba28aba9e2b15fa8
    # Parent  c054b93f71cbab2e44fb01a9e74f4a2f52208835
    Make all code linked against BLAS also link against BLAS2, since ATLAS is two libraries. This solution isn't very clean.
    
    diff -r c054b93f71cb -r 5971d008a590 setup.py
    a b from Cython.Distutils import build_ext 
    1515## if you change this!!
    1616if os.environ.has_key('SAGE_BLAS'):
    1717    BLAS=os.environ['SAGE_BLAS']
     18    BLAS2=os.environ['SAGE_BLAS']
    1819elif os.path.exists('/usr/lib/libcblas.dylib') or \
    1920     os.path.exists('/usr/lib/libcblas.so'):
    2021    BLAS='cblas'
     22    BLAS2='atlas'
    2123elif os.path.exists('/usr/lib/libblas.dll.a'):   
    2224    BLAS='gslcblas'
     25    BLAS2='gslcblas'
    2326else:
    2427    # This is very slow  (?), but *guaranteed* to be available.
    2528    BLAS='gslcblas'
    26 
     29    BLAS2='gslcblas'
    2730if len(sys.argv) > 1 and sys.argv[1] == "sdist":
    2831    sdist = True
    2932else:
    linbox = Extension('sage.libs.linbox.lin 
    281284linbox = Extension('sage.libs.linbox.linbox',
    282285                   ['sage/libs/linbox/linbox.pyx'],
    283286                   # For this to work on cygwin, linboxwrap *must* be before ntl.
    284                    libraries = ['linboxwrap', 'ntl', 'linbox', 'gmp', 'gmpxx', 'stdc++', 'givaro', BLAS],
     287                   libraries = ['linboxwrap', 'ntl', 'linbox', 'gmp', 'gmpxx', 'stdc++', 'givaro', BLAS, BLAS2],
    285288                   language = 'c++')
    286289
    287290libsingular = Extension('sage.libs.singular.singular',
    matrix_rational_sparse = Extension('sage 
    335338# TODO -- change to use BLAS at some point.
    336339matrix_integer_dense = Extension('sage.matrix.matrix_integer_dense',
    337340                                 ['sage/matrix/matrix_integer_dense.pyx'],
    338                                   libraries = ['iml', 'gmp', 'm', BLAS])  # order matters for cygwin!!
     341                                  libraries = ['iml', 'gmp', 'm', BLAS, BLAS2])  # order matters for cygwin!!
    339342
    340343matrix_real_double_dense=Extension('sage.matrix.matrix_real_double_dense',
    341    ['sage/matrix/matrix_real_double_dense.pyx'],libraries=['gsl',BLAS],
     344   ['sage/matrix/matrix_real_double_dense.pyx'],libraries=['gsl', BLAS, BLAS2],
    342345   define_macros=[('GSL_DISABLE_DEPRECATED','1')],include_dirs=[SAGE_ROOT+'/local/lib/python2.5/site-packages/numpy/core/include/numpy'])
    343346
    344347matrix_complex_double_dense=Extension('sage.matrix.matrix_complex_double_dense',
    345    ['sage/matrix/matrix_complex_double_dense.pyx'],libraries=['gsl',BLAS],
     348   ['sage/matrix/matrix_complex_double_dense.pyx'],libraries=['gsl', BLAS, BLAS2],
    346349   define_macros=[('GSL_DISABLE_DEPRECATED','1')],include_dirs=[SAGE_ROOT+'/local/lib/python2.5/site-packages/numpy/core/include/numpy'])
    347350
    348351
    349 solve = Extension('sage.matrix.solve',['sage/matrix/solve.pyx'],libraries = ['gsl',BLAS],define_macros =
     352solve = Extension('sage.matrix.solve',['sage/matrix/solve.pyx'],libraries = ['gsl', BLAS, BLAS2],define_macros =
    350353   [('GSL_DISABLE_DEPRECATED','1')])
    351354
    352355matrix_cyclo_dense = Extension('sage.matrix.matrix_cyclo_dense',
    free_module_element = Extension('sage.mo 
    377380                                ['sage/modules/free_module_element.pyx'])
    378381
    379382################ GSL wrapping ######################
    380 gsl_probability=Extension('sage.gsl.probability_distribution',['sage/gsl/probability_distribution.pyx'],libraries=['gsl',BLAS],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
    381 gsl_integration=Extension('sage.gsl.integration',['sage/gsl/integration.pyx'],define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl',BLAS])
     383gsl_probability=Extension('sage.gsl.probability_distribution',['sage/gsl/probability_distribution.pyx'],libraries=['gsl', BLAS, BLAS2],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
     384gsl_integration=Extension('sage.gsl.integration',['sage/gsl/integration.pyx'],define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl',BLAS, BLAS2])
    382385
    383386gsl_ode = Extension('sage.gsl.ode',['sage/gsl/ode.pyx'],libraries=['gsl',BLAS],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
    384387
    385388gsl_fft = Extension('sage.gsl.fft',
    386389                ['sage/gsl/fft.pyx'],
    387                 libraries = ['gsl', BLAS],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
     390                libraries = ['gsl', BLAS, BLAS2],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
    388391
    389392gsl_interpolation = Extension('sage.gsl.interpolation',
    390393                ['sage/gsl/interpolation.pyx'],
    391                 libraries = ['gsl', BLAS],
     394                libraries = ['gsl', BLAS, BLAS2],
    392395define_macros=[('GSL_DISABLE_DEPRECATED','1')])
    393396
    394397gsl_callback = Extension('sage.gsl.callback',
    395398                ['sage/gsl/callback.pyx'],
    396                 libraries = ['gsl', BLAS]
     399                libraries = ['gsl', BLAS, BLAS2]
    397400,define_macros=[('GSL_DISABLE_DEPRECATED','1')])
    398401
    399402real_double = Extension('sage.rings.real_double',
    400403                ['sage/rings/real_double.pyx'],
    401                 libraries = ['gsl', 'gmp', BLAS],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
     404                libraries = ['gsl', 'gmp', BLAS, BLAS2],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
    402405
    403406complex_double = Extension('sage.rings.complex_double',
    404407                           ['sage/rings/complex_double.pyx'],
    405                            libraries = ['gsl', BLAS, 'pari', 'gmp'])
     408                           libraries = ['gsl', BLAS, BLAS2, 'pari', 'gmp'])
    406409
    407410real_double_vector = Extension('sage.modules.real_double_vector',['sage/modules/real_double_vector.pyx'],
    408                               libraries = ['gsl',BLAS,'pari','gmp'],define_macros = [('GSL_DISABLE_DEPRECAED','1')],include_dirs=[SAGE_ROOT+'/local/lib/python2.5/site-packages/numpy/core/include/numpy'])
     411                              libraries = ['gsl', BLAS, BLAS2, 'pari','gmp'],define_macros = [('GSL_DISABLE_DEPRECAED','1')],include_dirs=[SAGE_ROOT+'/local/lib/python2.5/site-packages/numpy/core/include/numpy'])
    409412
    410413complex_double_vector = Extension('sage.modules.complex_double_vector',['sage/modules/complex_double_vector.pyx'],
    411                            libraries = ['gsl', BLAS, 'pari', 'gmp'],define_macros=[('GSL_DISABLE_DEPRECATED','1')],include_dirs=[SAGE_ROOT+'/local/lib/python2.5/site-packages/numpy/core/include/numpy'])
     414                           libraries = ['gsl', BLAS, BLAS2, 'pari', 'gmp'],define_macros=[('GSL_DISABLE_DEPRECATED','1')],include_dirs=[SAGE_ROOT+'/local/lib/python2.5/site-packages/numpy/core/include/numpy'])
    412415
    413416
    414417vector_integer_dense = Extension('sage.modules.vector_integer_dense',
    vector_rational_dense = Extension('sage. 
    427430                                 libraries = ['gmp'])
    428431
    429432gsl_array = Extension('sage.gsl.gsl_array',['sage/gsl/gsl_array.pyx'],
    430                 libraries=['gsl',BLAS],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
     433                libraries=['gsl', BLAS, BLAS2],define_macros=[('GSL_DISABLE_DEPRECATED','1')])
    431434
    432435gsl_ode = Extension('sage.gsl.ode',['sage/gsl/ode.pyx'],libraries=['gsl',BLAS],
    433436                define_macros=[('GSL_DISABLE_DEPRECATED','1')])