Пример #1
0
                           'functestbuilder', 'icebuilder', 'cloptions' ]
                  )

# Importing TERM allows programs (such as clang) to produce colour output
# if the terminal supports it
if 'TERM' in os.environ:
    env['ENV']['TERM'] = os.environ['TERM']

opts = Variables('sconsopts.cfg', ARGUMENTS)
opts.Add(BoolVariable("nompi", "Disable MPI", False))
opts.Add(BoolVariable("openmp", "Use OpenMP", False))
opts.Add(BoolVariable("update", "svn update?", False))
opts.Update(env)

# Standard compiler flags
env.AppendUnique(CCFLAGS=['-Wall'])
env.AppendUnique(CCFLAGS=['-O2'])
env.AppendUnique(CCFLAGS=['-g'])
env.AppendUnique(CCFLAGS=['-DASKAP_DEBUG'])

# If the system has environment modules support we need to import
# the whole environment
if has_environment_modules():
    env["ENV"] = os.environ

# Support setting of "RBUILD_NOMPI" in the environment, because forgetting
# to pass nompi=1 on the command line is a common error
if os.environ.has_key('RBUILD_NOMPI') and os.environ['RBUILD_NOMPI'] == '1':
    print "info: RBUILD_NOMPI=1 found in env, building without MPI support"
    env['nompi'] = 1
Пример #2
0
def win_escape(x):
    if x[-1] == '\\':
        x = x + '\\'
    return x


EnsureSConsVersion(3, 1, 1)

# One way is to import everything into the construction env from the environment
#env = Environment(ENV=os.environ)

# Another way is to just import the path
# Note For windows we also need temporary paths adding in for windows build tools
env = Environment(ENV={'PATH': os.environ['PATH']})
if sys.platform == 'win32':
    env.AppendUnique(ENV={'SystemDrive': os.environ['SystemDrive']})
    env.AppendUnique(ENV={'TEMP': os.environ['TEMP']})

env.Replace(BUILDDIR='../build')
env.Replace(SRCDIR='.')
env.Replace(CPPPATH='./include')

tgts = []

# Create Objects
scons_obj1 = env.Object(target='${BUILDDIR}/hellomake',
                        source='${SRCDIR}/hellomake')
scons_obj2 = env.Object(target='${BUILDDIR}/hellofunc',
                        source='${SRCDIR}/hellofunc')

# Link the objects to an exe
Пример #3
0
# if the terminal supports it
if 'TERM' in os.environ:
    env['ENV']['TERM'] = os.environ['TERM']

opts = Variables('sconsopts.cfg', ARGUMENTS)
opts.Add(BoolVariable("nompi", "Disable MPI", False))
opts.Add(BoolVariable("openmp", "Use OpenMP", False))
opts.Add(BoolVariable("squash", "Squash some compiler warnings",False))
opts.Add(BoolVariable("usepgi", "Use Portland Group Compiler",False))
opts.Add(BoolVariable("cpp11", "Use c++11",False))
opts.Add(BoolVariable("oldcpp11", "Use c++11 (old flag)",False))
opts.Add(BoolVariable("update", "svn update?", False))
opts.Update(env)

# Standard compiler flags
env.AppendUnique(CCFLAGS=['-O2'])
env.AppendUnique(CCFLAGS=['-g'])
env.AppendUnique(CCFLAGS=['-DASKAP_DEBUG'])

# Compiler flags related to the upgrade to C++11 support
# For most of these, we should reinstate the warnings and fix the code,
# however the flags can be uncommented to suppress most of the current
# compatibility warnings
if env['cpp11']:
    env.AppendUnique(CCFLAGS=['-std=c++11'])
if env['oldcpp11']:
    env.AppendUnique(CCFLAGS=['-std=c++0x'])

env.AppendUnique(CCFLAGS=['-fdiagnostics-show-option'])
# env.AppendUnique(CCFLAGS=['-Wno-deprecated-declarations'])
# env.AppendUnique(CCFLAGS=['-Wno-deprecated'])