Add support for cray

parent 29bafe20
...@@ -65,7 +65,7 @@ vars.AddVariables( ...@@ -65,7 +65,7 @@ vars.AddVariables(
PathVariable( 'buildDir', 'where to build the code', 'build', PathVariable.PathIsDirCreate ), PathVariable( 'buildDir', 'where to build the code', 'build', PathVariable.PathIsDirCreate ),
EnumVariable( 'compiler', 'used compiler', 'gnu', EnumVariable( 'compiler', 'used compiler', 'gnu',
allowed_values=('gnu', 'intel') allowed_values=('gnu', 'intel', 'cray')
), ),
EnumVariable( 'compileMode', 'mode of the compilation', 'release', EnumVariable( 'compileMode', 'mode of the compilation', 'release',
...@@ -103,7 +103,9 @@ vars.AddVariables( ...@@ -103,7 +103,9 @@ vars.AddVariables(
allowed_values=('default', 'mic' ) allowed_values=('default', 'mic' )
), ),
BoolVariable( 'xmlRuntime', 'use a xml-file for runtime parameters', False ) BoolVariable( 'xmlRuntime', 'use a xml-file for runtime parameters', False ),
BoolVariable( 'copyenv', 'copy the whole environment', False )
) )
# external variables # external variables
...@@ -145,13 +147,20 @@ if env['parallelization'] != 'cuda' and env['openGL'] == True: ...@@ -145,13 +147,20 @@ if env['parallelization'] != 'cuda' and env['openGL'] == True:
print >> sys.stderr, '** The parallelization "'+env['parallelization']+'" does not support OpenGL visualization (CUDA only).' print >> sys.stderr, '** The parallelization "'+env['parallelization']+'" does not support OpenGL visualization (CUDA only).'
Exit(3) Exit(3)
# Copy whole environment?
if env['copyenv']:
env.AppendUnique(ENV=os.environ, delete_existing=1)
# #
# precompiler, compiler and linker flags # precompiler, compiler and linker flags
# #
# Select the compiler (MPI and/or Intel, GNU is default) # Select the compiler (MPI and/or Intel, GNU is default)
if env['parallelization'] in ['mpi', 'mpi_with_cuda']: if env['parallelization'] in ['mpi', 'mpi_with_cuda']:
env['CXX'] = env['LINKERFORPROGRAMS'] = env.Detect(['mpiCC', 'mpicxx']) if env['compiler'] == 'cray':
env['CXX'] = 'CC'
else:
env['CXX'] = env['LINKERFORPROGRAMS'] = env.Detect(['mpiCC', 'mpicxx'])
if not env['CXX']: if not env['CXX']:
print >> sys.stderr, '** MPI compiler not found, please update PATH environment variable' print >> sys.stderr, '** MPI compiler not found, please update PATH environment variable'
Exit(1) Exit(1)
...@@ -165,9 +174,12 @@ if env['parallelization'] in ['mpi', 'mpi_with_cuda']: ...@@ -165,9 +174,12 @@ if env['parallelization'] in ['mpi', 'mpi_with_cuda']:
else: else:
if env['compiler'] == 'intel': if env['compiler'] == 'intel':
env['CXX'] = 'icpc' env['CXX'] = 'icpc'
elif env['compiler'] == 'cray':
env['CXX'] = env['LINKERFORPROGRAMS'] = 'CC'
# eclipse specific flag # eclipse specific flag
env.Append(CCFLAGS=['-fmessage-length=0']) if env['compiler'] != 'cray':
env.Append(CCFLAGS=['-fmessage-length=0'])
# xml parameters for the compiler TODO # xml parameters for the compiler TODO
...@@ -181,6 +193,9 @@ if env['compileMode'] == 'debug': ...@@ -181,6 +193,9 @@ if env['compileMode'] == 'debug':
elif env['compiler'] == 'intel': elif env['compiler'] == 'intel':
env.Append(CCFLAGS=['-O0','-g']) env.Append(CCFLAGS=['-O0','-g'])
elif env['compiler'] == 'cray':
env.Append(CCFLAGS=['-O0'])
elif env['compileMode'] == 'release': elif env['compileMode'] == 'release':
env.Append(CPPDEFINES=['NDEBUG']) env.Append(CPPDEFINES=['NDEBUG'])
...@@ -189,9 +204,13 @@ elif env['compileMode'] == 'release': ...@@ -189,9 +204,13 @@ elif env['compileMode'] == 'release':
elif env['compiler'] == 'intel': elif env['compiler'] == 'intel':
env.Append(CCFLAGS=['-O2']) env.Append(CCFLAGS=['-O2'])
elif env['compiler'] == 'cray':
env.Append(CCFLAGS=['-O3'])
# Other compiler flags (for all compilers) # Other compiler flags (for all compilers)
env.Append(CCFLAGS=['-fstrict-aliasing', '-fargument-noalias']) if env['compiler'] != 'cray':
env.Append(CCFLAGS=['-fstrict-aliasing', '-fargument-noalias'])
# Vectorization? # Vectorization?
if env['compileMode'] == 'release' and env['vectorize']: if env['compileMode'] == 'release' and env['vectorize']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment