/[ascend]/branches/pallav/models/johnpye/fprops/SConstruct
ViewVC logotype

Diff of /branches/pallav/models/johnpye/fprops/SConstruct

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

revision 2653 by jpye, Fri May 27 06:33:38 2011 UTC revision 2654 by jpye, Wed Jan 16 02:04:07 2013 UTC
# Line 1  Line 1 
1    #!/usr/bin/env python
2  # Standalone 'SConstruct' to demonstrate how you can build  # Standalone 'SConstruct' to demonstrate how you can build
3  # this ASCEND external library against an existing copy of  # this ASCEND external library against an existing copy of
4  # ASCEND installed on your system.  # ASCEND installed on your system.
5    
6  import os.path  import os, platform, sys
7    
8    deft = "default"
9    if platform.system()=="Windows":
10        deft = "mingw"
11    
12  fprops_env = Environment(  fprops_env = Environment(
13      toolpath=['scons']      toolpath=['scons']
14      ,tools = ['default','substinfile']      ,tools = [deft ,'substinfile','swig']
15        ,ENV={"PATH":os.environ.get('PATH')}
16        ,HOST_PREFIX=os.environ.get('HOST_PREFIX')
17  )  )
18    
19    if fprops_env['HOST_PREFIX']:
20        fprops_env['CC'] = "${HOST_PREFIX}-gcc"
21        print "CC =",fprops_env['CC']
22    
23  if WhereIs('ascend-config'):  if WhereIs('ascend-config'):
24      fprops_env.ParseConfig(['ascend-config','--libs','--cppflags'])      fprops_env.ParseConfig(['ascend-config','--libs','--cppflags'])
25        fprops_env['WITH_ASCEND'] = 1
26  else:  else:
27      print "ERROR: no ascend-config in path"      print "WARNING: no ascend-config in path, won't build ASCEND wrapper"
28      fprops_env.Append(      fprops_env['WITH_ASCEND'] = 0
         LIBS=["ascend"]  
         ,LIBPATH=["#/../../.."]  
         ,CPPPATH=["#/../../.."]  
     )  
29    
30  fprops_env.Append(  fprops_env.Append(
31      CFLAGS=['-g','-Wall']      CFLAGS=['-g','-Wall','-O2']
32  )  )
33    
34  #if WhereIs('gsl-config'):  #if WhereIs('gsl-config'):
35  #   fprops_env.ParseConfig(['gsl-config','--libs','--cflags'])  #   fprops_env.ParseConfig(['gsl-config','--libs','--cflags'])
36    
37  srcs = ['mbwr.c','asc_mbwr.c']  #srcs = ['mbwr.c','asc_mbwr.c']
38    #fprops_env.SharedLibrary('mbwr_ascend',srcs)
 fprops_env.SharedLibrary('mbwr_ascend',srcs)  
39    
40  fprops_env.SConscript("fluids/SConscript",['fprops_env'])  fprops_env.SConscript("fluids/SConscript",['fprops_env'])
41    
42  fprops_env.Depends('fluids.c','fluids/fluids_list.h')  fprops_env.Depends('fluids.c','fluids/fluids_list.h')
43    
44  coresrcs = ['ideal.c', 'helmholtz.c', 'sat.c', 'derivs.c', 'solve_ph.c', 'solve_Tx.c', 'fluids.c']  coresrcs = ['fprops.c', 'color.c', 'refstate.c', 'ideal.c', 'helmholtz.c', 'pengrob.c'
45        , 'sat.c', 'derivs.c', 'solve_ph.c', 'solve_Tx.c', 'solve_px.c', 'fluids.c','cp0.c', 'zeroin.c','cubicroots.c'
46    ]
47    
48  srcs = coresrcs + fprops_env['fluids']  srcs = coresrcs + fprops_env['fluids'] + ['fluids/_rpp.c']
49    
50  fprops_env['shobjs'] = [fprops_env.SharedObject(s) for s in srcs]  fprops_env['shobjs'] = [fprops_env.SharedObject(s) for s in srcs]
51    
52  fprops_env.SharedLibrary('helmholtz_ascend',fprops_env['shobjs'] + ['asc_helmholtz.c'])  if fprops_env['WITH_ASCEND']:
53        fprops_env.SharedLibrary('fprops_ascend',fprops_env['shobjs'] + ['asc_fprops.c'])
54    
55  fprops_env.SConscript('python/SConscript',['fprops_env'])  fprops_env.SConscript('python/SConscript',['fprops_env'])
56    

Legend:
Removed from v.2653  
changed lines
  Added in v.2654

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22