Esempio n. 1
0
    # chrpath, etc.
    if "PATH" not in os.environ: os.environ["PATH"] = ""
    os.environ["PATH"] = P.join(opt.build_root, 'install/bin') + \
                         os.pathsep + os.environ["PATH"]

    MIN_CC_VERSION = 4.4

    # -Wl,-z,now ?
    build_env = Environment(CC=opt.cc,
                            CXX=opt.cxx,
                            F77=opt.f77,
                            CFLAGS='-O3 -g',
                            CXXFLAGS='-O3 -g',
                            LDFLAGS=r'-Wl,-rpath,/%s' % ('a' * 100),
                            MAKEOPTS='-j%s' % opt.threads,
                            DOWNLOAD_DIR=opt.download_dir,
                            BUILD_DIR=P.join(opt.build_root, 'build'),
                            INSTALL_DIR=P.join(opt.build_root, 'install'),
                            MISC_DIR=P.join(opt.build_root, 'misc'),
                            PKG_CONFIG_PATH=P.join(opt.build_root, 'install',
                                                   'lib', 'pkgconfig'),
                            PATH=os.environ['PATH'],
                            FAST=str(int(opt.fast)))

    if opt.ld_library_path is not None:
        build_env['LD_LIBRARY_PATH'] = opt.ld_library_path

    # Bugfix, add compiler's libraries to LD_LIBRARY_PATH.
    comp_path = which(build_env['CC'])
    libdir1 = P.join(P.dirname(P.dirname(comp_path)), "lib")
    libdir2 = P.join(P.dirname(P.dirname(comp_path)), "lib64")
Esempio n. 2
0
    compiler_root = os.path.dirname(os.path.dirname(which(opt.cc)))
    path_to_libs = P.join(compiler_root, 'lib') + ':' + P.join(
        compiler_root, 'lib64')
    install_dir = P.join(opt.build_root, 'install')
    build_env = Environment(
        CC       = opt.cc,
        CXX      = opt.cxx,
        GFORTRAN = opt.gfortran,
        CFLAGS   = '-O3',
        CXXFLAGS = '-O3',
        BUILD_DIR    = P.join(opt.build_root, 'build'),
        INSTALL_DIR  = install_dir,
        # Use this meaningless RPATH of 'a's so later we have enough room the obtained
        # path to fit in a real path. Also set the paths to the compiler libs
        # and to installed libs.
        LDFLAGS  = r'-Wl,-rpath,/%s' % ('a'*100) + ' -Wl,-rpath,' + path_to_libs + \
         ' -Wl,-rpath,' + install_dir + '/lib',
        MAKEOPTS = '-j%s' % opt.threads,
        DOWNLOAD_DIR = opt.download_dir,
        ASP_DEPS_DIR = opt.asp_deps_dir,
        MISC_DIR = P.join(opt.build_root, 'misc'),
        PKG_CONFIG_PATH = P.join(opt.build_root, 'install', 'lib', 'pkgconfig'),
        PATH = os.environ['PATH'],
        LD_LIBRARY_PATH = os.environ['LD_LIBRARY_PATH'],
        FAST = str(int(opt.fast)),
        SKIP_TESTS = str(int(opt.skip_tests)),
        )

    if opt.ld_library_path is not None:
        build_env['LD_LIBRARY_PATH'] = opt.ld_library_path