/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/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 1163 by gross, Wed May 23 23:56:39 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  #      #    
# 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)
 if IS_WINDOWS_PLATFORM:  
    pass  
 else:  
    if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'):  
       amd_path_default='/opt/AMD/Include'  
       amd_lib_path_default='/opt/AMD/Lib'  
       amd_libs_default=['amd']  
   
 ufc_path_default=None  
 if IS_WINDOWS_PLATFORM:  
    pass  
86  else:  else:
87     if os.path.isdir('/opt/UFconfig'):     umf_path_default=None
88          ufc_path_default='/opt/UFconfig'     umf_lib_path_default=None
89       umf_libs_default=None
90       amd_path_default=None
91       amd_lib_path_default=None
92       amd_libs_default=None
93       ufc_path_default=None
94    #
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 265  except KeyError: Line 274  except KeyError:
274     python_path = ''     python_path = ''
275    
276  try:  try:
277       omp_num_threads = os.environ['OMP_NUM_THREADS']
278    except KeyError:
279       omp_num_threads = 1
280    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
281    
282    try:
283       env['ENV']['DISPLAY'] = os.environ['DISPLAY']
284    except KeyError:
285       pass
286    
287    try:
288     path = os.environ['PATH']     path = os.environ['PATH']
289     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
290  except KeyError:  except KeyError:

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

  ViewVC Help
Powered by ViewVC 1.1.26