Changeset bfbfafa for wscript


Ignore:
Timestamp:
Oct 3, 2017, 10:31:12 PM (7 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:
2e5c52e
Parents:
7b7a58e (diff), 25db68c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into dct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r7b7a58e rbfbfafa  
    5151            help_str = 'compile with fftw3 instead of ooura',
    5252            help_disable_str = 'do not compile with fftw3')
     53    add_option_enable_disable(ctx, 'intelipp', default = False,
     54            help_str = 'use Intel IPP libraries (auto)',
     55            help_disable_str = 'do not use Intel IPP libraries')
    5356    add_option_enable_disable(ctx, 'complex', default = False,
    5457            help_str ='compile with C99 complex',
     
    101104    ctx.load('waf_unit_test')
    102105    ctx.load('gnu_dirs')
     106    ctx.load('waf_gensyms', tooldir='.')
    103107
    104108def configure(ctx):
    105     from waflib import Options
    106     ctx.load('compiler_c')
    107     ctx.load('waf_unit_test')
    108     ctx.load('gnu_dirs')
    109 
    110109    target_platform = sys.platform
    111110    if ctx.options.target_platform:
    112111        target_platform = ctx.options.target_platform
    113112
     113    from waflib import Options
    114114
    115115    if target_platform=='emscripten':
    116         # need to force spaces between flag -o and path
    117         # inspired from :
    118         # https://github.com/waf-project/waf/blob/master/waflib/extras/c_emscripten.py (#1885)
    119         # (OSX /emscripten 1.37.9)
    120         ctx.env.CC_TGT_F            = ['-c', '-o', '']
    121         ctx.env.CCLNK_TGT_F         = ['-o', '']
     116        ctx.load('c_emscripten')
     117    else:
     118        ctx.load('compiler_c')
     119
     120    ctx.load('waf_unit_test')
     121    ctx.load('gnu_dirs')
     122    ctx.load('waf_gensyms', tooldir='.')
     123
    122124    # check for common headers
    123125    ctx.check(header_name='stdlib.h')
     
    152154    else:
    153155        # enable debug symbols
    154         ctx.env.CFLAGS += ['/Z7', '/FS']
     156        ctx.env.CFLAGS += ['/Z7']
     157        # /FS flag available in msvc >= 12 (2013)
     158        if 'MSVC_VERSION' in ctx.env and ctx.env.MSVC_VERSION >= 12:
     159            ctx.env.CFLAGS += ['/FS']
    155160        ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
    156161        # configure warnings
    157162        ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS']
     163        # ignore "possible loss of data" warnings
     164        ctx.env.CFLAGS += ['/wd4305', '/wd4244', '/wd4245', '/wd4267']
     165        # ignore "unreferenced formal parameter" warnings
     166        ctx.env.CFLAGS += ['/wd4100']
    158167        # set optimization level and runtime libs
    159168        if (ctx.options.build_type == "release"):
     
    227236
    228237    if target_platform == 'emscripten':
    229         import os.path
    230         ctx.env.CFLAGS += [ '-I' + os.path.join(os.environ['EMSCRIPTEN'], 'system', 'include') ]
    231        
    232238        if ctx.options.build_type == "debug":
    233239            ctx.env.cshlib_PATTERN = '%s.js'
     
    248254
    249255        # tell emscripten functions we want to expose
    250         from python.lib.gen_external import get_c_declarations, get_cpp_objects_from_c_declarations, get_all_func_names_from_lib, generate_lib_from_c_declarations
     256        from python.lib.gen_external import get_c_declarations, \
     257                get_cpp_objects_from_c_declarations, get_all_func_names_from_lib, \
     258                generate_lib_from_c_declarations
    251259        c_decls = get_c_declarations(usedouble=False)  # emscripten can't use double
    252         objects = get_cpp_objects_from_c_declarations(c_decls)
     260        objects = list(get_cpp_objects_from_c_declarations(c_decls))
    253261        # ensure that aubio structs are exported
    254262        objects += ['fvec_t', 'cvec_t', 'fmat_t']
     
    286294    else:
    287295        ctx.msg('Checking if complex.h is enabled', 'no')
     296
     297    # check for Intel IPP
     298    if (ctx.options.enable_intelipp != False):
     299        has_ipp_headers = ctx.check(header_name=['ippcore.h', 'ippvm.h', 'ipps.h'],
     300                mandatory = False)
     301        has_ipp_libs = ctx.check(lib=['ippcore', 'ippvm', 'ipps'],
     302                uselib_store='INTEL_IPP', mandatory = False)
     303        if (has_ipp_headers and has_ipp_libs):
     304            ctx.msg('Checking if Intel IPP is available', 'yes')
     305            ctx.define('HAVE_INTEL_IPP', 1)
     306            if ctx.env.CC_NAME == 'msvc':
     307                # force linking multi-threaded static IPP libraries on Windows with msvc
     308                ctx.define('_IPP_SEQUENTIAL_STATIC', 1)
     309        else:
     310            ctx.msg('Checking if Intel IPP is available', 'no')
    288311
    289312    # check for fftw3
     
    310333        ctx.define('HAVE_FFTW3', 1)
    311334
    312     # fftw not enabled, use vDSP or ooura
     335    # fftw not enabled, use vDSP, intelIPP or ooura
    313336    if 'HAVE_FFTW3F' in ctx.env.define_key:
    314337        ctx.msg('Checking for FFT implementation', 'fftw3f')
     
    317340    elif 'HAVE_ACCELERATE' in ctx.env.define_key:
    318341        ctx.msg('Checking for FFT implementation', 'vDSP')
     342    elif 'HAVE_INTEL_IPP' in ctx.env.define_key:
     343        ctx.msg('Checking for FFT implementation', 'Intel IPP')
    319344    else:
    320345        ctx.msg('Checking for FFT implementation', 'ooura')
     
    447472    # add sub directories
    448473    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
     474        if bld.env['DEST_OS']=='emscripten' and not bld.options.testcmd:
     475            bld.options.testcmd = 'node %s'
    449476        bld.recurse('examples')
    450477        bld.recurse('tests')
     
    558585    ctx.excl += ' **/.landscape.yml'
    559586    ctx.excl += ' **/.appveyor.yml'
     587    ctx.excl += ' **/circlei.yml'
Note: See TracChangeset for help on using the changeset viewer.