Page MenuHomec4science

site_init.py
No OneTemporary

File Metadata

Created
Sat, Oct 23, 20:16

site_init.py

def fftw(env):
"""A Tool to search for fftw headers and libraries"""
if env.GetOption('clean'): return
env.SetDefault(FFTW_VERSION='3')
env.SetDefault(FFTW_LIBRARY_WISH=[])
print("FFTW_VERSION={0}".format(env['FFTW_VERSION']))
if 'FFTW_INCLUDE_DIR' in env:
env.AppendUnique(CPPPATH=env['FFTW_INCLUDE_DIR'])
if 'FFTW_LIBRARY_DIR' in env:
env.AppendUnique(LIBPATH=env['FFTW_LIBRARY_DIR'])
version = env['FFTW_VERSION']
if version == "2":
lib_names = {'main':'fftw'}
inc_names = ['fftw.h']
else:
lib_names = {'main':'fftw3','thread':'fftw3_threads','omp':'fftw3_omp'}
inc_names = ['fftw3.h']
try:
libs = [lib_names[i] for i in env['FFTW_LIBRARY_WISH']]
except:
raise SCons.Errors.StopError(
'Incompatible wishlist {0} from version {1}'.format(
env['FFTW_LIBRARY_WISH'], env['FFTW_VERSION']))
env.AppendUnique(LIBS=libs)
if version == "2":
env.Append(LIBS='m')
conf = Configure(env)
if not conf.CheckLibWithHeader(libs, inc_names, 'c'):
raise SCons.Errors.StopError(
'Failed to find libraries {0} or '
'headers {1}.'.format(str(lib_names), str(inc_names)))
env = conf.Finish()

Event Timeline