Esempio n. 1
0
 def test_sysconfig_provides_non_empty_flags(self):
     import nvidia.dali.sysconfig as dali_sysconfig
     assert "" != dali_sysconfig.get_include_flags()
     assert "" != dali_sysconfig.get_compile_flags()
     assert "" != dali_sysconfig.get_link_flags()
     assert "" != dali_sysconfig.get_include_dir()
     assert "" != dali_sysconfig.get_lib_dir()
Esempio n. 2
0
def get_dali_build_flags():
    dali_cflags = ''
    dali_lflags = ''
    try:
        import nvidia.dali.sysconfig as dali_sc
        # We are linking with DALI's C library, so we don't need the C++ compile flags
        # including the CXX11_ABI setting
        dali_cflags = " ".join(dali_sc.get_include_flags())
        dali_lflags = " ".join(dali_sc.get_link_flags())
    except ModuleNotFoundError:
        dali_path = get_module_path('nvidia/dali')
        if dali_path != '':
            dali_cflags = " ".join(["-I" + dali_path + "/include"])
            dali_lflags = " ".join(["-L" + dali_path, "-ldali"])
    if dali_cflags == '' and dali_lflags == '':
        raise ImportError('Could not find DALI.')
    return (dali_cflags, dali_lflags)
Esempio n. 3
0
def get_dali_build_flags():
    dali_cflags = ''
    dali_lflags = ''
    dali_include_flags = ''
    try:
        import nvidia.dali.sysconfig as dali_sc
        dali_include_flags = " ".join(dali_sc.get_include_flags())
        dali_cflags = " ".join(dali_sc.get_compile_flags())
        dali_lflags = " ".join(dali_sc.get_link_flags())
    except BaseException:
        dali_path = get_module_path('nvidia/dali')
        if dali_path != '':
            dali_include_flags = " ".join(["-I" + dali_path + "/include"])
            dali_cflags = " ".join(["-I" + dali_path + "/include", "-D_GLIBCXX_USE_CXX11_ABI=0"])
            dali_lflags = " ".join(["-L" + dali_path, "-ldali"])
    if dali_include_flags == '' and dali_cflags == '' and dali_lflags == '':
        raise ImportError('Could not find DALI.')
    return (dali_include_flags, dali_cflags, dali_lflags)