示例#1
0
 def setup_options(self):
     from SCons.Script.Main import AddOption
     Package.setup_options(self)
     AddOption('--petsc-arch', dest='petsc_arch', nargs=1, type='string',
               action='store', help='PETSc architecture.')
     AddOption('--petsc-library', dest='petsc_library', nargs=1, type='string',
               action='store', help='PETSc library name.')
示例#2
0
 def gen_envs(self, loc):
     # attempt to use h5pcc to find lib
     import subprocess
     try:
         proc = subprocess.Popen(['h5pcc', '--print-file'],
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
         if proc.wait() == 0:
             env = self.env.Clone()
             libdir = proc.communicate()[0].split()[0]
             libdir = libdir[2:]  #Strip -L
             for env in Package.gen_envs(self, loc):
                 self.headers = ['hdf5.h']
                 lib_env = env.Clone()
                 lib_env.PrependUnique(LIBS=['hdf5'])
                 lib_env.PrependUnique(LIBPATH=[libdir])
                 lib_env.PrependUnique(RPATH=[libdir])
                 #Get include dir
                 lib_env.PrependUnique(CPPPATH=libdir + '/include')
                 yield lib_env
         else:
             raise RuntimeError("Error trying to use 'h5pcc'")
     except:
         # if error in 'h5pcc --print-file'
         for env in Package.gen_envs(self, loc):
             self.headers = ['hdf5.h']
             if self.find_libraries(loc[2], 'hdf5'):
                 env.PrependUnique(LIBS=['hdf5'])
                 yield env
示例#3
0
 def setup_options(self):
     from SCons.Script.Main import AddOption
     Package.setup_options(self)
     AddOption('--petsc-arch', dest='petsc_arch', nargs=1, type='string',
               action='store', help='PETSc architecture.')
     AddOption('--petsc-library', dest='petsc_library', nargs=1, type='string',
               action='store', help='PETSc library name.')
示例#4
0
 def gen_envs(self, loc):
     # attempt to use h5pcc to find lib
     import subprocess
     try:
         proc = subprocess.Popen(['h5pcc', '--print-file'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         if proc.wait() == 0:
           env = self.env.Clone()
           libdir = proc.communicate()[0].split()[0]
           libdir = libdir[2:] #Strip -L
           for env in Package.gen_envs(self, loc):
             self.headers = ['hdf5.h']
             lib_env = env.Clone()
             lib_env.PrependUnique(LIBS=['hdf5'])
             lib_env.PrependUnique(LIBPATH=[libdir])
             lib_env.PrependUnique(RPATH=[libdir])
             #Get include dir
             lib_env.PrependUnique(CPPPATH=libdir + '/include')
             yield lib_env
         else:
            raise RuntimeError("Error trying to use 'h5pcc'")
     except:
         # if error in 'h5pcc --print-file'
         for env in Package.gen_envs(self, loc):
           self.headers = ['hdf5.h']
           if self.find_libraries(loc[2], 'hdf5'):
             env.PrependUnique(LIBS=['hdf5'])
             yield env
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [os.path.join('StGermain', 'StGermain.h'),
                         os.path.join('StgDomain', 'StgDomain.h')]
         if self.find_libraries(loc[2], 'StgDomain'):
             env.PrependUnique(LIBS=['StgDomain'])
             yield env
示例#6
0
 def gen_envs(self, loc):
     #env = self.env.Clone()
     for env in Package.gen_envs(self, loc):
         self.headers = ['png.h']
         if self.find_libraries(loc[2], 'png'):
             env.PrependUnique(LIBS=['png'])
             yield env
示例#7
0
 def gen_envs(self, loc):
     #env = self.env.Clone()
     for env in Package.gen_envs(self, loc):
         self.headers = ['png.h']
         if self.find_libraries(loc[2], 'png'):
             env.PrependUnique(LIBS=['png'])
             yield env
示例#8
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['Python.h']
         if self.find_libraries(loc[2], 'python'):
             env.PrependUnique(LIBS=['python'])
             yield env
         if self.find_libraries(loc[2], 'python3.5m'):
             env.AppendUnique(
                 CPPPATH=[os.path.join(self.location[1][0], 'python3.5m')])
             env.PrependUnique(LIBS=['python3.5m'])
             yield env
         if self.find_libraries(loc[2], 'python3.6m'):
             env.AppendUnique(
                 CPPPATH=[os.path.join(self.location[1][0], 'python3.6m')])
             env.PrependUnique(LIBS=['python3.6m'])
             yield env
         if self.find_libraries(loc[2], 'python3.7m'):
             env.AppendUnique(
                 CPPPATH=[os.path.join(self.location[1][0], 'python3.7m')])
             env.PrependUnique(LIBS=['python3.7m'])
             yield env
         if self.find_libraries(loc[2], 'python3.8'):
             env.AppendUnique(
                 CPPPATH=[os.path.join(self.location[1][0], 'python3.8')])
             env.PrependUnique(LIBS=['python3.8'])
             yield env
示例#9
0
    def gen_envs(self, loc):
        for env in Package.gen_envs(self, loc):
            self.headers = ['gl.h']

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

            yield env
示例#10
0
    def gen_envs(self, loc):
        for env in Package.gen_envs(self, loc):
            self.headers = ['gl.h', 'glu.h']

            env.PrependUnique(LIBS=['GL', 'GLU'])

            yield env
示例#11
0
 def gen_envs(self, loc):
     libs = "globus_io_gcc32dbg globus_ftp_control_gcc32dbg globus_ftp_client_gcc32dbg globus_gass_transfer_gcc32dbg globus_wsrf_core_tools_gcc32dbg globus_c_wsrf_resource_gcc32dbg globus_wsa_bindings_gcc32dbg globus_ds_bindings_gcc32dbg globus_wsu_bindings_gcc32dbg globus_wsp_bindings_gcc32dbg globus_wst_bindings_gcc32dbg globus_wsse_bindings_gcc32dbg globus_wsseu_bindings_gcc32dbg globus_wsc_bindings_gcc32dbg globus_wsbf_bindings_gcc32dbg globus_wsnt_bindings_gcc32dbg globus_wsrl_bindings_gcc32dbg globus_wsrp_bindings_gcc32dbg globus_wssg_bindings_gcc32dbg globus_notification_consumer_bindings_gcc32dbg globus_subscription_manager_bindings_gcc32dbg globus_ws_messaging_gcc32dbg globus_usage_gcc32dbg globus_xio_gcc32dbg gssapi_error_gcc32dbg globus_gss_assist_gcc32dbg globus_gssapi_gsi_gcc32dbg globus_gsi_proxy_core_gcc32dbg globus_gsi_credential_gcc32dbg globus_gsi_callback_gcc32dbg globus_oldgaa_gcc32dbg globus_gsi_sysconfig_gcc32dbg globus_gsi_cert_utils_gcc32dbg globus_openssl_gcc32dbg globus_openssl_error_gcc32dbg globus_callout_gcc32dbg globus_proxy_ssl_gcc32dbg globus_common_gcc32dbg ssl_gcc32dbg crypto_gcc32dbg xml2_gcc32dbg ltdl_gcc32dbg"
     libs = libs.split()
     for env in Package.gen_envs(self, loc):
         self.headers = []
         if self.find_libraries(loc[2], libs):
             env.PrependUnique(LIBS=libs)
             yield env
示例#12
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         # the following is required to force libxml2 to not use the cpp-api
         env.AppendUnique(CPPDEFINES=["U_SHOW_CPLUSPLUS_API=0",])
         self.headers = [os.path.join('libxml', 'parser.h')]
         if self.find_libraries(loc[2], 'xml2'):
             env.PrependUnique(LIBS=['xml2'])
             yield env
示例#13
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['gl.h', 'osmesa.h']
         if self.find_libraries(loc[2], 'OSMesa'):
             env.PrependUnique(LIBS=['OSMesa', 'GLU', 'GL'])
             #OK: Hack to force search for libGL in mesa dirs instead of system paths
             env.PrependUnique(RPATH=[loc[2][0] + '/mesa', loc[2][0]])
             env.PrependUnique(LIBPATH=[loc[2][0] + '/mesa', loc[2][0]])
             yield env
示例#14
0
 def add_package(self, name):
     if name not in pkg_names:
         sys.exit(
             "\n\nERROR: Package %s not found in the list. Check this file: %s\n\n"
             % (name, config.__file__))
     else:
         print "Will use %s package.." % name
         self.package_list.append(Package(name, self))
         self.info_file.write("Using package:	%s\n" % name)
示例#15
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [
             os.path.join('StGermain', 'StGermain.h'),
             os.path.join('StgDomain', 'StgDomain.h')
         ]
         if self.find_libraries(loc[2], 'StgDomain'):
             env.PrependUnique(LIBS=['StgDomain'])
             yield env
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
     	# lets default to clang where on Darwin. Also note the stdlib option, which is required for some business relating to std::strings & c11
         if platform.system() == "Darwin":
             env['CXX'] = 'clang++ -stdlib=libc++'
         self.headers = ['spatialdata/spatialdb/SimpleDB.hh', 'spatialdata/spatialdb/SimpleDBQuery.hh']
         if self.find_libraries(loc[2], 'spatialdata'):
             env.PrependUnique(LIBS=['spatialdata'] )
             yield env
示例#17
0
 def gen_envs(self, loc):
     try:
         import numpy as np
     except ImportError:
         print "Cannot import numpy. Perhaps it is not installed."
         raise
     for env in Package.gen_envs(self, loc):
         self.headers = [self.python.headers[0], 'numpy/arrayobject.h']
         env.AppendUnique(CPPPATH=[self.location[1][0]])
         yield env
示例#18
0
 def gen_envs(self, loc):
     try:
         import numpy as np
     except ImportError:
         print "Cannot import numpy. Perhaps it is not installed."
         raise
     for env in Package.gen_envs(self, loc):
         self.headers = [self.python.headers[0], 'numpy/arrayobject.h']
         env.AppendUnique(CPPPATH=[self.location[1][0]])
         yield env
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [os.path.join('StGermain', 'StGermain.h'),
                         os.path.join('StgDomain', 'StgDomain.h'),
                         os.path.join('StgFEM', 'StgFEM.h'),
                         os.path.join('PICellerator', 'PICellerator.h'),
                         os.path.join('Underworld', 'Underworld.h')]
         if self.find_libraries(loc[2], 'Underworld'):
             env.PrependUnique(LIBS=['Underworld'])
             yield env
示例#20
0
    def gen_envs(self, loc):
        for env in Package.gen_envs(self, loc):
            self.headers = ['gl.h', 'glu.h']

            if platform.system() == "Darwin":
                env.AppendUnique(CPPPATH=['/System/Library/Frameworks/OpenGL.framework/Headers'])
                env.AppendUnique(FRAMEWORKS=['OpenGL'])
            else:
                env.PrependUnique(LIBS=['GL', 'GLU'])

            yield env
示例#21
0
文件: MPI.py 项目: eandbsoftware/gale
    def gen_envs(self, loc):
	# If we've been given an MPI compiler just try that.
	if os.path.basename(self.env['CXX']) in ['mpicxx', 'mpic++', 'mpiCC']:
            yield self.env.Clone()
            return

        # If flagged to do so, try standard MPI compilers, unless
        # we were given other options to use.
        if self.try_compilers and \
                self.get_option('mpi_dir') is None and \
                self.get_option('mpi_inc_dir') is None and \
                self.get_option('mpi_lib_dir') is None and \
                self.get_option('mpi_libs') is None:
            env = self.env.Clone()
            env['CXX'] = 'mpicxx'
            yield env

        for env in Package.gen_envs(self, loc):

            # Not sure which extra libraries to check for, so try them all.
            extra_libs = [[], ['rt'], ['pthread', 'rt'],
                          ['dl'], ['dl', 'rt'], ['dl', 'pthread'],
                          ['dl', 'pthread', 'rt']]
            for libs in extra_libs:

                # Check for OpenMPI with nsl and util libs.
                if self.find_libraries(loc[2], ['open-pal', 'nsl', 'util']):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpi', 'open-rte', 'open-pal', 'nsl', 'util'] + libs)
                    yield lib_env

                # Check for OpenMPI.
                if self.find_libraries(loc[2], 'open-pal'):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpi', 'open-rte', 'open-pal'] + libs)
                    yield lib_env

                # Check for general MPI.
                if self.find_libraries(loc[2], 'mpi'):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpi'] + libs)
                    yield lib_env

                # Check for MPICH + pmpich.
                if self.find_libraries(loc[2], ['mpich', 'pmpich']):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['pmpich', 'mpich'] + libs)
                    yield lib_env

                # Check for MPICH
                if self.find_libraries(loc[2], 'mpich'):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpich'] + libs)
                    yield lib_env
示例#22
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['X11/Xlib.h', 'GL/glx.h']
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=['X11'])
         yield lib_env
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=['X11', 'Xau', 'Xdmcp'])
         yield lib_env
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=['X11', 'xcb', 'xcb-xlib', 'Xau', 'Xdmcp'])
         yield lib_env
示例#23
0
文件: X11.py 项目: eandbsoftware/gale
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ["Xlib.h", "GL/glx.h"]
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=["X11", "Xmu", "GL"])
         yield lib_env
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=["X11", "Xmu", "GL", "Xau", "Xdmcp"])
         yield lib_env
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=["X11", "Xmu", "GL", "xcb", "xcb-xlib", "Xau", "Xdmcp"])
         yield lib_env
示例#24
0
    def gen_envs(self, loc):
        for env in Package.gen_envs(self, loc):
            self.headers = [os.path.join("glut.h")]

            if platform.system() == "Darwin":
                env.AppendUnique(CPPPATH=["/System/Library/Frameworks/GLUT.framework/Headers"])
                env.AppendUnique(FRAMEWORKS=["GLUT"])
                env.AppendUnique(CPPPATH=["/System/Library/Frameworks/OpenGL.framework/Headers"])
                env.AppendUnique(FRAMEWORKS=["OpenGL"])
            else:
                env.PrependUnique(LIBS=["glut"])
            yield env
示例#25
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         #SDL conftest won't work on mac with SDL.h, use another header
         self.headers = ['SDL/SDL_video.h']
         if platform.system() == "Darwin":
             env.PrependUnique(LIBS=['SDL', 'SDLmain'])
             env.AppendUnique(CPPPATH=['/System/Library/Frameworks/OpenGL.framework/Headers'])
             env.AppendUnique(FRAMEWORKS=['OpenGL'])
             env.AppendUnique(FRAMEWORKS=['Cocoa'])
         else:
             env.PrependUnique(LIBS=['SDL'])
         yield env
示例#26
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [
             os.path.join('StGermain', 'StGermain.h'),
             os.path.join('StgDomain', 'StgDomain.h'),
             os.path.join('StgFEM', 'StgFEM.h'),
             os.path.join('PICellerator', 'PICellerator.h'),
             os.path.join('Underworld', 'Underworld.h')
         ]
         if self.find_libraries(loc[2], 'Underworld'):
             env.PrependUnique(LIBS=['Underworld'])
             yield env
示例#27
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         # lets default to clang where on Darwin. Also note the stdlib option, which is required for some business relating to std::strings & c11
         if platform.system() == "Darwin":
             env['CXX'] = 'clang++ -stdlib=libc++'
         self.headers = [
             'spatialdata/spatialdb/SimpleDB.hh',
             'spatialdata/spatialdb/SimpleDBQuery.hh'
         ]
         if self.find_libraries(loc[2], 'spatialdata'):
             env.PrependUnique(LIBS=['spatialdata'])
             yield env
示例#28
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['X11/Xlib.h', 'GL/glx.h']
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=['X11'])
         yield lib_env
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=['X11', 'Xau', 'Xdmcp'])
         yield lib_env
         lib_env = env.Clone()
         lib_env.PrependUnique(
             LIBS=['X11', 'xcb', 'xcb-xlib', 'Xau', 'Xdmcp'])
         yield lib_env
示例#29
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [
             os.path.join("StGermain", "StGermain.h"),
             os.path.join("StgDomain", "StgDomain.h"),
             os.path.join("StgFEM", "StgFEM.h"),
             os.path.join("PICellerator", "PICellerator.h"),
             os.path.join("Underworld", "Underworld.h"),
             os.path.join("Experimental", "Experimental.h"),
         ]
         if self.find_libraries(loc[2], "Underworld"):
             env.PrependUnique(LIBS=["Underworld"])
             yield env
示例#30
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['Python.h']
         if self.find_libraries(loc[2], 'python'):
             env.PrependUnique(LIBS=['python'])
             yield env
         ver = "python" + get_python_version()
         for ver in [ver, ver + "m"]:
             if self.find_libraries(loc[2], ver):
                 env.AppendUnique(
                     CPPPATH=[os.path.join(self.location[1][0], ver)])
                 env.PrependUnique(LIBS=[ver])
                 yield env
示例#31
0
文件: SDL.py 项目: eandbsoftware/gale
    def gen_envs(self, loc):
        for env in Package.gen_envs(self, loc):
            self.headers = ['SDL.h']
            lib_env = env.Clone()
            lib_env.PrependUnique(LIBS=['SDL'])
            yield lib_env
            lib_env = env.Clone()
            lib_env.PrependUnique(LIBS=['SDL', 'SDLmain'])
            yield lib_env

	if platform.system() == "Darwin":
            env = self.env.Clone()
            env.PrependUnique(LIBS=['SDL', 'SDLmain'])
            env.AppendUnique(CPPPATH=['/System/Library/Frameworks/SDL.framework/Headers'])
            yield env
示例#32
0
    def gen_envs(self, loc):
        for env in Package.gen_envs(self, loc):
            self.headers = [os.path.join('glut.h')]

            if platform.system() == "Darwin":
                env.AppendUnique(CPPPATH=[
                    '/System/Library/Frameworks/GLUT.framework/Headers'
                ])
                env.AppendUnique(FRAMEWORKS=['GLUT'])
                env.AppendUnique(CPPPATH=[
                    '/System/Library/Frameworks/OpenGL.framework/Headers'
                ])
                env.AppendUnique(FRAMEWORKS=['OpenGL'])
            else:
                env.PrependUnique(LIBS=['glut'])
            yield env
示例#33
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['Python.h']
         if self.find_libraries(loc[2], 'python'):
             env.PrependUnique(LIBS=['python'])
             yield env
         if self.find_libraries(loc[2], 'python2.7'):
             env.AppendUnique(CPPPATH=[os.path.join(self.location[1][0],'python2.7')])
             env.PrependUnique(LIBS=['python2.7'])
             yield env
         if self.find_libraries(loc[2], 'python2.6'):
             env.AppendUnique(CPPPATH=[os.path.join(self.location[1][0],'python2.6')])
             env.PrependUnique(LIBS=['python2.6'])
             yield env
         if self.find_libraries(loc[2], 'python2.5'):
             env.AppendUnique(CPPPATH=[os.path.join(self.location[1][0],'python2.5')])
             env.PrependUnique(LIBS=['python2.5'])
             yield env
示例#34
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [os.path.join('sqlite3.h')]
         if self.find_libraries(loc[2], 'sqlite3'):
             env.PrependUnique(LIBS=['sqlite3'])
             yield env
示例#35
0
 def gen_base_extensions(self):
     for e in Package.gen_base_extensions(self):
         yield e
         # Add GL to the inclue dirs, but keep the original include
         # dirs in there too.
         yield (e[0] + [os.path.join(h, 'GL') for h in e[0]], e[1])
示例#36
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         env.PrependUnique(LIBS=['tellus'])
         yield env
示例#37
0
 def gen_base_extensions(self):
     for e in Package.gen_base_extensions(self):
         yield e
         yield ([os.path.join(i, 'petsc') for i in e[0]], e[1])
示例#38
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [os.path.join('libxml', 'parser.h')]
         if self.find_libraries(loc[2], 'xml2'):
             env.PrependUnique(LIBS=['xml2'])
             yield env
示例#39
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = [os.path.join('pcu', 'pcu.h')]
         if self.find_libraries(loc[2], 'pcu'):
             env.PrependUnique(LIBS=['pcu'])
             yield env
示例#40
0
 def gen_base_extensions(self):
     for e in Package.gen_base_extensions(self):
         yield e
         yield ([os.path.join(i, 'petsc') for i in e[0]], e[1])
示例#41
0
 def __init__(self, name, env, **kw):
     Package.__init__(self, name, env, **kw)
     self.try_compilers = True
示例#42
0
文件: MPI.py 项目: eandbsoftware/gale
 def __init__(self, name, env, **kw):
     Package.__init__(self, name, env, **kw)
     self.try_compilers = True
示例#43
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['math.h']
         if self.find_libraries(loc[2], 'm'):
             env.PrependUnique(LIBS=['m'])
             yield env
示例#44
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['libavcodec/avcodec.h', 'libavformat/avformat.h']
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=['avcodec', 'avutil', 'avformat'])
         yield lib_env
示例#45
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['glu.h', 'osmesa.h']
         if self.find_libraries(loc[2], 'OSMesa'):
             env.PrependUnique(LIBS=['OSMesa', 'GLU'])
             yield env
示例#46
0
 def gen_base_extensions(self):
     for e in Package.gen_base_extensions(self):
         yield e
         yield (e[0] + [os.path.join(h, 'GL') for h in e[0]], e[1])
示例#47
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['stdlib.h', 'stdio.h', 'jpeglib.h']
         if self.find_libraries(loc[2], 'jpeg'):
             env.PrependUnique(LIBS=['jpeg'])
             yield env
示例#48
0
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         env.PrependUnique(LIBS=["sedsim"])
         yield env
示例#49
0
    def gen_envs(self, loc):
	# If we've been given an MPI compiler just try that.
	if os.path.basename(self.env['CC']) in ['mpicc', 'mpicxx']:
            yield self.env.Clone()
            return

        # If flagged to do so, try standard MPI compilers, unless
        # we were given other options to use.
        if self.try_compilers and \
                self.get_option('mpi_dir') is None and \
                self.get_option('mpi_inc_dir') is None and \
                self.get_option('mpi_lib_dir') is None and \
                self.get_option('mpi_libs') is None:
            env = self.env.Clone()
            env['CC'] = 'mpicc'
            env['CXX'] = 'mpicxx'
            yield env

        # attempt to use mpicc to find libs reqired
        import subprocess
        # test for open-mpi 
        try:
            proc = subprocess.Popen(['mpicc', '-showme:libs'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            if proc.wait() == 0:
              env = self.env.Clone()
              libs=proc.communicate()[0].split()
              for env in Package.gen_envs(self, loc):
                lib_env = env.Clone()
                lib_env.PrependUnique(LIBS=libs)
                yield lib_env
        except OSError:
            # if error in 'mpicc -showme:libs'
            import sys
            #sys.stdout.write("no mpicc here, ")

        # attempt to find everything from mpicc.conf
        mpiconf = None
        if loc[0]:
           mpiconf = os.path.join( loc[0], 'etc/mpicc.conf' )
           if not os.path.exists( mpiconf ):
              mpiconf = None

        if mpiconf:
           # rape and pilage through the mpicc.conf file
           from distutils import sysconfig 
           vars = {} 
           flags = ''
           # get a list of all 'variable' names
           sysconfig.parse_makefile(mpiconf, vars) 
           if 'MPILIBNAME' in vars:
              flags += vars['MPILIBNAME']
           if 'LIBS' in vars:
              flags += vars['LIBS']
           if 'MPI_OTHERLIBS' in vars:
              flags += vars['MPI_OTHERLIBS']
           if flags != []:
              # format the flags string 
              flags_nice=flags.replace('"', '').replace('-l', ' ').split(' ')
              # remove empty elements
              for xxx in reversed(flags_nice):
                 if xxx=='': 
                    flags_nice.remove(xxx)

              for env in Package.gen_envs(self, loc):
                 lib_env = env.Clone()
                 lib_env.PrependUnique(LIBS=flags_nice)
                 yield lib_env


        for env in Package.gen_envs(self, loc):

            # Not sure which extra libraries to check for, so try them all.
            extra_libs = [[], ['rt'], ['pthread', 'rt'],
                          ['dl'], ['dl', 'rt'], ['dl', 'pthread'],
                          ['dl', 'pthread', 'rt']]
            for libs in extra_libs:

                # Check for OpenMPI with nsl and util libs.
                if self.find_libraries(loc[2], ['open-pal', 'nsl', 'util']):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpi', 'open-rte', 'open-pal', 'nsl', 'util'] + libs)
                    yield lib_env

                # Check for OpenMPI.
                if self.find_libraries(loc[2], 'open-pal'):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpi', 'open-rte', 'open-pal'] + libs)
                    yield lib_env

                # Check for general MPI.
                if self.find_libraries(loc[2], 'mpi'):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpi'] + libs)
                    yield lib_env

                # Check for MPICH + pmpich.
                if self.find_libraries(loc[2], ['mpich', 'pmpich']):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['pmpich', 'mpich'] + libs)
                    yield lib_env

                # Check for MPICH
                if self.find_libraries(loc[2], 'mpich'):
                    lib_env = env.Clone()
                    lib_env.PrependUnique(LIBS=['mpich'] + libs )
                    yield lib_env
 def gen_envs(self, loc):
     for env in Package.gen_envs(self, loc):
         self.headers = ['libavcodec/avcodec.h', 'libavformat/avformat.h']
         lib_env = env.Clone()
         lib_env.PrependUnique(LIBS=['avcodec', 'avutil', 'avformat'])
         yield lib_env