def configure(conf): env = conf.env config.check_home(conf, 'GLUT') if env['PLATFORM'] == 'darwin': config.configure('osx', conf) if not (conf.CheckOSXFramework('GLUT') and conf.CheckCHeader('GLUT/glut.h')): raise Exception, 'Need GLUT' else: if env['PLATFORM'] == 'win32': freeglutlib = 'freeglut_static' glutlib = 'glut32' env.AppendUnique(CPPDEFINES=['FREEGLUT_STATIC']) else: freeglutlib = glutlib = 'glut' config.require_header(conf, 'GL/glut.h') if not (config.check_lib(conf, freeglutlib) or config.check_lib(conf, glutlib)): raise Exception, 'Need glut' return True
def configure(conf): env = conf.env config.check_home(conf, 'GLUT') if env['PLATFORM'] == 'darwin': config.configure('osx', conf) if not (conf.CheckOSXFramework('GLUT') and conf.CheckCHeader('GLUT/glut.h')): raise Exception, 'Need GLUT' else: if env['PLATFORM'] == 'win32': freeglutlib = 'freeglut_static' glutlib = 'glut32' env.AppendUnique(CPPDEFINES = ['FREEGLUT_STATIC']) else: freeglutlib = glutlib = 'glut' config.require_header(conf, 'GL/glut.h') if not (config.check_lib(conf, freeglutlib) or config.check_lib(conf, glutlib)): raise Exception, 'Need glut' return True
def configure_deps(conf): env = conf.env # zlib config.configure('zlib', conf) # libbzip2 config.configure('libbzip2', conf) # XML config.configure('xml', conf) # OpenSSL config.configure('openssl', conf) # V8 config.configure('v8', conf, False) # libsqlite config.configure('libsqlite', conf) # boost config.configure('boost', conf, version = '1.40', hdrs = ['version', 'iostreams/stream'], libs = ['iostreams', 'system', 'filesystem', 'regex']) # pthread if env['PLATFORM'] != 'win32': config.configure('pthreads', conf) # wsock32 & D3D9 if env['PLATFORM'] == 'win32': config.require_lib(conf, 'wsock32') config.require_lib(conf, 'setupapi') # OSX frameworks if env['PLATFORM'] == 'darwin': if not (config.configure('osx', conf) and conf.CheckOSXFramework('ApplicationServices') and conf.CheckOSXFramework('IOKit') and conf.CheckOSXFramework('CoreFoundation')): raise Exception, \ 'Need ApplicationServices, IOKit & CoreFoundation frameworks' # Valgrind config.configure('valgrind', conf) # Debug if env.get('debug', 0): if conf.CheckCHeader('execinfo.h') and conf.CheckCHeader('bfd.h') and \ config.check_lib(conf, 'iberty') and \ config.check_lib(conf, 'bfd'): env.AppendUnique(CPPDEFINES = ['HAVE_CBANG_BACKTRACE']) elif env.get('backtrace_debugger', 0): raise Exception, \ "execinfo.h, bfd.h and libbfd needed for backtrace_debuger" env.AppendUnique(CPPDEFINES = ['DEBUG_LEVEL=' + str(env.get('debug_level', 1))])
def CheckLAPACK(context): env = context.env conf = context.sconf context.Message('Checking for LAPACK...\n') config.check_home(conf, 'lapack') if env['PLATFORM'] in ['posix', 'darwin']: # G2C config.check_home(conf, 'g2c') config.check_lib(conf, 'g2c') # GFortran config.check_home(conf, 'gfortran') config.check_lib(conf, 'gfortran') # BLAS config.check_home(conf, 'blas') if not config.check_lib(conf, 'blas-3'): config.check_lib(conf, 'blas') # LAPACK if (config.check_lib(conf, 'lapack-3') or config.check_lib(conf, 'lapack')): env.AppendUnique(CPPDEFINES=['HAVE_LAPACK']) context.Result(True) return True context.Result(False) return False
def CheckLAPACK(context): env = context.env conf = context.sconf context.Message('Checking for LAPACK...\n') config.check_home(conf, 'lapack') if env['PLATFORM'] in ['posix', 'darwin']: # G2C config.check_home(conf, 'g2c') config.check_lib(conf, 'g2c') # GFortran config.check_home(conf, 'gfortran') config.check_lib(conf, 'gfortran') # BLAS config.check_home(conf, 'blas') if not config.check_lib(conf, 'blas-3'): config.check_lib(conf, 'blas') # LAPACK if (config.check_lib(conf, 'lapack-3') or config.check_lib(conf, 'lapack')): env.AppendUnique(CPPDEFINES = ['HAVE_LAPACK']) context.Result(True) return True context.Result(False) return False
def configure(conf): env = conf.env config.check_home(conf, 'libbzip2') config.check_home(conf, 'libbzip2', lib_suffix='', inc_suffix='/src') return \ config.check_header(conf, 'bzlib.h') and config.check_lib(conf, 'bz2')
def configure(conf): env = conf.env config.check_home(conf, 'libbzip2') config.check_home(conf, 'libbzip2', lib_suffix = '', inc_suffix = '/src') return \ config.check_header(conf, 'bzlib.h') and config.check_lib(conf, 'bz2')
def configure(conf, hdrs = [], libs = [], version = '1.35', lib_suffix = ''): env = conf.env boost_inc = None boost_lib = None boost_lib_suffix = lib_suffix boost_inc = os.environ.get('BOOST_SOURCE', boost_inc) boost_ver = os.environ.get('BOOST_VERSION', version) boost_home = os.environ.get('BOOST_HOME', '') if boost_home: path = try_dirs([[boost_home, 'include', 'boost'], [boost_home, 'include', 'boost-' + boost_ver.replace('.', '_'), 'boost'], [boost_home, 'boost']]) if not boost_inc: if path: boost_inc = os.path.dirname(path) else: print "WARNING: No boost include path found in BOOST_HOME" path = os.path.join(boost_home, 'lib') if os.path.isdir(path): boost_lib = path else: print "WARNING: No boost lib path found in BOOST_HOME" boost_inc = os.environ.get('BOOST_INCLUDE_PATH', boost_inc) boost_lib = os.environ.get('BOOST_LIB_PATH', boost_lib) if os.environ.has_key('BOOST_LIB_SUFFIX'): boost_lib_suffix = os.environ['BOOST_LIB_SUFFIX'].replace('.', '_') if boost_inc: env.AppendUnique(CPPPATH = [boost_inc]) if boost_lib: env.AppendUnique(LIBPATH = [boost_lib]) # Check version conf.AddTest('BoostVersion', check_version) if not conf.BoostVersion(boost_ver): boost_error("Wrong version") for name in hdrs: header = os.path.join('boost', name + '.hpp') if not conf.CheckCXXHeader(header): boost_error("boost header '" + name + ".hpp' not found.") for name in libs: libname = 'boost_' + name + boost_lib_suffix if env['PLATFORM'] == 'win32': libname = 'lib' + libname if not config.check_lib(conf, libname): boost_error(libname + ' library not found.') if env['PLATFORM'] == 'win32': env.AppendUnique(CPPDEFINES = ['BOOST_ALL_NO_LIB']) env.Prepend(LIBS = ['wsock32'])
def configure(conf): env = conf.env if os.environ.has_key('PTHREADS_HOME'): home = os.environ['PTHREADS_HOME'] env.AppendUnique(CPPPATH = [home]) env.AppendUnique(LIBPATH = [home]) if conf.CheckCHeader('pthread.h') and config.check_lib(conf, 'pthread'): env.AppendUnique(CPPDEFINES = ['HAVE_PTHREADS']) else: raise Exception, 'Need pthreads'
def configure(conf, hdrs=[], libs=[], version='1.35', lib_suffix=''): env = conf.env boost_inc = None boost_lib = None boost_lib_suffix = lib_suffix boost_inc = os.environ.get('BOOST_SOURCE', boost_inc) boost_ver = os.environ.get('BOOST_VERSION', version) boost_home = os.environ.get('BOOST_HOME', '') if boost_home: path = try_dirs([[boost_home, 'include', 'boost'], [ boost_home, 'include', 'boost-' + boost_ver.replace('.', '_'), 'boost' ], [boost_home, 'boost']]) if not boost_inc: if path: boost_inc = os.path.dirname(path) else: print "WARNING: No boost include path found in BOOST_HOME" path = os.path.join(boost_home, 'lib') if os.path.isdir(path): boost_lib = path else: print "WARNING: No boost lib path found in BOOST_HOME" boost_inc = os.environ.get('BOOST_INCLUDE_PATH', boost_inc) boost_lib = os.environ.get('BOOST_LIB_PATH', boost_lib) if os.environ.has_key('BOOST_LIB_SUFFIX'): boost_lib_suffix = os.environ['BOOST_LIB_SUFFIX'].replace('.', '_') if boost_inc: env.AppendUnique(CPPPATH=[boost_inc]) if boost_lib: env.AppendUnique(LIBPATH=[boost_lib]) # Check version conf.AddTest('BoostVersion', check_version) if not conf.BoostVersion(boost_ver): boost_error("Wrong version") for name in hdrs: header = os.path.join('boost', name + '.hpp') if not conf.CheckCXXHeader(header): boost_error("boost header '" + name + ".hpp' not found.") for name in libs: libname = 'boost_' + name + boost_lib_suffix if env['PLATFORM'] == 'win32': libname = 'lib' + libname if not config.check_lib(conf, libname): boost_error(libname + ' library not found.') if env['PLATFORM'] == 'win32': env.AppendUnique(CPPDEFINES=['BOOST_ALL_NO_LIB']) env.Prepend(LIBS=['wsock32'])
def configure(conf): env = conf.env if os.environ.has_key('PTHREADS_HOME'): home = os.environ['PTHREADS_HOME'] env.AppendUnique(CPPPATH=[home]) env.AppendUnique(LIBPATH=[home]) if conf.CheckCHeader('pthread.h') and config.check_lib(conf, 'pthread'): env.AppendUnique(CPPDEFINES=['HAVE_PTHREADS']) else: raise Exception, 'Need pthreads'
def configure(conf): env = conf.env if os.environ.has_key('OPENSSL_HOME'): home = os.environ['OPENSSL_HOME'] if os.path.exists(home + '/inc32') and os.path.exists(home + '/out32'): env.AppendUnique(CPPPATH = [home + '/inc32']) env.AppendUnique(LIBPATH = [home + '/out32']) else: env.AppendUnique(CPPPATH = [home + '/include']) if os.path.exists(home + '/lib'): env.AppendUnique(LIBPATH = [home + '/lib']) else: env.AppendUnique(LIBPATH = [home]) if env['PLATFORM'] == 'posix': config.check_lib(conf, 'dl') if (conf.CheckCHeader('openssl/ssl.h') and (config.check_lib(conf, 'crypto') and config.check_lib(conf, 'ssl')) or (config.check_lib(conf, 'libeay32') and config.check_lib(conf, 'ssleay32'))): if env['PLATFORM'] == 'win32': for lib in ['wsock32', 'advapi32', 'gdi32', 'user32']: config.require_lib(conf, lib) env.AppendUnique(CPPDEFINES = ['HAVE_OPENSSL']) return True else: raise Exception, 'Need openssl'
def configure(conf): env = conf.env configure_deps(conf) # compiler.py crashes if LIBPATH is unset env.AppendUnique(LIBPATH = ['/usr/lib']) if not (config.check_lib(conf, 'cbang') and conf.CheckCXXHeader('cbang/Exception.h')): raise Exception, 'Need CBang' env.AppendUnique(CPPDEFINES = 'HAVE_CBANG')
def configure(conf): env = conf.env # pthread if env['PLATFORM'] != 'win32': config.configure('pthreads', conf) # wsock32 if env['PLATFORM'] == 'win32': config.require_lib(conf, 'wsock32') config.check_home(conf, 'libsqlite', '', '') if config.check_lib(conf, 'sqlite3') and \ config.check_header(conf, 'sqlite3.h'): env.AppendUnique(CPPDEFINES = ['HAVE_LIBSQLITE']) return True return False
def configure(conf): env = conf.env # pthread if env['PLATFORM'] != 'win32': config.configure('pthreads', conf) # wsock32 if env['PLATFORM'] == 'win32': config.require_lib(conf, 'wsock32') config.check_home(conf, 'libsqlite', '', '') if config.check_lib(conf, 'sqlite3') and \ config.check_header(conf, 'sqlite3.h'): env.AppendUnique(CPPDEFINES=['HAVE_LIBSQLITE']) return True return False
def configure(conf): env = conf.env libname = 'expat' if os.environ.has_key('EXPAT_INCLUDE'): env.AppendUnique(CPPPATH = [os.environ['EXPAT_INCLUDE']]) if os.environ.has_key('EXPAT_LIBPATH'): env.AppendUnique(LIBPATH = [os.environ['EXPAT_LIBPATH']]) if env['PLATFORM'] == 'win32': libname = 'lib' + libname + 'MT' env.AppendUnique(CPPDEFINES = ['XML_STATIC']) if conf.CheckCHeader('expat.h') and config.check_lib(conf, libname): env.AppendUnique(CPPDEFINES = ['HAVE_EXPAT']) else: raise Exception, 'Need expat' return True
def configure(conf): env = conf.env config.check_home(conf, 'zlib') config.check_home(conf, 'zlib', lib_suffix = '', inc_suffix = '/src') return config.check_header(conf, 'zlib.h') and config.check_lib(conf, 'z')
def configure(conf): env = conf.env config.check_home(conf, 'zlib') config.check_home(conf, 'zlib', lib_suffix='', inc_suffix='/src') return config.check_header(conf, 'zlib.h') and config.check_lib(conf, 'z')
def configure_deps(conf): env = conf.env # libfah if env.get('fah', 0): config.configure('libfah', conf) # DIAG Options if env.get('qrdiag', 0): env.AppendUnique(CPPDEFINES = ['HAVE_QRDIAG']) # GUI Options if env.get('gui',0): if env['PLATFORM'] == 'win32': config.require_lib(conf, 'wsock32') else: config.require_lib(conf, 'pthread') env.AppendUnique(CPPDEFINES = ['HAVE_GUI']) # LAPACK have_lapack = False lapack = env.get('lapack', 'any') if lapack == '1' or lapack is True: lapack = 'any' elif lapack == '0' or lapack is False: lapack = 'none' if lapack != 'none': # Intel MKL LAPACK if not have_lapack and lapack in ['any', 'mkl']: have_lapack = config.configure('mkl', conf) if have_lapack: env.AppendUnique(CPPDEFINES = ['HAVE_MKL_LAPACK']) elif lapack == 'mkl': raise Exception, "Missing MKL LAPACK" # System LAPACK if not have_lapack and lapack in ['any', 'system']: have_lapack = config.configure('lapack', conf) if not have_lapack and lapack == 'lapack': raise Exception, "Missing LAPACK" # SimTK LAPACK if not have_lapack and lapack in ['any', 'simtk']: config.check_home(conf, 'simtk_lapack') if (config.check_lib(conf, 'SimTKlapack') and config.check_cxx_header(conf, 'SimTKlapack.h')): env.AppendUnique(CPPDEFINES = ['HAVE_SIMTK_LAPACK']) have_lapack = True elif lapack == 'simtk_lapack': raise Exception, "Missing SimTK LAPACK" if not have_lapack: raise Exception, "Missing LAPACK" # OpenMM openmm = env.get('openmm', 0) if openmm: home = config.check_env('OPENMM_HOME', True) conf.env.AppendUnique(CPPPATH = [home + 'olla/include']) conf.env.AppendUnique(CPPPATH = [home + 'openmmapi/include']) config.require_cxx_header(conf, 'OpenMM.h') config.require_cxx_header(conf, 'openmm/Kernel.h') conf.env.Prepend(LIBPATH = [home]) config.require_lib(conf, 'OpenMM') env.AppendUnique(CPPDEFINES = ['HAVE_OPENMM']) # LTMD OpenMM ltmd = env.get('ltmdopenmm', 0) if ltmd and openmm: config.check_home(conf, 'ltmdopenmm') config.require_lib(conf, 'OpenMMLTMD') env.AppendUnique(CPPDEFINES = ['HAVE_OPENMM_LTMD']) # Gromacs gromacs = env.get('gromacs', 0) if gromacs: config.configure('gromacs', conf) # Gromacs Standard gromacs_standard = env.get('gromacs_standard', 0) if gromacs_standard: config.check_home(conf, 'gromacs') config.require_lib(conf, 'md') config.require_lib(conf, 'gmx') env.AppendUnique(CPPDEFINES = ['HAVE_GROMACS'])