/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 781 by johnpye, Thu Jul 13 06:33:03 2006 UTC revision 782 by johnpye, Tue Jul 25 02:09:12 2006 UTC
# Line 169  opts.Add(PackageOption( Line 169  opts.Add(PackageOption(
169  ))  ))
170    
171  opts.Add(  opts.Add(
172        "IDA_LIB"
173        ,"Libraries linked to for IDA"
174        ,['sundials_ida','sundials_nvecserial','m']
175    )
176    
177    opts.Add(
178      'IDA_CPPPATH'      'IDA_CPPPATH'
179      ,"Where is your ida.h?"      ,"Where is your ida.h?"
180      ,"$IDA_PREFIX/include"      ,"$IDA_PREFIX/include"
# Line 181  opts.Add( Line 187  opts.Add(
187  )  )
188    
189  opts.Add(  opts.Add(
     "IDA_LIB"  
     ,"What libraries to link to for use of IDA (comma-separated). Note that"  
         +" you will need to include the math library in this list (for now)."  
     ,'sundials_ida,sundials_nvecserial,m'  
 )  
   
 opts.Add(  
190      "F2C_LIB"      "F2C_LIB"
191      ,"F2C library (eg. g2c, gfortran, f2c)"      ,"F2C library (eg. g2c, gfortran, f2c)"
192      ,"g2c"      ,"g2c"
# Line 757  def CheckMath(context): Line 756  def CheckMath(context):
756  # IDA test  # IDA test
757    
758  ida_test_text = """  ida_test_text = """
759  #include <ida.h>  #include <ida/ida.h>
760  #include <nvector_serial.h>  #include <nvector/nvector_serial.h>
761  #include <ida_spgmr.h>  #include <ida/ida_spgmr.h>
762  int main(){  int main(){
763      void *ida_mem;      void *ida_mem;
764      ida_mem = IDACreate();      ida_mem = IDACreate();
765        return 0;
766  }  }
767  """  """
768    
769  def CheckIDA(context):  def CheckIDA(context):
770      context.Message( 'Checking for IDA (SUNDIALS)... ' )      context.Message( 'Checking for IDA (SUNDIALS)... ' )
       
     # add SUNDIALS subdirectories as well (what a pain)  
     if context.env.get('IDA_CPPPATH'):  
         extra = [context.env['IDA_CPPPATH']+"/ida",context.env['IDA_CPPPATH']+"/sundials"]  
         context.env.AppendUnique(CPPPATH=extra)  
       
     if ',' in context.env.get('IDA_LIB'):  
         context.env['IDA_LIB']=context.env['IDA_LIB'].split(',')  
         #print "IDA_LIB NOW =",context.env['IDA_LIB']  
     else:  
         print "NO COMMA IN IDA_LIB:",context.env['IDA_LIB']  
771    
772      keep = KeepContext(context,"IDA")      keep = KeepContext(context,"IDA")
773            
# Line 786  def CheckIDA(context): Line 775  def CheckIDA(context):
775      context.Result(is_ok)      context.Result(is_ok)
776            
777      keep.restore(context)      keep.restore(context)
778                
     if is_ok:  
         context.env.Append(IDA_CPPPATH_EXTRA=extra)  
       
779      return is_ok      return is_ok
780    
781  #----------------  #----------------

Legend:
Removed from v.781  
changed lines
  Added in v.782

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