Changeset fe05d1f


Ignore:
Timestamp:
Sep 21, 2018, 5:53:50 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
b45af44
Parents:
630191c
Message:

wscript: detect includes for openblas/libblas/atlas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r630191c rfe05d1f  
    8484            help_str = 'use CoreFoundation (darwin only) (auto)',
    8585            help_disable_str = 'do not use CoreFoundation framework')
     86    add_option_enable_disable(ctx, 'blas', default = False,
     87            help_str = 'use BLAS acceleration library (no)',
     88            help_disable_str = 'do not use BLAS library')
    8689    add_option_enable_disable(ctx, 'atlas', default = False,
    87             help_str = 'use Atlas library (no)',
    88             help_disable_str = 'do not use Atlas library')
     90            help_str = 'use ATLAS acceleration library (no)',
     91            help_disable_str = 'do not use ATLAS library')
    8992    add_option_enable_disable(ctx, 'wavread', default = True,
    9093            help_str = 'compile with source_wavread (default)',
     
    274277        ctx.env.LINKFLAGS_cshlib += ['-s', 'EXPORTED_FUNCTIONS=%s' % c_mangled_names]
    275278
    276     if (ctx.options.enable_atlas != True):
    277         ctx.options.enable_atlas = False
    278 
    279279    # check support for C99 __VA_ARGS__ macros
    280280    check_c99_varargs = '''
     
    427427    ctx.msg('Checking if using sink_wavwrite', ctx.options.enable_wavwrite and 'yes' or 'no')
    428428
    429     # use ATLAS
    430     if (ctx.options.enable_atlas != False):
    431         ctx.check(header_name = 'atlas/cblas.h', mandatory = ctx.options.enable_atlas)
    432         #ctx.check(lib = 'lapack', uselib_store = 'LAPACK', mandatory = ctx.options.enable_atlas)
    433         ctx.check(lib = 'cblas', uselib_store = 'BLAS', mandatory = ctx.options.enable_atlas)
     429    # use BLAS/ATLAS
     430    if (ctx.options.enable_blas != False):
     431        ctx.check_cfg(package = 'blas',
     432                args = '--cflags --libs',
     433                uselib_store='BLAS', mandatory = ctx.options.enable_blas)
     434        if 'LIB_BLAS' in ctx.env:
     435            blas_header = None
     436            if ctx.env['LIBPATH_BLAS']:
     437                if 'atlas' in ctx.env['LIBPATH_BLAS'][0]:
     438                    blas_header = 'atlas/cblas.h'
     439                elif 'openblas' in ctx.env['LIBPATH_BLAS'][0]:
     440                    blas_header = 'openblas/cblas.h'
     441            else:
     442                blas_header = 'cblas.h'
     443            ctx.check(header_name = blas_header, mandatory =
     444                    ctx.options.enable_atlas)
    434445
    435446    # use memcpy hacks
Note: See TracChangeset for help on using the changeset viewer.