/[escript]/temp/SConstruct
ViewVC logotype

Diff of /temp/SConstruct

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

revision 1163 by gross, Wed May 23 23:56:39 2007 UTC revision 1217 by ksteube, Wed Jul 18 00:47:01 2007 UTC
# Line 33  else: Line 33  else:
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    
40    # We may also need to know where python's site-packages subdirectory lives
41    python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])
42    
43    if prefix == "/usr":
44       # Install as a standard python package in /usr/lib64 if available, else in /usr/lib
45       if os.path.isdir(  prefix+"/lib64/"+python_version+"/site-packages"):
46          dir_packages =  prefix+"/lib64/"+python_version+"/site-packages"
47          dir_libraries = prefix+"/lib64"
48       elif os.path.isdir(prefix+"/lib/"+python_version+"/site-packages"):
49          dir_packages =  prefix+"/lib/"+python_version+"/site-packages"
50          dir_libraries = prefix+"/lib"
51       else:
52          print "Install prefix is /usr but couldn't find python package directory in either"
53          print "/usr/lib64/"+python_version+"/site-packages or /usr/lib/"+python_version+"/site-packages"
54          sys.exit(1)
55       dir_examples = prefix+"/share/doc/esys"
56    else:
57       # Install using the usual escript directory structure
58       dir_packages = prefix
59       dir_libraries = prefix+"/lib"
60       dir_examples = prefix
61    dir_packages += "/esys"
62    dir_examples += "/examples"
63    
64  print "Install prefix is: ", prefix  print "Install prefix is: ", prefix
65    print " python packages will be installed in:   ", dir_packages
66    print " libraries will be installed in:     ", dir_libraries
67    print " examples will be installed in:      ", dir_examples
68    
69    #==============================================================================================    
70    
71  # Default options and options help text  # Default options and options help text
72  # 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.
# Line 98  else: Line 128  else:
128  #  #
129  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
130     python_path_default=os.path.join(tools_prefix,'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")
131     python_lib_path_default=os.path.join(tools_prefix,'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")
132     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])]
133  else:  else:
134     python_path_default=os.path.join(tools_prefix,'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]))
# Line 174  else: Line 204  else:
204  # DO NOT CHANGE THEM HERE  # DO NOT CHANGE THEM HERE
205  opts.AddOptions(  opts.AddOptions(
206  # Where to install esys stuff  # Where to install esys stuff
207    ('incinstall', 'where the esys headers will be installed', prefix+'/include'),    ('incinstall', 'where the esys headers will be installed',             Dir('#.').abspath+'/include'),
208    ('libinstall', 'where the esys libraries will be installed', prefix+'/lib'),    ('libinstall', 'where the esys libraries will be installed',           dir_libraries),
209    ('pyinstall', 'where the esys python modules will be installed', prefix),    ('pyinstall', 'where the esys python modules will be installed',       dir_packages),
210    ('src_zipfile', 'the source zip file will be installed.', prefix+"/release/escript_src.zip"),    ('exinstall', 'where the esys examples will be installed',             dir_examples),
211    ('test_zipfile', 'the test zip file will be installed.', prefix+"/release/escript_tests.zip"),    ('src_zipfile', 'the source zip file will be installed.',              Dir('#.').abspath+"/release/escript_src.zip"),
212    ('src_tarfile', 'the source tar file will be installed.', prefix+"/release/escript_src.tar.gz"),    ('test_zipfile', 'the test zip file will be installed.',               Dir('#.').abspath+"/release/escript_tests.zip"),
213    ('test_tarfile', 'the test tar file will be installed.', prefix+"/release/escript_tests.tar.gz"),    ('src_tarfile', 'the source tar file will be installed.',              Dir('#.').abspath+"/release/escript_src.tar.gz"),
214    ('examples_tarfile', 'the examples tar file will be installed.', prefix+"/release/doc/escript_examples.tar.gz"),    ('test_tarfile', 'the test tar file will be installed.',               Dir('#.').abspath+"/release/escript_tests.tar.gz"),
215    ('examples_zipfile', 'the examples zip file will be installed.', prefix+"/release/doc/escript_examples.zip"),    ('examples_tarfile', 'the examples tar file will be installed.',       Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),
216    ('guide_pdf', 'name of the user guide in pdf format', prefix+"/release/doc/user/guide.pdf"),    ('examples_zipfile', 'the examples zip file will be installed.',       Dir('#.').abspath+"/release/doc/escript_examples.zip"),
217    ('api_epydoc', 'name of the epydoc api docs directory',prefix+"/release/doc/epydoc"),    ('guide_pdf', 'name of the user guide in pdf format',                  Dir('#.').abspath+"/release/doc/user/guide.pdf"),
218    ('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"),    ('api_epydoc', 'name of the epydoc api docs directory',                Dir('#.').abspath+"/release/doc/epydoc"),
219      ('guide_html', 'name of the directory for user guide in html format',  Dir('#.').abspath+"/release/doc/user/html"),
220      ('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"),
221  # Compilation options  # Compilation options
222    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
223    ('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),
# Line 281  env['ENV']['OMP_NUM_THREADS'] = omp_num_ Line 313  env['ENV']['OMP_NUM_THREADS'] = omp_num_
313    
314  try:  try:
315     env['ENV']['DISPLAY'] = os.environ['DISPLAY']     env['ENV']['DISPLAY'] = os.environ['DISPLAY']
316       env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']
317  except KeyError:  except KeyError:
318     pass     pass
319    
# Line 318  except KeyError: Line 351  except KeyError:
351     incinstall = None     incinstall = None
352  try:  try:
353     libinstall = env['libinstall']     libinstall = env['libinstall']
354     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
355     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
356     if env['PLATFORM'] == "win32":     if env['PLATFORM'] == "win32":
357        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
# Line 326  try: Line 359  try:
359  except KeyError:  except KeyError:
360     libinstall = None     libinstall = None
361  try:  try:
362     pyinstall = env['pyinstall']+'/esys' # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc     pyinstall = env['pyinstall'] # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc
363     env.PrependENVPath('PYTHONPATH', env['pyinstall'])     env.PrependENVPath('PYTHONPATH', env['pyinstall'])
364  except KeyError:  except KeyError:
365     pyinstall = None     pyinstall = None
366  try:  try:
367       exinstall = env['exinstall']
368    except KeyError:
369       exinstall = None
370    try:
371     dodebug = env['dodebug']     dodebug = env['dodebug']
372  except KeyError:  except KeyError:
373     dodebug = None     dodebug = None
# Line 641  try: Line 678  try:
678  except KeyError:  except KeyError:
679     api_epydoc = None     api_epydoc = None
680    
681    try:
682       api_doxygen = env.Dir(env['api_doxygen'])
683    except KeyError:
684       api_doxygen = None
685    
686  # Zipgets  # Zipgets
687  env.Default(libinstall)  env.Default(libinstall)
688  env.Default(incinstall)  env.Default(incinstall)
689  env.Default(pyinstall)  env.Default(pyinstall)
690    ### env.Default(exinstall) # ksteube this causes dependency error
691  env.Alias('release_src',[ src_zipfile, src_tarfile ])  env.Alias('release_src',[ src_zipfile, src_tarfile ])
692  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
693  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
694    env.Alias('examples_zipfile',examples_zipfile)
695    env.Alias('examples_tarfile',examples_tarfile)
696  env.Alias('api_epydoc',api_epydoc)  env.Alias('api_epydoc',api_epydoc)
697    env.Alias('api_doxygen',api_doxygen)
698    env.Alias('guide_html_index',guide_html_index)
699  env.Alias('guide_pdf', guide_pdf)  env.Alias('guide_pdf', guide_pdf)
700  env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])  env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen, guide_html_index])
701  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
702  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests')    # target to build all C++ tests
703  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests') # target to build all python tests
# Line 664  init_target = env.Command(pyinstall+'/__ Line 711  init_target = env.Command(pyinstall+'/__
711  env.Alias(init_target)  env.Alias(init_target)
712    
713  # Allow sconscripts to see the env  # Allow sconscripts to see the env
714  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", "exinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",
715      "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",      "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",
716          "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",
717          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI" ])          "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ])
718    
719  # End initialisation section  # End initialisation section
720  # Begin configuration section  # Begin configuration section

Legend:
Removed from v.1163  
changed lines
  Added in v.1217

  ViewVC Help
Powered by ViewVC 1.1.26