Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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')
Esempio n. 4
0
def configure(conf):
    env = conf.env

    config.check_home(conf, 'GL')

    if env['PLATFORM'] == 'darwin':
        config.configure('osx', conf)

        if not (conf.CheckOSXFramework('OpenGL') and
                conf.CheckCHeader('OpenGL/gl.h')):
            raise Exception, 'Need OpenGL'

    else:
        if env['PLATFORM'] == 'win32':
            glulib = 'glu32'
            gllib = 'opengl32'

        else:
            glulib = 'GLU'
            gllib = 'GL'

        config.require_lib(conf, gllib)
        config.require_lib(conf, glulib)

    return True
Esempio n. 5
0
def configure(conf):
    env = conf.env

    config.check_home(conf, 'GL')

    if env['PLATFORM'] == 'darwin':
        config.configure('osx', conf)

        if not (conf.CheckOSXFramework('OpenGL')
                and conf.CheckCHeader('OpenGL/gl.h')):
            raise Exception, 'Need OpenGL'

    else:
        if env['PLATFORM'] == 'win32':
            glulib = 'glu32'
            gllib = 'opengl32'

        else:
            glulib = 'GLU'
            gllib = 'GL'

        config.require_lib(conf, gllib)
        config.require_lib(conf, glulib)

    return True
Esempio n. 6
0
def configure(conf):
    env = conf.env

    if os.environ.has_key('FREETYPE2_INCLUDE'):
        env.AppendUnique(CPPPATH =
                         os.environ['FREETYPE2_INCLUDE'].split(os.pathsep))
    else:
        try:
            env.ParseConfig('freetype-config --cflags')
        except OSError: pass

    if os.environ.has_key('FREETYPE2_LIBPATH'):
        env.AppendUnique(LIBPATH = [os.environ['FREETYPE2_LIBPATH']])

    if env['PLATFORM'] == 'darwin':
        config.configure('osx', conf)
        if not conf.CheckOSXFramework('CoreServices'):
            raise Exception, 'Need CoreServices framework'
        if not conf.CheckOSXFramework('ApplicationServices'):
            raise Exception, 'Need ApplicationServices framework'

    config.require_header(conf, 'ft2build.h')
    config.require_lib(conf, 'freetype')

    config.check_home(conf, 'zlib', lib_suffix = '') # TODO Hack!
    config.require_lib(conf, 'z')

    return True
Esempio n. 7
0
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')
Esempio n. 8
0
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
Esempio n. 9
0
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
Esempio n. 10
0
def configure(conf):
    env = conf.env

    config.check_home(conf, 'GLEW')

    if env['PLATFORM'] == 'win32':
        glewlib = 'glew32s' # The static version
        env.AppendUnique(CPPDEFINES = ['GLEW_BUILD=GLEW_STATIC'])

    else: glewlib = 'GLEW'

    config.require_header(conf, 'GL/glew.h')
    config.require_lib(conf, glewlib)

    return True
Esempio n. 11
0
def configure(conf):
    env = conf.env

    config.check_home(conf, 'GLEW')

    if env['PLATFORM'] == 'win32':
        glewlib = 'glew32s'  # The static version
        env.AppendUnique(CPPDEFINES=['GLEW_BUILD=GLEW_STATIC'])

    else:
        glewlib = 'GLEW'

    config.require_header(conf, 'GL/glew.h')
    config.require_lib(conf, glewlib)

    return True
Esempio n. 12
0
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
Esempio n. 13
0
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
Esempio n. 14
0
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')
Esempio n. 15
0
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'])
Esempio n. 16
0
def CheckMKL(context):
    env = context.env
    conf = context.sconf

    context.Message('Checking for Intel MKL... ')

    # Save
    save_LIBPATH = env.get('LIBPATH', None)
    save_CPPPATH = env.get('CPPPATH', None)
    save_LIBS = env.get('LIBS', None)

    config.check_home(conf, 'mkl', suffix = 'ROOT')

    # Test program
    source = """
      #include "mkl.h"
      int main()
      {
        char ta = 'N', tb = 'N';
        int M = 1, N = 1, K = 1, lda = 1, ldb = 1, ldc = 1;
        double alpha = 1.0, beta = 1.0, *A = 0, *B = 0, *C = 0;
        dgemm(&ta, &tb, &M, &N, &K, &alpha, A, &lda, B, &ldb, &beta, C, &ldc);
        return 0;
      }
    """
    source = source.strip()

    env.PrependUnique(LIBS = ['m'])

    # Compile & Link options
    compiler = env.get('compiler')
    if compiler == 'intel':
        if env['PLATFORM'] == 'win32':
            env.AppendUnique(CCFLAGS = ['/Qmkl'])
            env.AppendUnique(LINKFLAGS = ['/Qmkl'])
        else:
            env.AppendUnique(CCFLAGS = ['-mkl'])
            env.AppendUnique(LINKFLAGS = ['-mkl'])

    else:
        if architecture()[0] == '64bit': suffix = '_lp64'
        elif env['PLATFORM'] == 'win32': suffix = '_c'
        else: suffix = ''
        libs = ['mkl_intel' + suffix]

        if compiler == 'gnu': libs += ['mkl_gnu_thread', 'pthread']

        if env['PLATFORM'] == 'win32': libs += ['libiomp5mt']
        else: libs += ['iomp5']

        libs += ['mkl_core']

        env.Prepend(LIBS = libs)
        env.Prepend(LIBS = libs) # Add twice

    # Try it
    if context.TryCompile(source, '.cpp') and context.TryLink(source, '.cpp'):
        env.AppendUnique(CPPDEFINES = ['HAVE_MKL'])
        context.Result(True)
        return True

    # Restore
    env.Replace(LIBPATH = save_LIBPATH)
    env.Replace(CPPPATH = save_CPPPATH)
    env.Replace(LIBS = save_LIBS)

    context.Result(False)
    return False
Esempio n. 17
0
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')