Ejemplo n.º 1
0
def generate(env):
    """Add construction variables for an external module to an Environment."""
    if (env['PLATFORM']=='darwin'):
        env.AppendUnique(FRAMEWORKS=["veclib"])
    else:
        if (env.has_key("L_LAPACK")):
            return      # assume found
    
        # - dependent library -
        trscons_blas.generate(env)
    
        l_lapack = "lapack"

        # - look for library -
        checkdir = env.get("LAPACK_LIBRARY_PATH",None)
        lsearch = transpSConsUtils.findDirectory(env,l_lapack,env['LD_LIBRARY_PATH'],
                                             checkdir=checkdir,type=3)
        if (lsearch):
            t_lapack = os.path.realpath(lsearch[0])
        else:
            raise ValueError("unable to find the lapack library")

        env['L_LAPACK'] = [ l_lapack ] + env.Split(env['L_BLAS'])
    
        env.AppendUnique(LIBPATH=[t_lapack])
Ejemplo n.º 2
0
def generate(env):
    """Add construction variables for an external module to an Environment."""
    if (env.has_key("L_SUPERLU")):
        return      # assume found
    
    # - dependent library -
    trscons_blas.generate(env)
    
    l_superlu = "superlu"

    # - look for library -
    checkdir = env.get("SUPERLU_LIBRARY_PATH",None)
    if (checkdir==None):
        checkdir = os.environ.get("SUPERLU_ROOT",None)
        if (checkdir!=None):
            checkdir = os.path.join(checkdir.strip(),"lib")
            
    lsearch = transpSConsUtils.findDirectory(env,l_superlu,env['LD_LIBRARY_PATH'],
                                             checkdir=checkdir,type=3)
    if (lsearch):
        t_superlu = os.path.realpath(lsearch[0])
    else:
        raise ValueError("unable to find the superlu library")

    # - look for includes -
    i_superlu = []
    checkdir=env.get("SUPERLU_INCLUDE_PATH",
                     os.path.join(os.path.split(lsearch[0])[0],"include"))  # guess
    for inc in ["slu_ddefs.h"]:
        isearch = transpSConsUtils.findDirectory(env,inc,env['INCLUDE_PATH'],
                                                 checkdir=checkdir)
        if (isearch):
            if (checkdir != isearch[0]):
                checkdir += " "+isearch[0]
            x = os.path.realpath(isearch[0])
            if (x not in i_superlu):
                i_superlu.append(x)
        else:
            raise ValueError("unable to find the superlu include file "+inc)

    env['L_SUPERLU'] = [ l_superlu ] + env.Split(env['L_BLAS'])
    
    env.AppendUnique(LIBPATH=[t_superlu], CPPPATH=i_superlu)