/[ascend]/trunk/SConstruct
ViewVC logotype

Contents of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1387 - (show annotations) (download)
Sat Apr 7 14:43:31 2007 UTC (17 years, 5 months ago) by jpye
File size: 52035 byte(s)
Added plot support in Integrator output tabs.
Some other minor debugging for pylab integration and idaanalyse output.
1 import sys, os, commands, platform, distutils.sysconfig, os.path, re
2
3 version = "0.9.5.108"
4
5 #------------------------------------------------------
6 # OPTIONS
7 #
8 # Note that if you set the options via the command line, they will be
9 # remembered in the file 'options.cache'. It's a feature ;-)
10
11 opts = Options(['options.cache', 'config.py'])
12 #print "PLATFORM = ",platform.system()
13
14 if platform.system()=="Windows":
15 default_tcl_lib = "tcl84"
16 default_tk_lib = "tk84"
17 default_tktable_lib = "Tktable28"
18 default_install_assets = "glade/"
19 icon_extension = '.png'
20 default_tcl = "c:\\Tcl"
21 if os.environ.get('MSYSTEM')=="MINGW32":
22 default_tcl_libpath="$TCL\\bin"
23 else:
24 default_tcl_libpath="$TCL\\lib"
25 default_rel_distdir = '.'
26 default_absolute_paths = False
27
28 default_ida_prefix = "c:\\MinGW"
29 if not os.path.exists(default_ida_prefix):
30 default_ida_prefix = None
31
32 default_conopt_prefix = "c:\\Program Files\\CONOPT"
33 default_conopt_libpath="$CONOPT_PREFIX"
34 default_conopt_cpppath="$CONOPT_PREFIX"
35 default_conopt_lib="conopt3"
36 default_conopt_envvar="CONOPT_PATH"
37
38 default_prefix="c:\\MinGW"
39 default_libpath="$DEFAULT_PREFIX\\lib"
40 default_cpppath="$DEFAULT_PREFIX\\include"
41
42 if not os.path.exists(default_conopt_prefix):
43 default_conopt_prefix = None
44
45 need_libm = False
46 python_exe = "c:\\Python24\\python.exe"
47 default_with_scrollkeeper=False
48 else:
49 default_tcl_lib = "tcl8.4"
50 default_tk_lib = "tk8.4"
51 default_tktable_lib = "Tktable2.8"
52 default_install_assets = "$INSTALL_ASCDATA/glade/"
53 icon_extension = '.svg'
54 default_tcl = '/usr'
55 default_tcl_libpath = "$TCL/lib"
56 default_rel_distdir = '../share/ascend'
57 default_absolute_paths = True
58 default_ida_prefix="/usr/local"
59 default_conopt_prefix="/usr"
60 default_conopt_libpath="$CONOPT_PREFIX/lib"
61 default_conopt_cpppath="$CONOPT_PREFIX/include"
62 default_conopt_lib="consub3"
63 default_conopt_envvar="CONOPT_PATH"
64
65 default_prefix="/usr"
66 default_libpath="$DEFAULT_PREFIX/lib"
67 default_cpppath="$DEFAULT_PREFIX/include"
68
69 need_libm = True
70 if not os.path.isdir(default_tcl):
71 default_tcl = '/usr'
72 python_exe = distutils.sysconfig.EXEC_PREFIX+"/bin/python"
73 default_with_scrollkeeper=False
74
75 opts.Add(
76 'CC'
77 ,'C Compiler command'
78 ,None
79 )
80
81 opts.Add(
82 'CXX'
83 ,'C++ Compiler command'
84 ,None
85 )
86
87 opts.Add(BoolOption(
88 'GCOV'
89 , 'Whether to enable coverage testing in object code'
90 , False
91 ))
92
93 # Package linking option
94 opts.Add(EnumOption(
95 'PACKAGE_LINKING'
96 , 'Style of linking for external libraries'
97 , 'DYNAMIC_PACKAGES'
98 , ['DYNAMIC_PACKAGES', 'STATIC_PACKAGES', 'NO_PACKAGES']
99 ))
100
101 opts.Add(BoolOption(
102 'WITH_GCCVISIBILITY'
103 ,"Whether to use GCC Visibility features (only applicable if available)"
104 ,True
105 ))
106
107 opts.Add(BoolOption(
108 'WITH_SIGNALS'
109 ,"Whether to permit use of signals for flow control in the C-level code"
110 ,True
111 ))
112
113 # You can turn off building of Tcl/Tk interface
114 opts.Add(BoolOption(
115 'WITH_TCLTK'
116 ,"Set to False if you don't want to build the original Tcl/Tk GUI."
117 , True
118 ))
119
120 # You can turn off the building of the Python interface
121 opts.Add(BoolOption(
122 'WITH_PYTHON'
123 ,"Set to False if you don't want to build Python wrappers."
124 , True
125 ))
126
127 # Which solvers will we allow?
128 opts.Add(ListOption(
129 'WITH_SOLVERS'
130 ,"List of the solvers you want to build. The default is the minimum that"
131 +" works."
132 ,["QRSLV","CMSLV","LSOD","IDA","CONOPT","LRSLV"]
133 ,['QRSLV','MPS','SLV','OPTSQP'
134 ,'NGSLV','CMSLV','LRSLV','MINOS','CONOPT'
135 ,'LSOD','OPTSQP',"IDA"
136 ]
137 ))
138
139 # Where will the local copy of the help files be kept?
140 opts.Add(PackageOption(
141 'WITH_LOCAL_HELP'
142 , "Directory containing the local copy of the help files (optional)"
143 , "no"
144 ))
145
146 # Will bintoken support be enabled?
147 opts.Add(BoolOption(
148 'WITH_BINTOKEN'
149 ,"Enable bintoken support? This means compiling models as C-code before"
150 +" running them, to increase solving speed for large models."
151 ,False
152 ))
153
154 # What should the default ASCENDLIBRARY path be?
155 # Note: users can change it by editing their ~/.ascend.ini
156 opts.Add(
157 'DEFAULT_ASCENDLIBRARY'
158 ,"Set the default value of the ASCENDLIBRARY -- the location where"
159 +" ASCEND will look for models when running ASCEND"
160 ,"$INSTALL_ASCDATA/models"
161 )
162
163 # Where is SWIG?
164 opts.Add(
165 'SWIG'
166 ,"SWIG location, probably only required for MinGW and MSVC users."
167 +" Enter the location as a Windows-style path, for example"
168 +" 'c:\\msys\\1.0\\home\\john\\swigwin-1.3.29\\swig.exe'."
169 )
170
171 # Build the test suite?
172 opts.Add(BoolOption(
173 'WITH_CUNIT'
174 ,"You can disable CUnit tests with this option. This will basically stop"
175 +" SCons from parsing the SConscript files relating to the 'test'"
176 +" target, which just might make things marginally faster. Probably"
177 +" you can just ignore this option though. SCons will sniff for Cunit"
178 +" but build the tests only if you specify the 'test' target."
179 ,True
180 ))
181
182 # Build with MMIO matrix export support?
183 opts.Add(BoolOption(
184 'WITH_MMIO'
185 ,"Include support for exporting matrices in Matrix Market format"
186 ,True
187 ))
188
189 #----- default paths -----
190 opts.Add(PackageOption(
191 'DEFAULT_PREFIX'
192 ,"Where are most of the shared libraries located on your system?"
193 ,default_prefix
194 ))
195
196 #------ install location for python extensions ------
197
198 # (removed for the moment)
199
200 #------ cunit --------
201 # Where was CUNIT installed?
202 opts.Add(PackageOption(
203 'CUNIT_PREFIX'
204 ,"Where are your CUnit files?"
205 ,"$DEFAULT_PREFIX"
206 ))
207
208 # Where are the CUnit includes?
209 opts.Add(PackageOption(
210 'CUNIT_CPPPATH'
211 ,"Where are your CUnit include files?"
212 ,"$CUNIT_PREFIX/include"
213 ))
214
215 # Where are the CUnit libraries?
216 opts.Add(PackageOption(
217 'CUNIT_LIBPATH'
218 ,"Where are your CUnit libraries?"
219 ,"$CUNIT_PREFIX/lib"
220 ))
221
222 #-------- ida -------
223
224 opts.Add(PackageOption(
225 "IDA_PREFIX"
226 ,"Prefix for your IDA install (IDA ./configure --prefix)"
227 ,default_ida_prefix
228 ))
229
230 opts.Add(
231 "IDA_LIB"
232 ,"Libraries linked to for IDA"
233 ,['sundials_nvecserial','sundials_ida','m']
234 )
235
236 opts.Add(
237 'IDA_CPPPATH'
238 ,"Where is your ida.h?"
239 ,"$IDA_PREFIX/include"
240 )
241
242 opts.Add(
243 'IDA_LIBPATH'
244 ,"Where are your SUNDIALS libraries installed?"
245 ,"$IDA_PREFIX/lib"
246 )
247
248 # ----- conopt-----
249
250 opts.Add(PackageOption(
251 "CONOPT_PREFIX"
252 ,"Prefix for your CONOPT install (CONOPT ./configure --prefix)"
253 ,default_conopt_prefix
254 ))
255
256 opts.Add(
257 "CONOPT_LIB"
258 ,"Library linked to for CONOPT"
259 ,default_conopt_lib
260 )
261
262 opts.Add(
263 'CONOPT_CPPPATH'
264 ,"Where is your conopt.h?"
265 ,default_conopt_cpppath
266 )
267
268 opts.Add(
269 'CONOPT_LIBPATH'
270 ,"Where is your CONOPT libraries installed?"
271 ,default_conopt_libpath
272 )
273
274 opts.Add(
275 'CONOPT_ENVVAR'
276 ,"What environment variable should be used at runtime to override the default search location for CONOPT DLL/SO?"
277 ,default_conopt_envvar
278 )
279
280 #-------- f2c ------
281
282 opts.Add(
283 "F2C_LIB"
284 ,"F2C library (eg. g2c, gfortran, f2c)"
285 ,"gfortran" # the default is gfortran now
286 )
287
288 opts.Add(PackageOption(
289 "F2C_LIBPATH"
290 ,"Directory containing F2C library (i.e. g2c, gfortran, f2c, etc.), if not already accessible"
291 ,"off"
292 ))
293
294 #------- tcl/tk --------
295
296 opts.Add(
297 'TCL'
298 ,'Base of Tcl distribution'
299 ,default_tcl
300 )
301
302 # Where are the Tcl includes?
303 opts.Add(
304 'TCL_CPPPATH'
305 ,"Where are your Tcl include files?"
306 ,"$TCL/include"
307 )
308
309 # Where are the Tcl libs?
310 opts.Add(
311 'TCL_LIBPATH'
312 ,"Where are your Tcl libraries?"
313 ,default_tcl_libpath
314 )
315
316 # What is the name of the Tcl lib?
317 opts.Add(
318 'TCL_LIB'
319 ,"Name of Tcl lib (eg 'tcl' or 'tcl83'), for full path to static library (if STATIC_TCLTK is set)"
320 ,default_tcl_lib
321 )
322
323 # Where are the Tk includes?
324 opts.Add(
325 'TK_CPPPATH'
326 ,"Where are your Tk include files?"
327 ,'$TCL_CPPPATH'
328 )
329
330 # Where are the Tk libs?
331 opts.Add(
332 'TK_LIBPATH'
333 ,"Where are your Tk libraries?"
334 ,'$TCL_LIBPATH'
335 )
336
337 # What is the name of the Tk lib?
338 opts.Add(
339 'TK_LIB'
340 ,"Name of Tk lib (eg 'tk' or 'tk83'), or full path to static library"
341 ,default_tk_lib
342 )
343
344 # Static linking to TkTable
345
346 opts.Add(BoolOption(
347 'STATIC_TCLTK'
348 ,'Set true for static linking for Tcl/Tk and TkTable. EXPERIMENTAL'
349 ,False
350 ))
351
352 opts.Add(
353 'TKTABLE_LIBPATH'
354 ,'Location of TkTable static library'
355 ,'$TCL_LIBPATH/Tktable2.8'
356 )
357
358 opts.Add(
359 'TKTABLE_LIB'
360 ,'Stem name of TkTable (eg tktable2.8, no ".so" or "lib") shared library, or full path of static tktable (/usr/lib/...)'
361 ,default_tktable_lib
362 )
363
364 opts.Add(
365 'TKTABLE_CPPPATH'
366 ,'Location of TkTable header file'
367 ,'$TCL_CPPPATH'
368 )
369
370 opts.Add(
371 'X11'
372 ,'Base X11 directory. Only used when STATIC_TCLTK is turned on. EXPERIMENTAL'
373 ,'/usr/X11R6'
374 )
375
376 opts.Add(
377 'X11_LIBPATH'
378 ,'Location of X11 lib. EXPERIMENTAL'
379 ,'$X11/lib'
380 )
381
382 opts.Add(
383 'X11_CPPPATH'
384 ,'Location of X11 includes. EXPERIMENTAL'
385 ,'$X11/include'
386 )
387
388 opts.Add(
389 'X11_LIB'
390 ,'Name of X11 lib. EXPERIMENTAL'
391 ,'X11'
392 )
393
394 #----- installed file locations (for 'scons install') -----
395
396 opts.Add(
397 'INSTALL_PREFIX'
398 ,'Root location for installed files'
399 ,'/usr/local'
400 )
401
402 opts.Add(
403 'INSTALL_BIN'
404 ,'Location to put binaries during installation'
405 ,"$INSTALL_PREFIX/bin"
406 )
407
408 opts.Add(
409 'INSTALL_LIB'
410 ,'Location to put libraries during installation'
411 ,"$INSTALL_PREFIX/lib"
412 )
413
414 opts.Add(
415 'INSTALL_SHARE'
416 ,'Common shared-file location on this system'
417 ,"$INSTALL_PREFIX/share"
418 )
419
420 opts.Add(
421 'INSTALL_ASCDATA'
422 ,"Location of ASCEND shared data (TK, python, models etc)"
423 ,"$INSTALL_SHARE/ascend"
424 )
425
426 opts.Add(
427 'INSTALL_INCLUDE'
428 ,'Location to put header files during installation'
429 ,"$INSTALL_PREFIX/include"
430 )
431
432
433 opts.Add(
434 'INSTALL_ROOT'
435 ,'For use by RPM only: location of %{buildroot} during rpmbuild'
436 ,""
437 )
438
439 #----------------------
440
441 opts.Add(
442 'PYGTK_ASSETS'
443 ,'Default location for Glade assets (placed in pygtk/config.py)'
444 ,default_install_assets
445 )
446
447 opts.Add(BoolOption(
448 'DEBUG'
449 ,"Compile source with debugger symbols, eg for use with 'gdb'"
450 ,False
451 ))
452
453 opts.Add(BoolOption(
454 'MALLOC_DEBUG'
455 ,"Compile with debugging version of MALLOC. Required for full CUnit testing"
456 ,False
457 ))
458
459 #------ dmalloc --------
460 opts.Add(PackageOption(
461 'DMALLOC_PREFIX'
462 ,"Where are your dmalloc files?"
463 ,default_prefix
464 ))
465
466 opts.Add(PackageOption(
467 'DMALLOC_CPPPATH'
468 ,"Where are your dmalloc include files?"
469 ,default_cpppath
470 ))
471
472 opts.Add(PackageOption(
473 'DMALLOC_LIBPATH'
474 ,"Where are your dmalloc libraries?"
475 ,default_libpath
476 ))
477
478 opts.Add(BoolOption(
479 'WITH_DMALLOC'
480 ,"Link to the DMALLOC library (if available) for debugging of memory usage."
481 ,False
482 ))
483
484 #------ f --------
485 opts.Add(PackageOption(
486 'MFGRAPH_PREFIX'
487 ,"Where are your MFGRAPH files?"
488 ,default_prefix
489 ))
490
491 opts.Add(PackageOption(
492 'MFGRAPH_CPPPATH'
493 ,"Where are your MFGRAPH include files?"
494 ,default_cpppath
495 ))
496
497 opts.Add(PackageOption(
498 'MFGRAPH_LIBPATH'
499 ,"Where are your MFGRAPH libraries?"
500 ,default_libpath
501 ))
502
503 opts.Add(BoolOption(
504 'WITH_MFGRAPH'
505 ,"Link to the MFGRAPH library (if available, for generating incidence graphs)"
506 ,True
507 ))
508
509
510 #------ ufsparse --------
511 opts.Add(PackageOption(
512 'UFSPARSE_PREFIX'
513 ,"Where are your UFSPARSE files?"
514 ,default_prefix
515 ))
516
517 opts.Add(PackageOption(
518 'UFSPARSE_CPPPATH'
519 ,"Where are your UFSPARSE include files?"
520 ,default_cpppath
521 ))
522
523 opts.Add(PackageOption(
524 'UFSPARSE_LIBPATH'
525 ,"Where are your UFSPARSE libraries?"
526 ,default_libpath
527 ))
528
529 opts.Add(BoolOption(
530 'WITH_UFSPARSE'
531 ,"Link to the UFSPARSE library (if available, for additional sparse matrix routines)"
532 ,True
533 ))
534
535 #-----------------------
536
537 opts.Add(
538 'DISTTAR_NAME'
539 ,"Stem name of the tarball created by 'scons dist'. So for 'ascend-aaa.tar.bz2', set this to 'ascend-aaa'."
540 ,"ascend-"+version
541 )
542
543 opts.Add(
544 'RELEASE'
545 ,"Release number for use in RPM spec file. This should always start with a zero for releases made by the ASCEND group, in order that third parties can make 'patch' releases of higher version numbers."
546 ,"0"
547 )
548
549 opts.Add(BoolOption(
550 'ABSOLUTE_PATHS'
551 ,"Whether to use absolute or relative paths in the installed Tcl/Tk interface. If you want to build an RPM, set this to false."
552 ,default_absolute_paths
553 ))
554
555 opts.Add(
556 'WIN_INSTALLER_NAME'
557 ,"Name of the installer .exe to create under Windows (minus the '.exe')"
558 ,"ascend-"+version
559 )
560
561 opts.Add(BoolOption(
562 'WITH_XTERM_COLORS'
563 ,"Set to 0 if you don't want xterm colour codes in the console output"
564 ,True
565 ))
566
567 opts.Add(BoolOption(
568 'WITH_EXTFNS'
569 ,"Set to 0 if you don't want to attempt to build external modules bundled"
570 + " with ASCEND."
571 ,True
572 ))
573
574 opts.Add(BoolOption(
575 'WITH_SCROLLKEEPER'
576 ,"Set to to 1 if you want to install an OMF file that can be read by scrollkeeper (eg Yelp on GNOME)"
577 ,default_with_scrollkeeper
578 ))
579
580 if platform.system()!="Windows":
581 opts.Add(BoolOption(
582 'WITH_GCCVISIBILITY'
583 , 'Whether to use GCC Visibility extensions when building with GCC 4.0'
584 , True
585 ))
586
587
588
589 # TODO: OTHER OPTIONS?
590 # TODO: flags for optimisation
591 # TODO: turning on/off bintoken functionality
592 # TODO: Where will the 'Makefile.bt' file be installed?
593
594 # Import the outside environment
595
596 def c_escape(str):
597 return re.sub("\\\\","/",str)
598
599 envadditional={}
600
601 if platform.system()=="Windows":
602 if os.environ.get('OSTYPE')=='msys' or os.environ.get('MSYSTEM'):
603 envenv = os.environ;
604 tools = ['mingw','lex','yacc','fortran','swig','disttar','nsis']
605 #TODO removed 'doxygen' for SCons 0.96.93
606 envadditional['IS_MINGW']=True
607 else:
608 print "Assuming VC++ build environment (Note: MinGW is preferred)"
609 envenv = {
610 'PATH':os.environ['PATH']
611 ,'INCLUDE':os.environ['INCLUDE']
612 ,'LIB':os.environ['LIB']
613 ,'MSVS_IGNORE_IDE_PATHS':1
614 }
615 tools=['default','lex','yacc','fortran','swig','disttar','nsis']
616 #TODO removed 'doxygen' for SCons 0.96.93
617 envadditional['CPPDEFINES']=['_CRT_SECURE_NO_DEPRECATE']
618 else:
619 if os.environ.get('TARGET')=='mingw':
620 envenv = os.environ
621 tools=['crossmingw','lex','yacc','disttar','nsis','doxygen']
622 envadditional['CPPPATH']=['/usr/local/lib/gcc/i386-mingw32/3.4.5/include','/usr/include']
623 else:
624 envenv = os.environ
625 tools=['default','lex','yacc','fortran','swig','disttar','nsis']
626 #TODO removed 'doxygen' for SCons 0.96.93
627
628
629 env = Environment(
630 ENV=envenv
631 , toolpath=['scons']
632 , tools=tools
633 , **envadditional
634 )
635
636 print "PATH =",os.environ['PATH']
637
638 opts.Update(env)
639 opts.Save('options.cache',env)
640
641 Help(opts.GenerateHelpText(env))
642
643 with_tcltk = env.get('WITH_TCLTK')
644 without_tcltk_reason = "disabled by options/config.py"
645
646 with_python = env.get('WITH_PYTHON')
647 without_python_reason = "disabled by options/config.py"
648
649 with_cunit = env.get('WITH_CUNIT')
650 without_cunit_reason = "not requested"
651
652 with_extfns = env.get('WITH_EXTFNS')
653 without_extfn_reason = "disabled by options/config.py"
654
655 with_scrollkeeper = env.get('WITH_SCROLLKEEPER')
656 without_scrollkeeper_reason = "disabled by options/config.py"
657
658 with_dmalloc = env.get('WITH_DMALLOC')
659 without_dmalloc_reason = "disabled by options/config.py"
660
661 with_mfgraph = env.get('WITH_MFGRAPH')
662 without_mfgraph_reason = "disabled by options/config.py"
663
664 with_ufsparse = env.get('WITH_UFSPARSE')
665 without_ufsparse_reason = "disabled by options/config.py"
666
667 with_mmio = env.get('WITH_MMIO')
668 without_mmio_reason = "disabled by options/config.py"
669
670 with_signals = env.get('WITH_SIGNALS')
671 without_signals_reason = "disabled by options/config.py"
672
673 if platform.system()=="Windows":
674 with_installer=1
675 else:
676 with_installer=0
677 without_installer_reason = "only possible under Windows"
678
679 if 'LSOD' in env['WITH_SOLVERS']:
680 with_lsode=True
681 else:
682 with_lsode=False
683 without_lsode_reason = "not requested (WITH_SOLVERS)"
684
685 if 'IDA' in env['WITH_SOLVERS']:
686 with_ida=True
687 else:
688 with_ida=False
689 without_ida_reason = "not requested (WITH_SOLVERS)"
690
691
692 if 'CONOPT' in env['WITH_SOLVERS']:
693 with_conopt=True
694 else:
695 with_conopt=False
696 without_conopt_reason = "not requested (WITH_SOLVERS)"
697
698
699 #print "SOLVERS:",env['WITH_SOLVERS']
700 #print "WITH_BINTOKEN:",env['WITH_BINTOKEN']
701 #print "DEFAULT_ASCENDLIBRARY:",env['DEFAULT_ASCENDLIBRARY']
702
703 can_install = True
704 if platform.system()=='Windows':
705 can_install = False
706
707 env['CAN_INSTALL']=can_install
708 env['INSTALL_MODELS']=env['INSTALL_ASCDATA']+"/models/"
709
710 print "TCL_CPPPATH =",env['TCL_CPPPATH']
711 print "TCL_LIBPATH =",env['TCL_LIBPATH']
712 print "TCL_LIB =",env['TCL_LIB']
713 print "CC =",env['CC']
714 print "CXX =",env['CXX']
715 print "FORTRAN=",env.get('FORTRAN')
716
717 print "ABSOLUTE PATHS =",env['ABSOLUTE_PATHS']
718 #------------------------------------------------------
719 # SPECIAL CONFIGURATION TESTS
720
721 need_fortran = False
722
723 #----------------
724 # SWIG
725
726 import os,re
727
728 def get_swig_version(env):
729 cmd = env['SWIG']+' -version'
730 (cin,coutcerr) = os.popen4(cmd)
731 output = coutcerr.read()
732
733 restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"
734 expr = re.compile(restr,re.M);
735 m = expr.search(output);
736 if not m:
737 return None
738 maj = int(m.group('maj'))
739 min = int(m.group('min'))
740 pat = int(m.group('pat'))
741
742 return (maj,min,pat)
743
744
745 def CheckSwigVersion(context):
746
747 try:
748 context.Message("Checking version of SWIG... ")
749 maj,min,pat = get_swig_version(context.env)
750 except:
751 context.Result("Failed to detect version, or failed to run SWIG")
752 return 0;
753
754 context.env['SWIGVERSION']=tuple([maj,min,pat])
755
756 if maj == 1 and (
757 min > 3
758 or (min == 3 and pat >= 24)
759 ):
760 context.Result("ok, %d.%d.%d" % (maj,min,pat))
761 return 1;
762 else:
763 context.Result("too old, %d.%d.%d" % (maj,min,pat))
764 return 0;
765
766 #----------------
767 # Scrollkeeper (Linux documentation system)
768
769 def get_scrollkeeper_omfdir(env):
770 cmd = 'scrollkeeper-config --omfdir'
771 (cin,coutcerr) = os.popen4(cmd)
772 output = coutcerr.read()
773 return output.strip()
774
775 def CheckScrollkeeperConfig(context):
776 try:
777 context.Message("Checking for scrollkeeper...")
778 dir=get_scrollkeeper_omfdir(context.env)
779 except:
780 context.Result("Failed to run 'scrollkeeper-config'")
781 return 0
782 context.env['OMFDIR']=dir
783 context.Result("OK, %s" % dir)
784 return 1
785
786 #----------------
787 # General purpose library-and-header test
788
789 class KeepContext:
790 def __init__(self,context,varprefix,static=False):
791 self.keep = {}
792 for k in ['LIBS','LIBPATH','CPPPATH','LINKFLAGS']:
793 #print "Keeping env %s = %s" % (k,context.env.get(k))
794 self.keep[k]=context.env.get(k)
795
796 if context.env.has_key(varprefix+'_CPPPATH'):
797 context.env.AppendUnique(CPPPATH=[env[varprefix+'_CPPPATH']])
798 #print "Adding '"+str(env[varprefix+'_CPPPATH'])+"' to cpp path"
799
800 if static:
801 staticlib=env[varprefix+'_LIB']
802 #print "STATIC LIB = ",staticlib
803 context.env.Append(
804 LINKFLAGS=[staticlib]
805 )
806 else:
807 if context.env.has_key(varprefix+'_LIBPATH'):
808 context.env.Append(LIBPATH=[env[varprefix+'_LIBPATH']])
809 #print "Adding '"+str(env[varprefix+'_LIBPATH'])+"' to lib path"
810
811 if context.env.has_key(varprefix+'_LIB'):
812 context.env.Append(LIBS=[env[varprefix+'_LIB']])
813 #print "Adding '"+str(env[varprefix+'_LIB'])+"' to libs"
814
815 def restore(self,context):
816 #print "RESTORING CONTEXT"
817 #print self.keep
818 #print "..."
819 for k in self.keep:
820 if self.keep[k]==None:
821 if context.env.has_key(k):
822 #print "Clearing "+str(k)
823 del context.env[k];
824 else:
825 #print "Restoring %s to '%s'" %(k,self.keep.get(k))
826 context.env[k]=self.keep[k];
827
828 def CheckExtLib(context,libname,text,ext='.c',varprefix=None,static=False):
829 """This method will check for variables LIBNAME_LIBPATH
830 and LIBNAME_CPPPATH and try to compile and link the
831 file with the provided text, linking with the
832 library libname."""
833
834 if static:
835 context.Message( 'Checking for static '+libname+'... ' )
836 else:
837 context.Message( 'Checking for '+libname+'... ' )
838
839 if varprefix==None:
840 varprefix = libname.upper()
841
842 #print "LIBS is currently:",context.env.get('LIBS')
843 keep = KeepContext(context,varprefix,static)
844
845 if not context.env.has_key(varprefix+'_LIB'):
846 # if varprefix_LIB were in env, KeepContext would
847 # have appended it already
848 context.env.Append(LIBS=[libname])
849
850 is_ok = context.TryLink(text,ext)
851
852 #print "Link success? ",(is_ok != 0)
853
854 keep.restore(context)
855
856 # print "Restored CPPPATH="+str(context.env['CPPPATH'])
857 # print "Restored LIBS="+str(context.env['LIBS'])
858 # print "Restored LIBPATH="+str(context.env['LIBPATH'])
859
860 context.Result(is_ok)
861 return is_ok
862
863 #----------------
864 # GCC
865
866 gcc_test_text = """
867 #ifndef __GNUC__
868 # error "Not using GCC"
869 #endif
870
871 int main(void){
872 return __GNUC__;
873 }
874 """
875
876 def CheckGcc(context):
877 context.Message("Checking for GCC... ")
878 is_ok = context.TryCompile(gcc_test_text,".c")
879 context.Result(is_ok)
880 return is_ok
881
882 #----------------
883 # GCC VISIBILITY feature
884
885 gccvisibility_test_text = """
886 #if __GNUC__ < 4
887 # error "Require GCC version 4 or newer"
888 #endif
889
890 __attribute__ ((visibility("default"))) int x;
891
892 int main(void){
893 extern int x;
894 x = 4;
895 }
896 """
897
898 def CheckGccVisibility(context):
899 context.Message("Checking for GCC 'visibility' capability... ")
900 if not context.env.has_key('WITH_GCCVISIBILITY') or not env['WITH_GCCVISIBILITY']:
901 context.Result("disabled")
902 return 0
903 is_ok = context.TryCompile(gccvisibility_test_text,".c")
904 context.Result(is_ok)
905 return is_ok
906
907 #----------------
908 # YACC
909
910 yacc_test_text = """
911 %{
912 #include <stdio.h>
913
914 /* MSVC++ needs this before it can swallow Bison output */
915 #ifdef _MSC_VER
916 # define __STDC__
917 #endif
918 %}
919 %token MSG
920 %start ROOT
921 %%
922 ROOT:
923 MSG { printf("HELLO"); }
924 ;
925 %%
926 """
927
928 def CheckYacc(context):
929 context.Message("Checking for Yacc ('%s')... " % context.env.get('YACC'))
930 is_ok = context.TryCompile(yacc_test_text,".y")
931 context.Result(is_ok)
932 return is_ok
933
934 #----------------
935 # LEX
936
937 lex_test_text = """
938 %{
939 #include <stdio.h>
940 %}
941 DIGIT [0-9]
942 ID [a-z][a-z0-9]*
943 %%
944 {DIGIT}+ {
945 printf("A digit: %s\\n",yytext);
946 }
947
948 [ \\t\\n]+ /* ignore */
949
950 . {
951 printf("Unrecognized guff");
952 }
953 %%
954 main(){
955 yylex();
956 }
957 """
958
959 def CheckLex(context):
960 context.Message("Checking for Lex ('%s')... " % context.env.get('LEX'))
961 is_ok = context.TryCompile(lex_test_text,".l")
962 context.Result(is_ok)
963 return is_ok
964
965 #----------------
966 # CUnit test
967
968 cunit_test_text = """
969 #include <CUnit/CUnit.h>
970 int maxi(int i1, int i2){
971 return (i1 > i2) ? i1 : i2;
972 }
973
974 void test_maxi(void){
975 CU_ASSERT(maxi(0,2) == 2);
976 CU_ASSERT(maxi(0,-2) == 0);
977 CU_ASSERT(maxi(2,2) == 2);
978
979 }
980 int main(void){
981 /* CU_initialize_registry() */
982 return 0;
983 }
984 """
985
986 def CheckCUnit(context):
987 return CheckExtLib(context,'cunit',cunit_test_text)
988
989 #----------------
990 # dmalloc test
991
992 dmalloc_test_text = """
993 #include <stdlib.h>
994 #include <dmalloc.h>
995
996 int main(void){
997 char *c;
998 c = malloc(100*sizeof(char));
999 free(c);
1000 return 0;
1001 }
1002 """
1003
1004 def CheckDMalloc(context):
1005 return CheckExtLib(context,'dmalloc',dmalloc_test_text)
1006
1007 #----------------
1008 # mfgraph test
1009
1010 mfgraph_test_text = """
1011 #include <mfgraph/mfg_draw_graph.h>
1012 int main(void){
1013 using namespace mfg;
1014 DrawGraph g;
1015 return 0;
1016 }
1017 """
1018
1019 def CheckMFGraph(context):
1020 return CheckExtLib(context,'mfgraph',mfgraph_test_text,ext=".cpp")
1021
1022 #----------------
1023 # ufsparse test
1024
1025 ufsparse_test_text = """
1026 #include <ufsparse/cs.h>
1027 int main(void){
1028 cs *A,*B,*C;
1029 C = cs_multiply(A,B);
1030 return 0;
1031 }
1032 """
1033
1034 def CheckUFSparse(context):
1035 return CheckExtLib(context
1036 ,libname='cxsparse'
1037 ,varprefix='ufsparse'
1038 ,text=ufsparse_test_text
1039 ,ext=".c"
1040 )
1041
1042 #----------------
1043 # MATH test
1044
1045 math_test_text = """
1046 #ifndef _ALL_SOURCE
1047 # define _ALL_SOURCE
1048 #endif
1049 #ifndef _XOPEN_SOURCE
1050 # define _XOPEN_SOURCE
1051 #endif
1052 #ifndef _XOPEN_SOURCE_EXTENDED
1053 # define _XOPEN_SOURCE_EXTENDED 1
1054 #endif
1055 #include <math.h>
1056 int main(void){
1057 double x = 1.0; double y = 1.0; int i = 1;
1058 acosh(x); asinh(x); atanh(x); cbrt(x); expm1(x); erf(x); erfc(x); isnan(x);
1059 j0(x); j1(x); jn(i,x); ilogb(x); logb(x); log1p(x); rint(x);
1060 y0(x); y1(x); yn(i,x);
1061 #ifdef _THREAD_SAFE
1062 gamma_r(x,&i);
1063 lgamma_r(x,&i);
1064 #else
1065 gamma(x);
1066 lgamma(x);
1067 #endif
1068 hypot(x,y); nextafter(x,y); remainder(x,y); scalb(x,y);
1069 return 0;
1070 }
1071 """
1072
1073 def CheckMath(context):
1074 context.Message('Checking for IEEE math library... ')
1075 libsave=context.env.get('LIBS');
1076 context.env.AppendUnique(LIBS=['m'])
1077 is_ok=context.TryLink(math_test_text,".c")
1078 context.Result(is_ok)
1079 if not is_ok:
1080 context.env['LIBS']=libsave
1081 return is_ok
1082
1083 #----------------
1084 # libpython test
1085
1086 libpython_test_text = """
1087 #include <Python.h>
1088 int main(void){
1089 PyObject *p;
1090 p = Py_None;
1091 return 0;
1092 }
1093 """
1094
1095 def CheckPythonLib(context):
1096 context.Message('Checking for libpython... ')
1097
1098 if platform.system()=="Windows":
1099 python_lib='python%d%d'
1100 else:
1101 python_lib='python%d.%d'
1102 python_libs = [python_lib % (sys.version_info[0],sys.version_info[1])]
1103
1104 python_cpppath = [distutils.sysconfig.get_python_inc()]
1105 cfig = distutils.sysconfig.get_config_vars()
1106
1107 lastLIBS = context.env.get('LIBS')
1108 lastLIBPATH = context.env.get('LIBPATH')
1109 lastCPPPATH = context.env.get('CPPPATH')
1110 lastLINKFLAGS = context.env.get('LINKFLAGS')
1111
1112 python_libpath = []
1113 python_linkflags = []
1114 if platform.system()=="Windows":
1115 python_libpath+=[cfig['prefix']]
1116 else:
1117 # checked on Linux and SunOS
1118 if cfig['LDLIBRARY']==cfig['LIBRARY']:
1119 sys.stdout.write("(static)")
1120 python_libpath += [cfig['LIBPL']]
1121 python_linkflags += cfig['LIBS'].split(' ')
1122
1123 context.env.AppendUnique(LIBS=python_libs)
1124 context.env.AppendUnique(LIBPATH=python_libpath)
1125 context.env.AppendUnique(CPPPATH=python_cpppath)
1126 context.env.AppendUnique(LINKFLAGS=python_linkflags)
1127 result = context.TryLink(libpython_test_text,".c");
1128
1129 context.Result(result)
1130
1131 if(result):
1132 context.env['PYTHON_LIBPATH']=python_libpath
1133 context.env['PYTHON_LIB']=python_libs
1134 context.env['PYTHON_CPPPATH']=python_cpppath
1135 context.env['PYTHON_LINKFLAGS']=python_linkflags
1136
1137 context.env['LIBS'] = lastLIBS
1138 context.env['LIBPATH'] = lastLIBPATH
1139 context.env['CPPPATH'] = lastCPPPATH
1140 context.env['LINKFLAGS'] = lastLINKFLAGS
1141
1142 return result
1143
1144 #----------------
1145 # IDA test
1146
1147 sundials_version_major_required = 2
1148 sundials_version_minor_min = 2
1149 sundials_version_minor_max = 3
1150
1151 sundials_version_text = """
1152 #include <sundials/sundials_config.h>
1153 #include <stdio.h>
1154 int main(){
1155 printf("%s",SUNDIALS_PACKAGE_VERSION);
1156 return 0;
1157 }
1158 """
1159
1160 ida_test_text = """
1161 # include <ida/ida.h>
1162 # include <nvector/nvector_serial.h>
1163 # include <ida/ida_spgmr.h>
1164 int main(){
1165 void *ida_mem;
1166 ida_mem = IDACreate();
1167 return 0;
1168 }
1169 """
1170
1171 def CheckIDA(context):
1172 context.Message( 'Checking for IDA (SUNDIALS)... ' )
1173
1174 keep = KeepContext(context,"IDA")
1175
1176 is_ok = context.TryLink(ida_test_text,".c")
1177 context.Result(is_ok)
1178
1179 keep.restore(context)
1180
1181 return is_ok
1182
1183 # slightly changed calling convention (IDACalcID) in newer versions of SUNDIALS,
1184 # so detect the version and act accordingly.
1185 def CheckIDAVersion(context):
1186 keep = KeepContext(context,'IDA')
1187 context.Message("Checking SUNDIALS version... ")
1188 (is_ok,output) = context.TryRun(sundials_version_text,'.c')
1189 keep.restore(context)
1190 if not is_ok:
1191 context.Result("failed to run check")
1192 return 0
1193
1194 major,minor,patch = tuple([int(i) for i in output.split(".")])
1195 context.env['SUNDIALS_VERSION_MAJOR'] = major
1196 context.env['SUNDIALS_VERSION_MINOR'] = minor
1197 if major != sundials_version_major_required \
1198 or minor < sundials_version_minor_min \
1199 or minor > sundials_version_minor_max:
1200 context.Result(output+" (bad version)")
1201 # bad version
1202 return 0
1203
1204 # good version
1205 context.Result("%d.%d.%d, good" % (major,minor,patch))
1206 return 1
1207
1208 #----------------
1209 # CONOPT test
1210
1211 conopt_test_text = """
1212 #if !defined(_WIN32)
1213 # define FNAME_LCASE_DECOR
1214 #endif
1215
1216 #include <conopt.h>
1217 #include <stdlib.h>
1218 int main(){
1219 int s, *v, e;
1220 s = COIDEF_Size();
1221 v = (int *)malloc(s*sizeof(int));
1222 e = COIDEF_Ini(v);
1223 return e;
1224 }
1225 """
1226
1227 def CheckCONOPT(context):
1228 context.Message( 'Checking for CONOPT... ' )
1229
1230 keep = KeepContext(context,"CONOPT")
1231
1232 is_ok = context.TryLink(conopt_test_text,".c")
1233 context.Result(is_ok)
1234
1235 keep.restore(context)
1236
1237 return is_ok
1238
1239 #----------------
1240 # Tcl test
1241
1242 # TCL and TK required version 8.1, 8.2, 8.3, or 8.4:
1243 tcltk_minor_newest_acceptable = 4
1244 tcltk_major_required = 8
1245
1246 tcl_check_text = r"""
1247 #include <tcl.h>
1248 #include <stdio.h>
1249 int main(void){
1250 printf("%s",TCL_PATCH_LEVEL);
1251 return 0;
1252 }
1253 """
1254
1255 def CheckTcl(context):
1256 return CheckExtLib(context,'tcl',tcl_check_text,static=env['STATIC_TCLTK'])
1257
1258 def CheckTclVersion(context):
1259 keep = KeepContext(context,'TCL',static=env['STATIC_TCLTK'])
1260 context.Message("Checking Tcl version... ")
1261 (is_ok,output) = context.TryRun(tcl_check_text,'.c')
1262 keep.restore(context)
1263 if not is_ok:
1264 context.Result("failed to run check")
1265 return 0
1266
1267 major,minor,patch = tuple([int(i) for i in output.split(".")])
1268 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
1269 context.Result(output+" (bad version)")
1270 # bad version
1271 return 0
1272
1273 # good version
1274 context.Result(output+", good")
1275 return 1
1276
1277 #----------------
1278 # Tk test
1279
1280 tk_check_text = r"""
1281 #include <tk.h>
1282 #include <stdio.h>
1283 int main(void){
1284 printf("%s",TK_PATCH_LEVEL);
1285 return 0;
1286 }
1287 """
1288 def CheckTk(context):
1289 return CheckExtLib(context,'tk',tk_check_text,static=env['STATIC_TCLTK'])
1290
1291
1292 def CheckTkVersion(context):
1293 keep = KeepContext(context,'TK',static=context.env['STATIC_TCLTK'])
1294 context.Message("Checking Tk version... ")
1295 #print "LINKFLAGS =",context.env['LINKFLAGS']
1296 (is_ok,output) = context.TryRun(tk_check_text,'.c')
1297 keep.restore(context)
1298 if not is_ok:
1299 context.Result("failed to run check")
1300 return 0
1301
1302 major,minor,patch = tuple([int(i) for i in output.split(".")])
1303 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
1304 # bad version
1305 context.Result(output+" (bad version)")
1306 return 0
1307
1308 # good version
1309 context.Result(output+" (good)")
1310 return 1
1311
1312 #----------------
1313 # Tktable test
1314
1315 tktable_check_text = r"""
1316 #include <tkTable.h>
1317 #include <stdio.h>
1318 int main(void){
1319 Table mytable;
1320 return 0;
1321 }
1322 """
1323
1324 def CheckTkTable(context):
1325 return CheckExtLib(context,'tktable',tktable_check_text,static=env['STATIC_TCLTK'])
1326
1327 #---------------
1328 # X11 test
1329
1330 x11_check_text = r"""
1331 #include <X11/Xlib.h>
1332 #include <X11/IntrinsicP.h>
1333 #include <X11/Intrinsic.h>
1334 #include <X11/ObjectP.h>
1335 #include <X11/Object.h>
1336 int main(void){
1337 Object mything;
1338 return 0;
1339 }
1340 """
1341
1342 def CheckX11(context):
1343 return CheckExtLib(context,'X11',x11_check_text)
1344
1345 #----------------
1346 # Check that we can raise and catch sigint
1347
1348 sigint_test_text = r"""
1349 #include <signal.h>
1350 #include <setjmp.h>
1351 #include <stdlib.h>
1352 static jmp_buf g_jmpenv;
1353 void sighandler(int sig){
1354 longjmp(g_jmpenv,sig);
1355 }
1356 void testsigint(){
1357 raise(SIGINT);
1358 }
1359 int main(void){
1360 signal(SIGINT,&sighandler);
1361 switch(setjmp(g_jmpenv)){
1362 case 0:
1363 testsigint();
1364 exit(1);
1365 case SIGINT:
1366 exit(0);
1367 default:
1368 exit(2);
1369 }
1370 }
1371 """
1372
1373 def CheckSIGINT(context):
1374 context.Message("Checking SIGINT is catchable... ")
1375 (is_ok,output)=context.TryRun(sigint_test_text,".c")
1376 context.Result(is_ok)
1377 return is_ok
1378
1379 #----------------
1380 # Check that we're able to catch floating point errors
1381
1382 sigfpe_test_text = r"""
1383 #include <signal.h>
1384 #include <setjmp.h>
1385 #include <stdlib.h>
1386 #include <fenv.h>
1387 static jmp_buf g_jmpenv;
1388 void fpehandler(int sig){
1389 longjmp(g_jmpenv,sig);
1390 }
1391 int main(void){
1392 fenv_t myfenv;
1393 fegetenv(&myfenv);
1394 fesetenv(&myfenv);
1395 feenableexcept(FE_ALL_EXCEPT);
1396 signal(SIGFPE,&fpehandler);
1397 double x;
1398 switch(setjmp(g_jmpenv)){
1399 case 0:
1400 x = 1.0 / 0.0;
1401 /* failed to catch */
1402 exit(1);
1403 case SIGFPE:
1404 exit(0);
1405 }
1406 }
1407 """
1408
1409 def CheckFPE(context):
1410 context.Message("Checking C99 FPE behaviour... ")
1411 (is_ok,output) = context.TryRun(sigfpe_test_text,'.c')
1412 context.Result(is_ok)
1413 return is_ok
1414
1415 #----------------
1416 # signal reset needed?
1417
1418 sigreset_test_text = r"""
1419 #include <signal.h>
1420 #include <setjmp.h>
1421 #include <stdlib.h>
1422 #include <stdio.h>
1423 typedef void SigHandlerFn(int);
1424 static jmp_buf g_jmpenv;
1425 void sighandler(int sig){
1426 longjmp(g_jmpenv,sig);
1427 }
1428 void testsigint(){
1429 /* fprintf(stderr,"Raising SIGINT\n"); */
1430 raise(SIGINT);
1431 }
1432 int main(void){
1433 SigHandlerFn *last,*saved;
1434 saved = signal(SIGINT,&sighandler);
1435 if(saved!=SIG_DFL){
1436 fprintf(stderr,"Default handler (%p) was not correctly set\n",SIG_DFL);
1437 exit(3);
1438 }
1439 switch(setjmp(g_jmpenv)){
1440 case 0:
1441 testsigint();
1442 fprintf(stderr,"Back from SIGINT\n");
1443 exit(1);
1444 case SIGINT:
1445 break;
1446 default:
1447 exit(2);
1448 };
1449 last = signal(SIGINT,SIG_DFL);
1450 if(last!=&sighandler){
1451 printf("1");
1452 exit(0);
1453 }
1454 printf("0");
1455 exit(0);
1456 }
1457 """
1458
1459 def CheckSigReset(context):
1460 context.Message("Checking signal handler reset... ")
1461 (is_ok,output) = context.TryRun(sigreset_test_text,'.c')
1462 if not is_ok:
1463 context.Result("ERROR")
1464 return False
1465 if int(output)==1:
1466 context.Result("required");
1467 context.env['ASC_RESETNEEDED'] = True
1468 else:
1469 context.Result("not required");
1470 context.env['ASC_RESETNEEDED'] = False
1471 return is_ok
1472
1473 #----------------
1474 # GCC Version sniffing
1475
1476 # TODO FIXME
1477
1478 gcc_version4 = False
1479
1480 #------------------------------------------------------
1481 # CONFIGURATION
1482
1483 conf = Configure(env
1484 , custom_tests = {
1485 'CheckMath' : CheckMath
1486 , 'CheckSwigVersion' : CheckSwigVersion
1487 , 'CheckPythonLib' : CheckPythonLib
1488 , 'CheckCUnit' : CheckCUnit
1489 , 'CheckDMalloc' : CheckDMalloc
1490 , 'CheckMFGraph' : CheckMFGraph
1491 , 'CheckUFSparse' : CheckUFSparse
1492 , 'CheckTcl' : CheckTcl
1493 , 'CheckTclVersion' : CheckTclVersion
1494 , 'CheckTk' : CheckTk
1495 , 'CheckTkVersion' : CheckTkVersion
1496 , 'CheckGcc' : CheckGcc
1497 , 'CheckGccVisibility' : CheckGccVisibility
1498 , 'CheckYacc' : CheckYacc
1499 , 'CheckLex' : CheckLex
1500 , 'CheckTkTable' : CheckTkTable
1501 , 'CheckX11' : CheckX11
1502 , 'CheckIDA' : CheckIDA
1503 , 'CheckIDAVersion' : CheckIDAVersion
1504 , 'CheckCONOPT' : CheckCONOPT
1505 , 'CheckScrollkeeperConfig' : CheckScrollkeeperConfig
1506 , 'CheckFPE' : CheckFPE
1507 , 'CheckSIGINT' : CheckSIGINT
1508 , 'CheckSigReset' : CheckSigReset
1509 # , 'CheckIsNan' : CheckIsNan
1510 # , 'CheckCppUnitConfig' : CheckCppUnitConfig
1511 }
1512 # , config_h = "config.h"
1513 )
1514
1515 def sconsversioncheck():
1516
1517 # uncomment the following line to skip the version check:
1518 # return 1
1519
1520 import SCons
1521 v = SCons.__version__.split(".")
1522 if v[0] != '0':
1523 return 0
1524 if v[1] != '96':
1525 return 0
1526 micro = int(v[2])
1527 if micro == 92 or micro == 93:
1528 return 1;
1529 return 0
1530
1531 if not sconsversioncheck():
1532 print "Scons version is not OK. Please try version 0.96.92 or 0.96.93,"
1533 print "or consult the developers in the case of newer versions. Modify"
1534 print "the function 'sconsversioncheck' in the file SConstruct if you"
1535 print "want to *force* SCons to continue."
1536 Exit(1)
1537
1538 # stdio -- just to check that compiler is behaving
1539
1540 if not conf.CheckHeader('stdio.h'):
1541 print "CPPPATH =",env.get('CPPPATH')
1542 print "Did not find 'stdio.h'! Check your compiler configuration."
1543 print ""
1544 print "You environment is printed here:"
1545 for k,v in os.environ.iteritems():
1546 print "%-30s%s" % ("%s :" % k, v)
1547 Exit(1)
1548
1549 if not conf.CheckFunc('snprintf'):
1550 print "Didn't find snprintf";
1551 exit(1)
1552
1553 # Math library
1554
1555 conf.env['HAVE_IEEE']=True
1556
1557 if need_libm and not conf.CheckMath():
1558 conf.env['HAVE_IEEE']=False
1559 print 'Did not find math library, exiting!'
1560 Exit(1)
1561
1562 # Where is 'isnan'?
1563
1564 if not conf.CheckFunc('isnan') and not conf.CheckFunc('_isnan'):
1565 print "Didn't find isnan"
1566 # Exit(1)
1567
1568 # GCC visibility
1569
1570 if conf.CheckGcc():
1571 conf.env['HAVE_GCC']=True;
1572 if env['WITH_GCCVISIBILITY'] and conf.CheckGccVisibility():
1573 conf.env['HAVE_GCCVISIBILITY']=True;
1574 conf.env.Append(CCFLAGS=['-fvisibility=hidden'])
1575 conf.env.Append(CPPDEFINES=['HAVE_GCCVISIBILITY'])
1576 conf.env.Append(CCFLAGS=['-Wall'])
1577
1578 # Catching SIGINT
1579
1580 if env['WITH_SIGNALS']:
1581 if not conf.CheckSIGINT():
1582 with_signals = False
1583 without_signals_reason = "SIGINT uncatchable"
1584
1585 # Catching SIGFPE
1586
1587 if conf.CheckFPE():
1588 conf.env['HAVE_C99FPE']=True
1589 else:
1590 conf.env['HAVE_C99FPE']=False
1591
1592 # Checking for signal reset requirement
1593
1594 if not conf.CheckSigReset():
1595 print "Unable to determine if signal reset is required"
1596 Exit(1)
1597
1598 # YACC
1599
1600 if not conf.CheckYacc():
1601 print "YACC NOT FOUND OR NOT WORKING"
1602 else:
1603 conf.env['HAVE_YACC']=True
1604
1605 if not conf.CheckLex():
1606 print "YACC NOT FOUND OR NOT WORKING"
1607 else:
1608 conf.env['HAVE_LEX']=True
1609
1610 # Tcl/Tk
1611
1612 if with_tcltk:
1613 if conf.CheckTcl():
1614 if conf.CheckTclVersion():
1615 if conf.CheckTk():
1616 if with_tcltk and conf.CheckTkVersion():
1617 if env['STATIC_TCLTK']:
1618 if conf.CheckTkTable():
1619 pass
1620 else:
1621 without_tcltk_reason = "TkTable not found"
1622 with_tcltk = False
1623 else:
1624 without_tcltk_reason = "Require Tk version <= 8.4. See 'scons -h'"
1625 with_tcltk = False
1626 else:
1627 without_tcltk_reason = "Tk not found."
1628 with_tcltk = False
1629 else:
1630 without_tcltk_reason = "Require Tcl <= 8.4 Tcl."
1631 with_tcltk = False
1632
1633 else:
1634 without_tcltk_reason = "Tcl not found."
1635 with_tcltk = False
1636
1637 if env['STATIC_TCLTK']:
1638 conf.CheckX11()
1639
1640 # Python... obviously we're already running python, so we just need to
1641 # check that we can link to the python library OK:
1642
1643 if not conf.CheckPythonLib():
1644 without_python_reason = 'libpython2.x not found or not linkable'
1645 with_python = False
1646 env['WITH_PYTHON']=False
1647
1648 # SWIG version
1649
1650 if with_python and not conf.CheckSwigVersion():
1651 without_python_reason = 'SWIG >= 1.3.24 is required'
1652 with_python = False
1653 env['WITH_PYTHON']=False
1654
1655 # CUnit
1656
1657 if with_cunit:
1658 if not conf.CheckCUnit():
1659 without_cunit_reason = 'CUnit not found'
1660 with_cunit = False
1661 #print "CUNIT NOT FOUND, LIBS=",conf.env.get('LIBS')
1662
1663 # DMALLOC
1664
1665 if with_dmalloc:
1666 if not conf.CheckDMalloc():
1667 without_dmalloc_reason = 'dmalloc not found'
1668 with_dmalloc = False
1669
1670 # MFGRAPH
1671
1672 if with_mfgraph:
1673 if not conf.CheckMFGraph():
1674 without_mfgraph_reason = 'mfgraph not found'
1675 with_mfgraph = False
1676 env['WITH_MFGRAPH'] = False
1677
1678 # UFSPARSE
1679
1680 if with_ufsparse:
1681 if not conf.CheckUFSparse():
1682 without_ufsparse_reason = 'mfgraph not found'
1683 with_ufsparse = False
1684 env['WITH_UFSPARSE'] = False
1685
1686 # IDA
1687
1688 if not with_ida:
1689 without_ida_reason = "Not selected (see config option WITH_SOLVERS)"
1690 elif not conf.CheckIDA():
1691 with_ida = False
1692 without_ida_reason = "IDA not found"
1693 elif not conf.CheckIDAVersion():
1694 with_ida = False
1695 without_ida_reason = "Unsupported (or undetected) SUNDIALS version"
1696
1697 # CONOPT
1698
1699 if not with_conopt:
1700 without_conopt_reason = "Not selected (see config option WITH_SOLVERS)"
1701 elif not conf.CheckCONOPT():
1702 with_conopt = False
1703 without_conpt_reason = "CONOPT not found"
1704
1705 # BLAS
1706
1707 need_blas=False
1708
1709 if with_lsode:
1710 need_fortran = True
1711 need_blas=True
1712
1713 if need_blas:
1714 if conf.CheckLib('blas'):
1715 with_local_blas = False
1716 without_local_blas_reason = "Found BLAS installed on system"
1717 else:
1718 with_local_blas = True
1719 need_fortran = True
1720 else:
1721 with_local_blas= False;
1722 without_local_blas_reason = "BLAS not required"
1723
1724 # FORTRAN
1725
1726 if need_fortran:
1727 conf.env.Tool('fortran')
1728 detect_fortran = conf.env.Detect(['gfortran','g77'])
1729 if detect_fortran:
1730 # For some reason, g77 doesn't get detected properly on MinGW
1731 if not env.has_key('F77') and not env.has_key('FORTRAN'):
1732 print "Fixing detection of F77 on MinGW...(?)"
1733 conf.env.Replace(F77=detect_fortran)
1734 conf.env.Replace(F77COM='$F77 $F77FLAGS -c -o $TARGET $SOURCE')
1735 conf.env.Replace(F77FLAGS='')
1736 #print "F77:",conf.env['F77']
1737 #print "F77COM:",conf.env['F77COM']
1738 #print "F77FLAGS:",conf.env['F77FLAGS']
1739 fortran_builder = Builder(
1740 action='$F77COM'
1741 , suffix='.o'
1742 , src_suffix='.f'
1743 )
1744 conf.env.Append(BUILDERS={'Fortran':fortran_builder})
1745 if platform.system()=="Linux":
1746 conf.env.Append(SHFORTRANFLAGS=['-fPIC'])
1747 else:
1748 with_lsode=False;
1749 without_lsode_reason="FORTRAN-77 required but not found"
1750
1751 #else:
1752 # print "FORTRAN not required"
1753
1754 # F2C
1755
1756 if need_fortran:
1757 if platform.system()=="Windows":
1758 pass
1759 #conf.env.Append(LIBPATH='c:\mingw\lib')
1760
1761 # scrollkeeper
1762
1763 if with_scrollkeeper:
1764 if not conf.CheckScrollkeeperConfig():
1765 with_scrollkeeper=False
1766 without_scrollkeeper_reason="unable to detect scrollkeeper-config"
1767
1768 # TODO: -D_HPUX_SOURCE is needed
1769
1770 # TODO: check size of void*
1771
1772 # TODO: detect if dynamic libraries are possible or not
1773
1774 if platform.system()=="Windows" and env.has_key('MSVS'):
1775 _found_windows_h = conf.CheckHeader('Windows.h')
1776
1777 if not _found_windows_h:
1778 print "Could not locate 'Windows.h' in CPPPATH. Check your configuration."
1779 Exit(1)
1780
1781 if with_python and not conf.CheckHeader(['basetsd.h','BaseTsd.h']):
1782 with_python = 0;
1783 without_python_reason = "Header file 'basetsd.h' not found. Install the MS Platform SDK."
1784
1785 conf.env.Append(CPPDEFINES=env['PACKAGE_LINKING'])
1786
1787 conf.Finish()
1788
1789 #---------------------------------------
1790 # SUBSTITUTION DICTIONARY for .in files
1791
1792 release = env.get('RELEASE')
1793 if release=="0.":
1794 release="0"
1795
1796 #print "SUBSTITUTED CONOPT_LIBPATH:",c_escape(env.subst("$CONOPT_LIBPATH"))
1797
1798 subst_dict = {
1799 '@DEFAULT_ASCENDLIBRARY@':env['DEFAULT_ASCENDLIBRARY']
1800 , '@GLADE_FILE@':'ascend.glade'
1801 , '@HELP_ROOT@':''
1802 , '@ICON_EXTENSION@':icon_extension
1803 , '@INSTALL_ASCDATA@':env['INSTALL_ASCDATA']
1804 , '@INSTALL_BIN@':env['INSTALL_BIN']
1805 , '@INSTALL_INCLUDE@':env['INSTALL_INCLUDE']
1806 , '@INSTALL_LIB@':env['INSTALL_LIB']
1807 , '@INSTALL_MODELS@':env['INSTALL_MODELS']
1808 , '@PYGTK_ASSETS@':env['PYGTK_ASSETS']
1809 , '@VERSION@':version
1810 , '@RELEASE@':release
1811 , '@DISTTAR_NAME@':env['DISTTAR_NAME']
1812 , '@WEBHELPROOT@':'http://pye.dyndns.org/ascend/manual/'
1813 , '@SHLIBSUFFIX@':env['SHLIBSUFFIX']
1814 , '@SHLIBPREFIX@':env['SHLIBPREFIX']
1815 , '@ASC_ENV_TK_DEFAULT@' : '$$ASCENDDIST/tcltk'
1816 , '@ASC_DISTDIR_REL_BIN@' : default_rel_distdir
1817 , '@PYTHON@' : python_exe
1818 , '@ASC_CONOPT_LIB@':env.get('CONOPT_LIB')
1819 , '@ASC_CONOPT_ENVVAR@':env.get('CONOPT_ENVVAR')
1820 , '@ASC_CONOPT_DLPATH@':c_escape(env.subst("$CONOPT_LIBPATH"))
1821 , '@SOURCE_ROOT@':c_escape(os.path.abspath(str(env.Dir("#"))))
1822 }
1823
1824 if env.get('WITH_LOCAL_HELP'):
1825 print "WITH_LOCAL_HELP:",env['WITH_LOCAL_HELP']
1826 subst_dict['@HELP_ROOT@']=env['WITH_LOCAL_HELP']
1827
1828 # bool options...
1829 for k,v in {
1830 'ASC_WITH_IDA':with_ida
1831 ,'ASC_WITH_DMALLOC':with_dmalloc
1832 ,'ASC_WITH_MFGRAPH':with_mfgraph
1833 ,'ASC_WITH_UFSPARSE':with_ufsparse
1834 ,'ASC_WITH_CONOPT':with_conopt
1835 ,'ASC_WITH_LSODE':with_lsode
1836 ,'ASC_WITH_MMIO':with_mmio
1837 ,'ASC_SIGNAL_TRAPS':with_signals
1838 ,'ASC_RESETNEEDED':env.get('ASC_RESETNEEDED')
1839 ,'HAVE_C99FPE':env.get('HAVE_C99FPE')
1840 ,'HAVE_IEEE':env.get('HAVE_IEEE')
1841 ,'ASC_ABSOLUTE_PATHS':env.get('ASC_ABSOLUTE_PATHS')
1842 ,'ASC_XTERM_COLORS':env.get('WITH_XTERM_COLORS')
1843 ,'MALLOC_DEBUG':env.get('MALLOC_DEBUG')
1844 }.iteritems():
1845
1846 if v: subst_dict["/\\* #define %s @%s@ \\*/" % (k,k)]='# define %s 1 ' % k
1847
1848 if with_python:
1849 subst_dict['@ASCXX_USE_PYTHON@']="1"
1850 env['WITH_PYTHON']=1;
1851
1852 if env.has_key('HAVE_GCCVISIBILITY'):
1853 subst_dict['@HAVE_GCCVISIBILITY@'] = "1"
1854
1855 env.Append(SUBST_DICT=subst_dict)
1856
1857 #for k,v in subst_dict.iteritems():
1858 # print "%-50s%s" % ("'%s'"%k,v)
1859
1860 # REMOVED: long command-line support on Win2k
1861
1862 #------------------------------------------------------
1863 # RECIPE: SWIG scanner
1864
1865 import SCons.Script
1866
1867 SWIGScanner = SCons.Scanner.ClassicCPP(
1868 "SWIGScan"
1869 , ".i"
1870 , "CPPPATH"
1871 , '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'
1872 )
1873
1874 env.Append(SCANNERS=[SWIGScanner])
1875
1876 #------------------------------------------------------
1877 # RECIPE: 'SubstInFile', used in pygtk SConscript
1878
1879 import re
1880 from SCons.Script import * # the usual scons stuff you get in a SConscript
1881
1882 def TOOL_SUBST(env):
1883 """Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
1884 from the source to the target.
1885 The values of SUBST_DICT first have any construction variables expanded
1886 (its keys are not expanded).
1887 If a value of SUBST_DICT is a python callable function, it is called and
1888 the result is expanded as the value.
1889 If there's more than one source and more than one target, each target gets
1890 substituted from the corresponding source.
1891 """
1892 env.Append(TOOLS = 'SUBST')
1893 def do_subst_in_file(targetfile, sourcefile, dict):
1894 """Replace all instances of the keys of dict with their values.
1895 For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
1896 then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
1897 """
1898 try:
1899 f = open(sourcefile, 'rb')
1900 contents = f.read()
1901 f.close()
1902 except:
1903 raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile
1904 for (k,v) in dict.items():
1905 try:
1906 #print "%s ---> %s" % (k,v)
1907 contents = re.sub(k, v, contents)
1908 except Exception,e:
1909 sys.stderr.write("Failed to substute '%s' with '%s': %s\n" % (k,v,e))
1910
1911 try:
1912 f = open(targetfile, 'wb')
1913 f.write(contents)
1914 f.close()
1915 except:
1916 raise SCons.Errors.UserError, "Can't write target file %s"%targetfile
1917 return 0 # success
1918
1919 def subst_in_file(target, source, env):
1920 if not env.has_key('SUBST_DICT'):
1921 raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set."
1922 d = dict(env['SUBST_DICT']) # copy it
1923 for (k,v) in d.items():
1924 if callable(v):
1925 d[k] = env.subst(v())
1926 elif SCons.Util.is_String(v):
1927 d[k]=env.subst(v)
1928 else:
1929 raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v))
1930 for (t,s) in zip(target, source):
1931 return do_subst_in_file(str(t), str(s), d)
1932
1933 def subst_in_file_string(target, source, env):
1934 """This is what gets printed on the console."""
1935 return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t))
1936 for (t,s) in zip(target, source)])
1937
1938 def subst_emitter(target, source, env):
1939 """Add dependency from substituted SUBST_DICT to target.
1940 Returns original target, source tuple unchanged.
1941 """
1942 d = env['SUBST_DICT'].copy() # copy it
1943 for (k,v) in d.items():
1944 if callable(v):
1945 d[k] = env.subst(v())
1946 elif SCons.Util.is_String(v):
1947 d[k]=env.subst(v)
1948 Depends(target, SCons.Node.Python.Value(d))
1949 return target, source
1950
1951 subst_action=SCons.Action.Action(subst_in_file, subst_in_file_string)
1952 env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
1953
1954 TOOL_SUBST(env)
1955
1956 #------------------------------------------------------
1957 # Recipe for 'CHMOD' ACTION
1958
1959 import SCons
1960 from SCons.Script.SConscript import SConsEnvironment
1961 SConsEnvironment.Chmod = SCons.Action.ActionFactory(os.chmod,
1962 lambda dest, mode: 'Chmod("%s", 0%o)' % (dest, mode))
1963
1964 def InstallPerm(env, dest, files, perm):
1965 obj = env.Install(dest, files)
1966 for i in obj:
1967 env.AddPostAction(i, env.Chmod(str(i), perm))
1968
1969 SConsEnvironment.InstallPerm = InstallPerm
1970
1971 # define wrappers
1972 SConsEnvironment.InstallProgram = lambda env, dest, files: InstallPerm(env, dest, files, 0755)
1973 SConsEnvironment.InstallHeader = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1974 SConsEnvironment.InstallShared = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1975
1976 #------------------------------------------------------
1977 # BUILD...
1978
1979 # so that #include <modulename/headername.h> works across all modules...
1980 env.AppendUnique(CPPPATH=['#base/generic'])
1981
1982 if env['DEBUG']:
1983 env.Append(CCFLAGS=['-g'])
1984
1985 if env['GCOV']:
1986 env.Append(
1987 CPPFLAGS=['-g','-fprofile-arcs','-ftest-coverage']
1988 , LIBS=['gcov']
1989 , LINKFLAGS=['-fprofile-arcs','-ftest-coverage']
1990 )
1991
1992 if with_ida:
1993 env.Append(WITH_IDA=1)
1994
1995 if with_conopt:
1996 env.Append(WITH_CONOPT=1)
1997
1998 #-------------
1999 # TCL/TK GUI
2000
2001 if with_tcltk:
2002 env.SConscript(['tcltk/generic/interface/SConscript'],'env')
2003 else:
2004 print "Skipping... Tcl/Tk bindings aren't being built:",without_tcltk_reason
2005
2006 #-------------
2007 # PYTHON INTERFACE
2008
2009 if with_python:
2010 env.SConscript(['pygtk/SConscript'],'env')
2011 else:
2012 print "Skipping... Python bindings aren't being built:",without_python_reason
2013
2014 #------------
2015 # BASE/GENERIC SUBDIRECTORIES
2016
2017 libascend_env = env.Copy()
2018
2019 dirs = ['general','utilities','compiler','system','solver','integrator','packages','linear']
2020
2021 srcs = []
2022 for d in dirs:
2023 heresrcs = libascend_env.SConscript('base/generic/'+d+'/SConscript','libascend_env')
2024 srcs += heresrcs
2025
2026 #-------------
2027 # IMPORTED CODE: LSODE, BLAS, etc
2028
2029 if with_lsode:
2030 srcs += env.SConscript(['lsod/SConscript'],'env')
2031 srcs += env.SConscript(['linpack/SConscript'],'env')
2032 else:
2033 print "Skipping... LSODE won't be built:", without_lsode_reason
2034
2035 if with_local_blas:
2036 srcs += env.SConscript(['blas/SConscript'],'env')
2037 else:
2038 print "Skipping... BLAS won't be built:", without_local_blas_reason
2039
2040 if not with_ida:
2041 print "Skipping... IDA won't be built:", without_ida_reason
2042
2043 if with_mmio:
2044 srcs += env.SConscript(['mmio/SConscript'],'env')
2045 else:
2046 print "Skipping... MMIO export won't be built:", without_mmio_reason
2047 #-------------
2048 # LIBASCEND -- all base/generic functionality
2049
2050 if with_dmalloc:
2051 libascend_env.Append(LIBS=['dmalloc'])
2052
2053 if with_ufsparse:
2054 libascend_env.Append(LIBS=['cxsparse'])
2055
2056 libascend = libascend_env.SharedLibrary('ascend',srcs)
2057
2058 env.Alias('libascend',libascend)
2059
2060 #-------------
2061 # UNIT TESTS (C CODE)
2062
2063 if with_cunit:
2064 testdirs = ['general','solver','utilities','linear']
2065 testsrcs = []
2066 for testdir in testdirs:
2067 path = 'base/generic/'+testdir+'/test/'
2068 env.SConscript([path+'SConscript'],'env')
2069 testsrcs += [i.path for i in env['TESTSRCS_'+testdir.upper()]]
2070
2071 #print "TESTSRCS =",testsrcs
2072
2073 env.SConscript(['test/SConscript'],'env')
2074 env.SConscript(['base/generic/test/SConscript'],'env')
2075
2076 env.Alias('test',[env.Dir('test'),env.Dir('base/generic/test')])
2077
2078 else:
2079 print "Skipping... CUnit tests aren't being built:",without_cunit_reason
2080
2081 #-------------
2082 # EXTERNAL FUNCTIONS
2083
2084 env['extfns']=[]
2085 modeldirs = env.SConscript(['models/SConscript'],'env')
2086
2087 if not with_extfns:
2088 print "Skipping... External modules aren't being built:",without_extfns_reason
2089
2090 env.Alias('extfns',env['extfns'])
2091
2092 #------------------------------------------------------
2093 # CREATE ASCEND-CONFIG scriptlet
2094
2095 ascendconfig = env.SubstInFile('ascend-config.in')
2096
2097 #------------------------------------------------------
2098 # INSTALLATION
2099
2100 if env.get('CAN_INSTALL'):
2101
2102 dirs = ['INSTALL_BIN','INSTALL_ASCDATA','INSTALL_LIB', 'INSTALL_INCLUDE']
2103 install_dirs = [env.Entry(env['INSTALL_ROOT']+env[d]) for d in dirs]
2104 install_dirs += modeldirs
2105
2106 # TODO: add install options
2107 env.Alias('install',install_dirs)
2108
2109 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_LIB'],libascend)
2110
2111 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendconfig)
2112
2113 #------------------------------------------------------
2114 # WINDOWS INSTALLER
2115 # For the windows installer, please see pygtk/SConscript
2116
2117 if with_installer:
2118 pass
2119 else:
2120 print "Skipping... Windows installer isn't being built:",without_installer_reason
2121
2122 #------------------------------------------------------
2123 # PROJECT FILE for MSVC
2124
2125 env.SConscript(['base/msvc/SConscript'],['env','libascend']);
2126
2127 #------------------------------------------------------
2128 # CREATE the SPEC file for generation of RPM packages
2129
2130 if platform.system()=="Linux":
2131 env.SubstInFile('ascend.spec.in')
2132
2133 #------------------------------------------------------
2134 # CREATE OMF FILE FOR USE WITH SCROLLKEEPER
2135
2136 if with_scrollkeeper:
2137 env.SubstInFile('#/pygtk/gnome/ascend.omf.in')
2138 env.InstallShared(env['INSTALL_ROOT']+env['OMFDIR'],"#/pygtk/gnome/ascend.omf")
2139
2140 #------------------------------------------------------
2141 # DISTRIBUTION TAR FILE
2142
2143 env['DISTTAR_FORMAT']='bz2'
2144 env.Append(
2145 DISTTAR_EXCLUDEEXTS=['.o','.os','.so','.a','.dll','.cc','.cache','.pyc','.cvsignore','.dblite','.log','.pl','.out']
2146 , DISTTAR_EXCLUDEDIRS=['CVS','.svn','.sconf_temp', 'dist']
2147 )
2148
2149 tar = env.DistTar("dist/"+env['DISTTAR_NAME']
2150 , [env.Dir('#')]
2151 )
2152
2153 env.Depends(tar,'ascend.spec')
2154
2155 Alias('dist',tar)
2156
2157 #------------------------------------------------------
2158 # USER'S MANUAL
2159
2160 env.SConscript('doc/SConscript',['env'])
2161
2162 #------------------------------------------------------
2163 # LIBASCEND DOXYGEN DOCUMENTATION
2164
2165 env.SConscript('base/doc/SConscript',['env'])
2166
2167 #------------------------------------------------------
2168 # RPM BUILD
2169
2170 # for RPM builds, 'scons dist' then 'rpmbuild -ta dist/ascend-*.tar.bz2'
2171 # (check * for the version number used to create the tarball)
2172
2173 #------------------------------------------------------
2174 # DEFAULT TARGETS
2175
2176 default_targets =['libascend']
2177 if with_tcltk:
2178 default_targets.append('tcltk')
2179 if with_python:
2180 default_targets.append('pygtk')
2181 if with_installer:
2182 default_targets.append('installer')
2183 if with_extfns:
2184 default_targets.append('extfns')
2185
2186 env.Default(default_targets)
2187
2188 print "Building targets:"," ".join([str(i) for i in BUILD_TARGETS])
2189
2190 # vim: set syntax=python:

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