/[escript]/branches/py3_attempt2/SConstruct
ViewVC logotype

Diff of /branches/py3_attempt2/SConstruct

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

revision 1137 by gross, Thu May 10 08:11:31 2007 UTC revision 1215 by ksteube, Thu Jul 12 01:14:55 2007 UTC
# Line 29  IS_WINDOWS_PLATFORM = (os.name== "nt") Line 29  IS_WINDOWS_PLATFORM = (os.name== "nt")
29  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
30     tools_prefix="C:\\Program Files\\"     tools_prefix="C:\\Program Files\\"
31  else:  else:
32     tools_prefix="/usr/local/"     tools_prefix="/usr"
33    
34  #==============================================================================================      #==============================================================================================    
35  #      #    
36  #    get the iinstallation prefix  #    get the installation prefix
37  #  #
38  prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)  prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)
39  print "Install prefix is: ", prefix  print "Install prefix is: ", prefix
# Line 57  else: Line 57  else:
57           hostname+=s           hostname+=s
58        else:        else:
59           hostname+="_"           hostname+="_"
60     options_file = "scons"+os.sep+hostname+"_options.py"     options_file = os.path.join("scons",hostname+"_options.py")
61        
62  if os.path.isfile(options_file):  if os.path.isfile(options_file):
63     print "option file is ",options_file,"."     print "option file is ",options_file,"."
# Line 69  opts = Options(options_file, ARGUMENTS) Line 69  opts = Options(options_file, ARGUMENTS)
69  #  #
70  #   check if UMFPACK is installed on the system:  #   check if UMFPACK is installed on the system:
71  #  #
72  umf_path_default=None  uf_root=None
73  umf_lib_path_default=None  for i in [ 'UMFPACK', 'umfpack', 'ufsparse', 'UFSPARSE']:
74  umf_libs_default=None     if os.path.isdir(os.path.join(tools_prefix,'include',i)):
75  if IS_WINDOWS_PLATFORM:         uf_root=i
76     pass         print i," is used form ",tools_prefix
77  else:         break
78     if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib'):  if not uf_root==None:
79        umf_path_default='/opt/UMFPACK/Include'     umf_path_default=os.path.join(tools_prefix,'include',uf_root)
80        umf_lib_path_default='/opt/UMFPACK/Lib'     umf_lib_path_default=os.path.join(tools_prefix,'lib')
81        umf_libs_default=['umfpack']     umf_libs_default=['umfpack']
82       amd_path_default=os.path.join(tools_prefix,'include',uf_root)
83  amd_path_default=None     amd_lib_path_default=os.path.join(tools_prefix,'lib')
84  amd_lib_path_default=None     amd_libs_default=['amd']
85  amd_libs_default=None     ufc_path_default=os.path.join(tools_prefix,'include',uf_root)
86  if IS_WINDOWS_PLATFORM:  else:
87     pass     umf_path_default=None
88  else:     umf_lib_path_default=None
89     if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'):     umf_libs_default=None
90        amd_path_default='/opt/AMD/Include'     amd_path_default=None
91        amd_lib_path_default='/opt/AMD/Lib'     amd_lib_path_default=None
92        amd_libs_default=['amd']     amd_libs_default=None
93       ufc_path_default=None
94  ufc_path_default=None  #
 if IS_WINDOWS_PLATFORM:  
    pass  
 else:  
    if os.path.isdir('/opt/UFconfig'):  
         ufc_path_default='/opt/UFconfig'  
95  #==========================================================================  #==========================================================================
96  #  #
97  #    python installation:  #    python installation:
98  #  #
99  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
100     python_path_default='C:\\Program Files\\python%s%s'%(sys.version_info[0],sys.version_info[1])+"\\include"     python_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"include")
101     python_lib_path_default='C:\\Program Files\\python%s%s'%(sys.version_info[0],sys.version_info[1])+"\\libs"     python_lib_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"libs")
102     python_libs_default=["python%s%s"%(sys.version_info[0],sys.version_info[1])]     python_libs_default=["python%s%s"%(sys.version_info[0],sys.version_info[1])]
103  else:  else:
104     python_path_default='/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])     python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1]))
105     python_lib_path_default='/usr/lib'     python_lib_path_default=os.path.join(tools_prefix,'lib')
106     python_libs_default=["python%s.%s"%(sys.version_info[0],sys.version_info[1])]     python_libs_default=["python%s.%s"%(sys.version_info[0],sys.version_info[1])]
107    
108  #==========================================================================  #==========================================================================
109  #  #
110  #    boost installation:  #    boost installation:
111  #  #
112  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
113     boost_libs_path_default='C:\\Program Files\\boost\\lib\\'     boost_libs_path_default=os.path.join(tools_prefix,'boost','lib')
114     boost_libs_default=None     boost_libs_default=None
115     for i in os.listdir(boost_libs_path_default):     for i in os.listdir(boost_libs_path_default):
116        name=os.path.splitext(i)        name=os.path.splitext(i)
# Line 123  if IS_WINDOWS_PLATFORM: Line 119  if IS_WINDOWS_PLATFORM:
119           boost_libs_default= [ name[0] ]           boost_libs_default= [ name[0] ]
120        else:        else:
121           if not name[0].find("-gd-"): boost_libs_default=[ name[0] ]           if not name[0].find("-gd-"): boost_libs_default=[ name[0] ]
122     boost_path_default='C:\\Program Files\\boost\\include\\boost-%s'%(boost_libs_default[0].split("-")[-1],)     boost_path_default=os.path.join(tools_prefix,'boost','include','boost-%s'%(boost_libs_default[0].split("-")[-1],))
123  else:  else:
124     boost_path_default='/usr/include'     boost_path_default=os.path.join(tools_prefix,'include')
125     boost_libs_path_default='/usr/lib'     boost_libs_path_default=os.path.join(tools_prefix,'lib')
126     boost_libs_default=['boost_python']     boost_libs_default=['boost_python']
127  #==========================================================================  #==========================================================================
128  #  #
129  #    check if netCDF is installed on the system:  #    check if netCDF is installed on the system:
130  #  #
131  netCDF_path_default=None  if IS_WINDOWS_PLATFORM:
132  netCDF_lib_path_default=None      netcdf_dir=os.path.join(tools_prefix,'netcdf')
133  netCDF_libs_default=None      netCDF_path_default=os.path.join(netcdf_dir,'include')
134  useNetCDF_default='yes'      netCDF_lib_path_default=os.path.join(netcdf_dir,'lib')
135  if os.path.isdir(tools_prefix+'netcdf'+os.sep+'include') and os.path.isdir(tools_prefix+'netcdf'+os.sep+'lib'):  else:
136       netCDF_path_default=tools_prefix+'netcdf'+os.sep+'include'      netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')
137       netCDF_lib_path_default=tools_prefix+'netcdf'+os.sep+'lib'      netCDF_lib_path_default=os.path.join(tools_prefix,'lib','netcdf-3')
138       netCDF_libs_default=['netcdf_cpp',  'netcdf' ]  
139    if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):
140         useNetCDF_default='yes'
141         netCDF_libs_default=[ 'netcdf_c++', 'netcdf' ]
142    else:
143       useNetCDF_default='no'       useNetCDF_default='no'
144         netCDF_path_default=None
145         netCDF_lib_path_default=None
146         netCDF_libs_default=None
147    
148    if IS_WINDOWS_PLATFORM:
149            useNetCDF_default='no' # be default netcdf is not supported on windows.
150  #==========================================================================  #==========================================================================
151  #  #
152  #    compile:  #    compile:
# Line 148  if os.path.isdir(tools_prefix+'netcdf'+o Line 154  if os.path.isdir(tools_prefix+'netcdf'+o
154  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
155      # cc_flags_default  = '/GR /EHsc /MD /Qc99 /Qopenmp /Qopenmp-report1 /O3 /G7 /Qprec /Qpar-report1 /QxP /QaxP'      # cc_flags_default  = '/GR /EHsc /MD /Qc99 /Qopenmp /Qopenmp-report1 /O3 /G7 /Qprec /Qpar-report1 /QxP /QaxP'
156      # cc_flags_debug_default  = '/Od /MDd /RTC1 /GR /EHsc /Qc99 /Qopenmp /Qopenmp-report1 /Qprec'      # cc_flags_debug_default  = '/Od /MDd /RTC1 /GR /EHsc /Qc99 /Qopenmp /Qopenmp-report1 /Qprec'
157      cc_flags_default  = '/FD /EHsc /GR  /wd4068 /O2 /Op /MT /W3'      cc_flags_default  = '/nologo /EHsc /GR  /wd4068 /O2 /Op /MT /W3 /Ob0 /Z7'
158      cc_flags_debug_default  ='/FD /EHsc /GR  /wd4068 /Od /RTC1 /MTd /ZI'      cc_flags_debug_default  ='/nologo /EHsc /GR  /wd4068 /Od /RTC1 /MTd /ZI /Ob0 /Z7'
159        
160        cc_flags_default  = '/nologo /EHsc /GR  /O2 /MT /W3 /Ob0 /Z7 /wd4068'
161        cc_flags_debug_default  ='/nologo /EHsc /GR /Od /RTC1 /MTd /W3 /Ob0 /Z7/wd4068'
162      cxx_flags_default = ''      cxx_flags_default = ''
163      cxx_flags_debug_default = ''      cxx_flags_debug_default = ''
164      cc_common_flags = '/FD /EHsc /GR /wd4068 '      cc_common_flags = '/FD /EHsc /GR /wd4068 '
# Line 176  opts.AddOptions( Line 185  opts.AddOptions(
185    ('examples_zipfile', 'the examples zip file will be installed.', prefix+"/release/doc/escript_examples.zip"),    ('examples_zipfile', 'the examples zip file will be installed.', prefix+"/release/doc/escript_examples.zip"),
186    ('guide_pdf', 'name of the user guide in pdf format', prefix+"/release/doc/user/guide.pdf"),    ('guide_pdf', 'name of the user guide in pdf format', prefix+"/release/doc/user/guide.pdf"),
187    ('api_epydoc', 'name of the epydoc api docs directory',prefix+"/release/doc/epydoc"),    ('api_epydoc', 'name of the epydoc api docs directory',prefix+"/release/doc/epydoc"),
188      ('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"),
189    ('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"),    ('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"),
190  # Compilation options  # Compilation options
191    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
# Line 225  opts.AddOptions( Line 235  opts.AddOptions(
235    PathOption('boost_libs_path', 'Path to Boost libs', boost_libs_path_default),    PathOption('boost_libs_path', 'Path to Boost libs', boost_libs_path_default),
236    ('boost_libs', 'Boost libraries to link with', boost_libs_default),    ('boost_libs', 'Boost libraries to link with', boost_libs_default),
237  # Doc building  # Doc building
238  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),    PathOption('doxygen_path', 'Path to Doxygen executable', None),
239  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),
240  # PAPI  # PAPI
241    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
# Line 265  except KeyError: Line 275  except KeyError:
275     python_path = ''     python_path = ''
276    
277  try:  try:
278       omp_num_threads = os.environ['OMP_NUM_THREADS']
279    except KeyError:
280       omp_num_threads = 1
281    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
282    
283    try:
284       env['ENV']['DISPLAY'] = os.environ['DISPLAY']
285       env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']
286    except KeyError:
287       pass
288    
289    try:
290     path = os.environ['PATH']     path = os.environ['PATH']
291     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
292  except KeyError:  except KeyError:
# Line 298  except KeyError: Line 320  except KeyError:
320     incinstall = None     incinstall = None
321  try:  try:
322     libinstall = env['libinstall']     libinstall = env['libinstall']
323     env.Append(LIBPATH = [libinstall,]) # ksteube adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so     env.Append(LIBPATH = [libinstall,]) # Adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so
324     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
325     if env['PLATFORM'] == "win32":     if env['PLATFORM'] == "win32":
326        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
# Line 621  try: Line 643  try:
643  except KeyError:  except KeyError:
644     api_epydoc = None     api_epydoc = None
645    
646    try:
647       api_doxygen = env.Dir(env['api_doxygen'])
648    except KeyError:
649       api_doxygen = None
650    
651  # Zipgets  # Zipgets
652  env.Default(libinstall)  env.Default(libinstall)
653  env.Default(incinstall)  env.Default(incinstall)
# Line 628  env.Default(pyinstall) Line 655  env.Default(pyinstall)
655  env.Alias('release_src',[ src_zipfile, src_tarfile ])  env.Alias('release_src',[ src_zipfile, src_tarfile ])
656  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
657  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
658    env.Alias('examples_zipfile',examples_zipfile)
659    env.Alias('examples_tarfile',examples_tarfile)
660  env.Alias('api_epydoc',api_epydoc)  env.Alias('api_epydoc',api_epydoc)
661    env.Alias('api_doxygen',api_doxygen)
662    env.Alias('guide_html_index',guide_html_index)
663  env.Alias('guide_pdf', guide_pdf)  env.Alias('guide_pdf', guide_pdf)
664  env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])  env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen])
665  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
666  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests')    # target to build all C++ tests
667  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests') # target to build all python tests
# Line 647  env.Alias(init_target) Line 678  env.Alias(init_target)
678  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",
679      "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",      "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",
680          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
681          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI" ])          "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ])
682    
683  # End initialisation section  # End initialisation section
684  # Begin configuration section  # Begin configuration section

Legend:
Removed from v.1137  
changed lines
  Added in v.1215

  ViewVC Help
Powered by ViewVC 1.1.26