/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1023 by gross, Tue Mar 13 05:43:36 2007 UTC revision 1083 by ksteube, Thu Apr 12 01:15:01 2007 UTC
# Line 47  if os.path.isdir('/opt/UFconfig'): Line 47  if os.path.isdir('/opt/UFconfig'):
47  else:  else:
48     ufc_path_default=None     ufc_path_default=None
49    
50    if os.path.isdir('/usr/local/include') and os.path.isdir('/usr/local/lib'):
51      netCDF_path_default='/usr/local/include'
52      netCDF_lib_path_default='/usr/local/lib'
53      netCDF_libs_cxx_default=[ 'netcdf_c++', 'netcdf']
54    else:
55      netCDF_path_default=None
56      netCDF_lib_path_default=None
57      netCDF_libs_cxx_default=None
58  # Default options and options help text  # Default options and options help text
59  # These are defaults and can be overridden using command line arguments or an options file.  # These are defaults and can be overridden using command line arguments or an options file.
60  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
61  # DO NOT CHANGE THEM HERE  # DO NOT CHANGE THEM HERE
62    
63    # Where to install?
64    prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)
65    print "Install prefix is: ", prefix
66    
67  if ARGUMENTS.get('options_file',0):  if ARGUMENTS.get('options_file',0):
68     options_file = ARGUMENTS.get('options_file',0)     options_file = ARGUMENTS.get('options_file',0)
69  else:  else:
# Line 62  else: Line 75  else:
75        else:        else:
76           hostname+="_"           hostname+="_"
77     options_file = "scons/"+hostname+"_options.py"     options_file = "scons/"+hostname+"_options.py"
78  print "option file is ",options_file  if os.path.isfile(options_file):
79       print "option file is ",options_file,"."
80    else:
81       print "option file is ",options_file, "(not present)."
82    
83  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
84  opts.AddOptions(  opts.AddOptions(
85  # Where to install esys stuff  # Where to install esys stuff
86    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),    ('incinstall', 'where the esys headers will be installed', prefix+'/include'),
87    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),    ('libinstall', 'where the esys libraries will be installed', prefix+'/lib'),
88    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),    ('pyinstall', 'where the esys python modules will be installed', prefix),
89    ('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"),    ('src_zipfile', 'the source zip file will be installed.', prefix+"/release/escript_src.zip"),
90    ('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"),    ('test_zipfile', 'the test zip file will be installed.', prefix+"/release/escript_tests.zip"),
91    ('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"),    ('src_tarfile', 'the source tar file will be installed.', prefix+"/release/escript_src.tar.gz"),
92    ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),    ('test_tarfile', 'the test tar file will be installed.', prefix+"/release/escript_tests.tar.gz"),
93    ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),    ('examples_tarfile', 'the examples tar file will be installed.', prefix+"/release/doc/escript_examples.tar.gz"),
94    ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),    ('examples_zipfile', 'the examples zip file will be installed.', prefix+"/release/doc/escript_examples.zip"),
95    ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),    ('guide_pdf', 'name of the user guide in pdf format', prefix+"/release/doc/user/guide.pdf"),
96    ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),    ('api_epydoc', 'name of the epydoc api docs directory',prefix+"/release/doc/epydoc"),
97    ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),    ('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"),
98  # Compilation options  # Compilation options
99    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
100    ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/hostname_options.py)", options_file),    ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/hostname_options.py)", options_file),
101    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
102    ('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas'),    ('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),
103    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas'),    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),
104    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
105    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),
106    ('cc_flags_MPI','C compiler flags to use (Release MPI build)', '-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -fno-alias -c99 -w1 -fpic -wd161'),    ('cc_flags_MPI','C compiler flags to use (Release MPI build)', '-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -fno-alias -c99 -w1 -fpic -wd161'),
# Line 118  opts.AddOptions( Line 134  opts.AddOptions(
134    ('blas_libs', 'BLAS libraries to link with', None),    ('blas_libs', 'BLAS libraries to link with', None),
135  # netCDF  # netCDF
136    ('useNetCDF', 'switch on/off the usage of netCDF', 'yes'),    ('useNetCDF', 'switch on/off the usage of netCDF', 'yes'),
137    PathOption('netCDF_path', 'Path to netCDF includes', '/usr/local/include'),    PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
138    PathOption('netCDF_lib_path', 'Path to netCDF libs', '/usr/local/lib'),    PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
139    ('netCDF_libs_cxx', 'netCDF C++ libraries to link with', [ 'netcdf_c++', 'netcdf'] ),    ('netCDF_libs_cxx', 'netCDF C++ libraries to link with', netCDF_libs_cxx_default),
140  # Python  # Python
141  # locations of include files for python  # locations of include files for python
142    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),
# Line 140  opts.AddOptions( Line 156  opts.AddOptions(
156  # MPI  # MPI
157    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
158  )  )
   
 # Initialise Scons Build Environment  
 # check for user environment variables we are interested in  
 try:  
    python_path = os.environ['PYTHONPATH']  
 except KeyError:  
    python_path = ''  
 try:  
    path = os.environ['PATH']  
 except KeyError:  
    path = ''  
 try:  
    ld_library_path = os.environ['LD_LIBRARY_PATH']  
 except KeyError:  
    ld_library_path = ''  
   
159  # Note: On the Altix the intel compilers are not automatically  # Note: On the Altix the intel compilers are not automatically
160  # detected by scons intelc.py script. The Altix has a different directory  # detected by scons intelc.py script. The Altix has a different directory
161  # path and in some locations the "modules" facility is used to support  # path and in some locations the "modules" facility is used to support
# Line 165  except KeyError: Line 165  except KeyError:
165  # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix  # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
166    
167  if os.name != "nt" and os.uname()[4]=='ia64':  if os.name != "nt" and os.uname()[4]=='ia64':
168     env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts)     env = Environment(tools = ['default', 'intelc'], options = opts)
    env['ENV']['PATH'] = path  
    env['ENV']['LD_LIBRARY_PATH'] = ld_library_path  
    env['ENV']['PYTHONPATH'] = python_path  
169     if env['CXX'] == 'icpc':     if env['CXX'] == 'icpc':
170        env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py        env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py
171  elif os.name == "nt":  elif os.name == "nt":
172     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(tools = ['default', 'msvc'], options = opts)
173     env['ENV']['PYTHONPATH'] = python_path     #env = Environment(tools = ['default', 'intelc'], options = opts)
174  else:  else:
175     env = Environment(tools = ['default'], options = opts)     env = Environment(tools = ['default'], options = opts)
176    # Initialise Scons Build Environment
177    # check for user environment variables we are interested in
178    try:
179       python_path = os.environ['PYTHONPATH']
180       env['ENV']['PYTHONPATH'] = python_path
181    except KeyError:
182       python_path = ''
183    
184    try:
185       path = os.environ['PATH']
186     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
187    except KeyError:
188       path = ''
189    try:
190       ld_library_path = os.environ['LD_LIBRARY_PATH']
191     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
192     env['ENV']['PYTHONPATH'] = python_path  except KeyError:
193       ld_library_path = ''
194    
195    
196  # Setup help for options  # Setup help for options
197  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
# Line 204  except KeyError: Line 217  except KeyError:
217     incinstall = None     incinstall = None
218  try:  try:
219     libinstall = env['libinstall']     libinstall = env['libinstall']
220     env.Append(LIBPATH = [libinstall,])     env.Append(LIBPATH = [libinstall,]) # ksteube adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so
221     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
222     if env['PLATFORM'] == "win32":     if env['PLATFORM'] == "win32":
223        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)

Legend:
Removed from v.1023  
changed lines
  Added in v.1083

  ViewVC Help
Powered by ViewVC 1.1.26