/[ascend]/trunk/SConstruct
ViewVC logotype

Contents of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1357 - (show annotations) (download)
Fri Mar 23 02:57:39 2007 UTC (13 years, 2 months ago) by jpye
File size: 51964 byte(s)
Added SCons version check so that Krishnan stops wondering why he
can't build ASCEND on brand-new shiny version 999 of obsurre linux
platform X.
1 import sys, os, commands, platform, distutils.sysconfig, os.path, re
2
3 version = "0.9.5.107"
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 ,"g2c"
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 opts.Update(env)
637 opts.Save('options.cache',env)
638
639 Help(opts.GenerateHelpText(env))
640
641 with_tcltk = env.get('WITH_TCLTK')
642 without_tcltk_reason = "disabled by options/config.py"
643
644 with_python = env.get('WITH_PYTHON')
645 without_python_reason = "disabled by options/config.py"
646
647 with_cunit = env.get('WITH_CUNIT')
648 without_cunit_reason = "not requested"
649
650 with_extfns = env.get('WITH_EXTFNS')
651 without_extfn_reason = "disabled by options/config.py"
652
653 with_scrollkeeper = env.get('WITH_SCROLLKEEPER')
654 without_scrollkeeper_reason = "disabled by options/config.py"
655
656 with_dmalloc = env.get('WITH_DMALLOC')
657 without_dmalloc_reason = "disabled by options/config.py"
658
659 with_mfgraph = env.get('WITH_MFGRAPH')
660 without_mfgraph_reason = "disabled by options/config.py"
661
662 with_ufsparse = env.get('WITH_UFSPARSE')
663 without_ufsparse_reason = "disabled by options/config.py"
664
665 with_mmio = env.get('WITH_MMIO')
666 without_mmio_reason = "disabled by options/config.py"
667
668 with_signals = env.get('WITH_SIGNALS')
669 without_signals_reason = "disabled by options/config.py"
670
671 if platform.system()=="Windows":
672 with_installer=1
673 else:
674 with_installer=0
675 without_installer_reason = "only possible under Windows"
676
677 if 'LSOD' in env['WITH_SOLVERS']:
678 with_lsode=True
679 else:
680 with_lsode=False
681 without_lsode_reason = "not requested (WITH_SOLVERS)"
682
683 if 'IDA' in env['WITH_SOLVERS']:
684 with_ida=True
685 else:
686 with_ida=False
687 without_ida_reason = "not requested (WITH_SOLVERS)"
688
689
690 if 'CONOPT' in env['WITH_SOLVERS']:
691 with_conopt=True
692 else:
693 with_conopt=False
694 without_conopt_reason = "not requested (WITH_SOLVERS)"
695
696
697 #print "SOLVERS:",env['WITH_SOLVERS']
698 #print "WITH_BINTOKEN:",env['WITH_BINTOKEN']
699 #print "DEFAULT_ASCENDLIBRARY:",env['DEFAULT_ASCENDLIBRARY']
700
701 can_install = True
702 if platform.system()=='Windows':
703 can_install = False
704
705 env['CAN_INSTALL']=can_install
706 env['INSTALL_MODELS']=env['INSTALL_ASCDATA']+"/models/"
707
708 print "TCL_CPPPATH =",env['TCL_CPPPATH']
709 print "TCL_LIBPATH =",env['TCL_LIBPATH']
710 print "TCL_LIB =",env['TCL_LIB']
711 print "CC =",env['CC']
712 print "CXX =",env['CXX']
713 print "FORTRAN=",env.get('FORTRAN')
714
715 print "ABSOLUTE PATHS =",env['ABSOLUTE_PATHS']
716 #------------------------------------------------------
717 # SPECIAL CONFIGURATION TESTS
718
719 need_fortran = False
720
721 #----------------
722 # SWIG
723
724 import os,re
725
726 def get_swig_version(env):
727 cmd = env['SWIG']+' -version'
728 (cin,coutcerr) = os.popen4(cmd)
729 output = coutcerr.read()
730
731 restr = "SWIG\\s+Version\\s+(?P<maj>[0-9]+)\\.(?P<min>[0-9]+)\\.(?P<pat>[0-9]+)\\s*$"
732 expr = re.compile(restr,re.M);
733 m = expr.search(output);
734 if not m:
735 return None
736 maj = int(m.group('maj'))
737 min = int(m.group('min'))
738 pat = int(m.group('pat'))
739
740 return (maj,min,pat)
741
742
743 def CheckSwigVersion(context):
744
745 try:
746 context.Message("Checking version of SWIG... ")
747 maj,min,pat = get_swig_version(context.env)
748 except:
749 context.Result("Failed to detect version, or failed to run SWIG")
750 return 0;
751
752 context.env['SWIGVERSION']=tuple([maj,min,pat])
753
754 if maj == 1 and (
755 min > 3
756 or (min == 3 and pat >= 24)
757 ):
758 context.Result("ok, %d.%d.%d" % (maj,min,pat))
759 return 1;
760 else:
761 context.Result("too old, %d.%d.%d" % (maj,min,pat))
762 return 0;
763
764 #----------------
765 # Scrollkeeper (Linux documentation system)
766
767 def get_scrollkeeper_omfdir(env):
768 cmd = 'scrollkeeper-config --omfdir'
769 (cin,coutcerr) = os.popen4(cmd)
770 output = coutcerr.read()
771 return output.strip()
772
773 def CheckScrollkeeperConfig(context):
774 try:
775 context.Message("Checking for scrollkeeper...")
776 dir=get_scrollkeeper_omfdir(context.env)
777 except:
778 context.Result("Failed to run 'scrollkeeper-config'")
779 return 0
780 context.env['OMFDIR']=dir
781 context.Result("OK, %s" % dir)
782 return 1
783
784 #----------------
785 # General purpose library-and-header test
786
787 class KeepContext:
788 def __init__(self,context,varprefix,static=False):
789 self.keep = {}
790 for k in ['LIBS','LIBPATH','CPPPATH','LINKFLAGS']:
791 #print "Keeping env %s = %s" % (k,context.env.get(k))
792 self.keep[k]=context.env.get(k)
793
794 if context.env.has_key(varprefix+'_CPPPATH'):
795 context.env.AppendUnique(CPPPATH=[env[varprefix+'_CPPPATH']])
796 #print "Adding '"+str(env[varprefix+'_CPPPATH'])+"' to cpp path"
797
798 if static:
799 staticlib=env[varprefix+'_LIB']
800 #print "STATIC LIB = ",staticlib
801 context.env.Append(
802 LINKFLAGS=[staticlib]
803 )
804 else:
805 if context.env.has_key(varprefix+'_LIBPATH'):
806 context.env.Append(LIBPATH=[env[varprefix+'_LIBPATH']])
807 #print "Adding '"+str(env[varprefix+'_LIBPATH'])+"' to lib path"
808
809 if context.env.has_key(varprefix+'_LIB'):
810 context.env.Append(LIBS=[env[varprefix+'_LIB']])
811 #print "Adding '"+str(env[varprefix+'_LIB'])+"' to libs"
812
813 def restore(self,context):
814 #print "RESTORING CONTEXT"
815 #print self.keep
816 #print "..."
817 for k in self.keep:
818 if self.keep[k]==None:
819 if context.env.has_key(k):
820 #print "Clearing "+str(k)
821 del context.env[k];
822 else:
823 #print "Restoring %s to '%s'" %(k,self.keep.get(k))
824 context.env[k]=self.keep[k];
825
826 def CheckExtLib(context,libname,text,ext='.c',varprefix=None,static=False):
827 """This method will check for variables LIBNAME_LIBPATH
828 and LIBNAME_CPPPATH and try to compile and link the
829 file with the provided text, linking with the
830 library libname."""
831
832 if static:
833 context.Message( 'Checking for static '+libname+'... ' )
834 else:
835 context.Message( 'Checking for '+libname+'... ' )
836
837 if varprefix==None:
838 varprefix = libname.upper()
839
840 #print "LIBS is currently:",context.env.get('LIBS')
841 keep = KeepContext(context,varprefix,static)
842
843 if not context.env.has_key(varprefix+'_LIB'):
844 # if varprefix_LIB were in env, KeepContext would
845 # have appended it already
846 context.env.Append(LIBS=[libname])
847
848 is_ok = context.TryLink(text,ext)
849
850 #print "Link success? ",(is_ok != 0)
851
852 keep.restore(context)
853
854 # print "Restored CPPPATH="+str(context.env['CPPPATH'])
855 # print "Restored LIBS="+str(context.env['LIBS'])
856 # print "Restored LIBPATH="+str(context.env['LIBPATH'])
857
858 context.Result(is_ok)
859 return is_ok
860
861 #----------------
862 # GCC
863
864 gcc_test_text = """
865 #ifndef __GNUC__
866 # error "Not using GCC"
867 #endif
868
869 int main(void){
870 return __GNUC__;
871 }
872 """
873
874 def CheckGcc(context):
875 context.Message("Checking for GCC... ")
876 is_ok = context.TryCompile(gcc_test_text,".c")
877 context.Result(is_ok)
878 return is_ok
879
880 #----------------
881 # GCC VISIBILITY feature
882
883 gccvisibility_test_text = """
884 #if __GNUC__ < 4
885 # error "Require GCC version 4 or newer"
886 #endif
887
888 __attribute__ ((visibility("default"))) int x;
889
890 int main(void){
891 extern int x;
892 x = 4;
893 }
894 """
895
896 def CheckGccVisibility(context):
897 context.Message("Checking for GCC 'visibility' capability... ")
898 if not context.env.has_key('WITH_GCCVISIBILITY') or not env['WITH_GCCVISIBILITY']:
899 context.Result("disabled")
900 return 0
901 is_ok = context.TryCompile(gccvisibility_test_text,".c")
902 context.Result(is_ok)
903 return is_ok
904
905 #----------------
906 # YACC
907
908 yacc_test_text = """
909 %{
910 #include <stdio.h>
911
912 /* MSVC++ needs this before it can swallow Bison output */
913 #ifdef _MSC_VER
914 # define __STDC__
915 #endif
916 %}
917 %token MSG
918 %start ROOT
919 %%
920 ROOT:
921 MSG { printf("HELLO"); }
922 ;
923 %%
924 """
925
926 def CheckYacc(context):
927 context.Message("Checking for Yacc ('%s')... " % context.env.get('YACC'))
928 is_ok = context.TryCompile(yacc_test_text,".y")
929 context.Result(is_ok)
930 return is_ok
931
932 #----------------
933 # LEX
934
935 lex_test_text = """
936 %{
937 #include <stdio.h>
938 %}
939 DIGIT [0-9]
940 ID [a-z][a-z0-9]*
941 %%
942 {DIGIT}+ {
943 printf("A digit: %s\\n",yytext);
944 }
945
946 [ \\t\\n]+ /* ignore */
947
948 . {
949 printf("Unrecognized guff");
950 }
951 %%
952 main(){
953 yylex();
954 }
955 """
956
957 def CheckLex(context):
958 context.Message("Checking for Lex ('%s')... " % context.env.get('LEX'))
959 is_ok = context.TryCompile(lex_test_text,".l")
960 context.Result(is_ok)
961 return is_ok
962
963 #----------------
964 # CUnit test
965
966 cunit_test_text = """
967 #include <CUnit/CUnit.h>
968 int maxi(int i1, int i2){
969 return (i1 > i2) ? i1 : i2;
970 }
971
972 void test_maxi(void){
973 CU_ASSERT(maxi(0,2) == 2);
974 CU_ASSERT(maxi(0,-2) == 0);
975 CU_ASSERT(maxi(2,2) == 2);
976
977 }
978 int main(void){
979 /* CU_initialize_registry() */
980 return 0;
981 }
982 """
983
984 def CheckCUnit(context):
985 return CheckExtLib(context,'cunit',cunit_test_text)
986
987 #----------------
988 # dmalloc test
989
990 dmalloc_test_text = """
991 #include <stdlib.h>
992 #include <dmalloc.h>
993
994 int main(void){
995 char *c;
996 c = malloc(100*sizeof(char));
997 free(c);
998 return 0;
999 }
1000 """
1001
1002 def CheckDMalloc(context):
1003 return CheckExtLib(context,'dmalloc',dmalloc_test_text)
1004
1005 #----------------
1006 # mfgraph test
1007
1008 mfgraph_test_text = """
1009 #include <mfgraph/mfg_draw_graph.h>
1010 int main(void){
1011 using namespace mfg;
1012 DrawGraph g;
1013 return 0;
1014 }
1015 """
1016
1017 def CheckMFGraph(context):
1018 return CheckExtLib(context,'mfgraph',mfgraph_test_text,ext=".cpp")
1019
1020 #----------------
1021 # ufsparse test
1022
1023 ufsparse_test_text = """
1024 #include <ufsparse/cs.h>
1025 int main(void){
1026 cs *A,*B,*C;
1027 C = cs_multiply(A,B);
1028 return 0;
1029 }
1030 """
1031
1032 def CheckUFSparse(context):
1033 return CheckExtLib(context
1034 ,libname='cxsparse'
1035 ,varprefix='ufsparse'
1036 ,text=ufsparse_test_text
1037 ,ext=".c"
1038 )
1039
1040 #----------------
1041 # MATH test
1042
1043 math_test_text = """
1044 #ifndef _ALL_SOURCE
1045 # define _ALL_SOURCE
1046 #endif
1047 #ifndef _XOPEN_SOURCE
1048 # define _XOPEN_SOURCE
1049 #endif
1050 #ifndef _XOPEN_SOURCE_EXTENDED
1051 # define _XOPEN_SOURCE_EXTENDED 1
1052 #endif
1053 #include <math.h>
1054 int main(void){
1055 double x = 1.0; double y = 1.0; int i = 1;
1056 acosh(x); asinh(x); atanh(x); cbrt(x); expm1(x); erf(x); erfc(x); isnan(x);
1057 j0(x); j1(x); jn(i,x); ilogb(x); logb(x); log1p(x); rint(x);
1058 y0(x); y1(x); yn(i,x);
1059 #ifdef _THREAD_SAFE
1060 gamma_r(x,&i);
1061 lgamma_r(x,&i);
1062 #else
1063 gamma(x);
1064 lgamma(x);
1065 #endif
1066 hypot(x,y); nextafter(x,y); remainder(x,y); scalb(x,y);
1067 return 0;
1068 }
1069 """
1070
1071 def CheckMath(context):
1072 context.Message('Checking for IEEE math library... ')
1073 libsave=context.env.get('LIBS');
1074 context.env.AppendUnique(LIBS=['m'])
1075 is_ok=context.TryLink(math_test_text,".c")
1076 context.Result(is_ok)
1077 if not is_ok:
1078 context.env['LIBS']=libsave
1079 return is_ok
1080
1081 #----------------
1082 # libpython test
1083
1084 libpython_test_text = """
1085 #include <Python.h>
1086 int main(void){
1087 PyObject *p;
1088 p = Py_None;
1089 return 0;
1090 }
1091 """
1092
1093 def CheckPythonLib(context):
1094 context.Message('Checking for libpython... ')
1095
1096 if platform.system()=="Windows":
1097 python_lib='python%d%d'
1098 else:
1099 python_lib='python%d.%d'
1100 python_libs = [python_lib % (sys.version_info[0],sys.version_info[1])]
1101
1102 python_cpppath = [distutils.sysconfig.get_python_inc()]
1103 cfig = distutils.sysconfig.get_config_vars()
1104
1105 lastLIBS = context.env.get('LIBS')
1106 lastLIBPATH = context.env.get('LIBPATH')
1107 lastCPPPATH = context.env.get('CPPPATH')
1108 lastLINKFLAGS = context.env.get('LINKFLAGS')
1109
1110 python_libpath = []
1111 python_linkflags = []
1112 if platform.system()=="Windows":
1113 python_libpath+=[cfig['prefix']]
1114 else:
1115 # checked on Linux and SunOS
1116 if cfig['LDLIBRARY']==cfig['LIBRARY']:
1117 sys.stdout.write("(static)")
1118 python_libpath += [cfig['LIBPL']]
1119 python_linkflags += cfig['LIBS'].split(' ')
1120
1121 context.env.AppendUnique(LIBS=python_libs)
1122 context.env.AppendUnique(LIBPATH=python_libpath)
1123 context.env.AppendUnique(CPPPATH=python_cpppath)
1124 context.env.AppendUnique(LINKFLAGS=python_linkflags)
1125 result = context.TryLink(libpython_test_text,".c");
1126
1127 context.Result(result)
1128
1129 if(result):
1130 context.env['PYTHON_LIBPATH']=python_libpath
1131 context.env['PYTHON_LIB']=python_libs
1132 context.env['PYTHON_CPPPATH']=python_cpppath
1133 context.env['PYTHON_LINKFLAGS']=python_linkflags
1134
1135 context.env['LIBS'] = lastLIBS
1136 context.env['LIBPATH'] = lastLIBPATH
1137 context.env['CPPPATH'] = lastCPPPATH
1138 context.env['LINKFLAGS'] = lastLINKFLAGS
1139
1140 return result
1141
1142 #----------------
1143 # IDA test
1144
1145 sundials_version_major_required = 2
1146 sundials_version_minor_min = 2
1147 sundials_version_minor_max = 3
1148
1149 sundials_version_text = """
1150 #include <sundials/sundials_config.h>
1151 #include <stdio.h>
1152 int main(){
1153 printf("%s",SUNDIALS_PACKAGE_VERSION);
1154 return 0;
1155 }
1156 """
1157
1158 ida_test_text = """
1159 # include <ida/ida.h>
1160 # include <nvector/nvector_serial.h>
1161 # include <ida/ida_spgmr.h>
1162 int main(){
1163 void *ida_mem;
1164 ida_mem = IDACreate();
1165 return 0;
1166 }
1167 """
1168
1169 def CheckIDA(context):
1170 context.Message( 'Checking for IDA (SUNDIALS)... ' )
1171
1172 keep = KeepContext(context,"IDA")
1173
1174 is_ok = context.TryLink(ida_test_text,".c")
1175 context.Result(is_ok)
1176
1177 keep.restore(context)
1178
1179 return is_ok
1180
1181 # slightly changed calling convention (IDACalcID) in newer versions of SUNDIALS,
1182 # so detect the version and act accordingly.
1183 def CheckIDAVersion(context):
1184 keep = KeepContext(context,'IDA')
1185 context.Message("Checking SUNDIALS version... ")
1186 (is_ok,output) = context.TryRun(sundials_version_text,'.c')
1187 keep.restore(context)
1188 if not is_ok:
1189 context.Result("failed to run check")
1190 return 0
1191
1192 major,minor,patch = tuple([int(i) for i in output.split(".")])
1193 context.env['SUNDIALS_VERSION_MAJOR'] = major
1194 context.env['SUNDIALS_VERSION_MINOR'] = minor
1195 if major != sundials_version_major_required \
1196 or minor < sundials_version_minor_min \
1197 or minor > sundials_version_minor_max:
1198 context.Result(output+" (bad version)")
1199 # bad version
1200 return 0
1201
1202 # good version
1203 context.Result("%d.%d.%d, good" % (major,minor,patch))
1204 return 1
1205
1206 #----------------
1207 # CONOPT test
1208
1209 conopt_test_text = """
1210 #if !defined(_WIN32)
1211 # define FNAME_LCASE_DECOR
1212 #endif
1213
1214 #include <conopt.h>
1215 #include <stdlib.h>
1216 int main(){
1217 int s, *v, e;
1218 s = COIDEF_Size();
1219 v = (int *)malloc(s*sizeof(int));
1220 e = COIDEF_Ini(v);
1221 return e;
1222 }
1223 """
1224
1225 def CheckCONOPT(context):
1226 context.Message( 'Checking for CONOPT... ' )
1227
1228 keep = KeepContext(context,"CONOPT")
1229
1230 is_ok = context.TryLink(conopt_test_text,".c")
1231 context.Result(is_ok)
1232
1233 keep.restore(context)
1234
1235 return is_ok
1236
1237 #----------------
1238 # Tcl test
1239
1240 # TCL and TK required version 8.1, 8.2, 8.3, or 8.4:
1241 tcltk_minor_newest_acceptable = 4
1242 tcltk_major_required = 8
1243
1244 tcl_check_text = r"""
1245 #include <tcl.h>
1246 #include <stdio.h>
1247 int main(void){
1248 printf("%s",TCL_PATCH_LEVEL);
1249 return 0;
1250 }
1251 """
1252
1253 def CheckTcl(context):
1254 return CheckExtLib(context,'tcl',tcl_check_text,static=env['STATIC_TCLTK'])
1255
1256 def CheckTclVersion(context):
1257 keep = KeepContext(context,'TCL',static=env['STATIC_TCLTK'])
1258 context.Message("Checking Tcl version... ")
1259 (is_ok,output) = context.TryRun(tcl_check_text,'.c')
1260 keep.restore(context)
1261 if not is_ok:
1262 context.Result("failed to run check")
1263 return 0
1264
1265 major,minor,patch = tuple([int(i) for i in output.split(".")])
1266 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
1267 context.Result(output+" (bad version)")
1268 # bad version
1269 return 0
1270
1271 # good version
1272 context.Result(output+", good")
1273 return 1
1274
1275 #----------------
1276 # Tk test
1277
1278 tk_check_text = r"""
1279 #include <tk.h>
1280 #include <stdio.h>
1281 int main(void){
1282 printf("%s",TK_PATCH_LEVEL);
1283 return 0;
1284 }
1285 """
1286 def CheckTk(context):
1287 return CheckExtLib(context,'tk',tk_check_text,static=env['STATIC_TCLTK'])
1288
1289
1290 def CheckTkVersion(context):
1291 keep = KeepContext(context,'TK',static=context.env['STATIC_TCLTK'])
1292 context.Message("Checking Tk version... ")
1293 #print "LINKFLAGS =",context.env['LINKFLAGS']
1294 (is_ok,output) = context.TryRun(tk_check_text,'.c')
1295 keep.restore(context)
1296 if not is_ok:
1297 context.Result("failed to run check")
1298 return 0
1299
1300 major,minor,patch = tuple([int(i) for i in output.split(".")])
1301 if major != tcltk_major_required or minor > tcltk_minor_newest_acceptable:
1302 # bad version
1303 context.Result(output+" (bad version)")
1304 return 0
1305
1306 # good version
1307 context.Result(output+" (good)")
1308 return 1
1309
1310 #----------------
1311 # Tktable test
1312
1313 tktable_check_text = r"""
1314 #include <tkTable.h>
1315 #include <stdio.h>
1316 int main(void){
1317 Table mytable;
1318 return 0;
1319 }
1320 """
1321
1322 def CheckTkTable(context):
1323 return CheckExtLib(context,'tktable',tktable_check_text,static=env['STATIC_TCLTK'])
1324
1325 #---------------
1326 # X11 test
1327
1328 x11_check_text = r"""
1329 #include <X11/Xlib.h>
1330 #include <X11/IntrinsicP.h>
1331 #include <X11/Intrinsic.h>
1332 #include <X11/ObjectP.h>
1333 #include <X11/Object.h>
1334 int main(void){
1335 Object mything;
1336 return 0;
1337 }
1338 """
1339
1340 def CheckX11(context):
1341 return CheckExtLib(context,'X11',x11_check_text)
1342
1343 #----------------
1344 # Check that we can raise and catch sigint
1345
1346 sigint_test_text = r"""
1347 #include <signal.h>
1348 #include <setjmp.h>
1349 #include <stdlib.h>
1350 static jmp_buf g_jmpenv;
1351 void sighandler(int sig){
1352 longjmp(g_jmpenv,sig);
1353 }
1354 void testsigint(){
1355 raise(SIGINT);
1356 }
1357 int main(void){
1358 signal(SIGINT,&sighandler);
1359 switch(setjmp(g_jmpenv)){
1360 case 0:
1361 testsigint();
1362 exit(1);
1363 case SIGINT:
1364 exit(0);
1365 default:
1366 exit(2);
1367 }
1368 }
1369 """
1370
1371 def CheckSIGINT(context):
1372 context.Message("Checking SIGINT is catchable... ")
1373 (is_ok,output)=context.TryRun(sigint_test_text,".c")
1374 context.Result(is_ok)
1375 return is_ok
1376
1377 #----------------
1378 # Check that we're able to catch floating point errors
1379
1380 sigfpe_test_text = r"""
1381 #include <signal.h>
1382 #include <setjmp.h>
1383 #include <stdlib.h>
1384 #include <fenv.h>
1385 static jmp_buf g_jmpenv;
1386 void fpehandler(int sig){
1387 longjmp(g_jmpenv,sig);
1388 }
1389 int main(void){
1390 fenv_t myfenv;
1391 fegetenv(&myfenv);
1392 fesetenv(&myfenv);
1393 feenableexcept(FE_ALL_EXCEPT);
1394 signal(SIGFPE,&fpehandler);
1395 double x;
1396 switch(setjmp(g_jmpenv)){
1397 case 0:
1398 x = 1.0 / 0.0;
1399 /* failed to catch */
1400 exit(1);
1401 case SIGFPE:
1402 exit(0);
1403 }
1404 }
1405 """
1406
1407 def CheckFPE(context):
1408 context.Message("Checking C99 FPE behaviour... ")
1409 (is_ok,output) = context.TryRun(sigfpe_test_text,'.c')
1410 context.Result(is_ok)
1411 return is_ok
1412
1413 #----------------
1414 # signal reset needed?
1415
1416 sigreset_test_text = r"""
1417 #include <signal.h>
1418 #include <setjmp.h>
1419 #include <stdlib.h>
1420 #include <stdio.h>
1421 typedef void SigHandlerFn(int);
1422 static jmp_buf g_jmpenv;
1423 void sighandler(int sig){
1424 longjmp(g_jmpenv,sig);
1425 }
1426 void testsigint(){
1427 /* fprintf(stderr,"Raising SIGINT\n"); */
1428 raise(SIGINT);
1429 }
1430 int main(void){
1431 SigHandlerFn *last,*saved;
1432 saved = signal(SIGINT,&sighandler);
1433 if(saved!=SIG_DFL){
1434 fprintf(stderr,"Default handler (%p) was not correctly set\n",SIG_DFL);
1435 exit(3);
1436 }
1437 switch(setjmp(g_jmpenv)){
1438 case 0:
1439 testsigint();
1440 fprintf(stderr,"Back from SIGINT\n");
1441 exit(1);
1442 case SIGINT:
1443 break;
1444 default:
1445 exit(2);
1446 };
1447 last = signal(SIGINT,SIG_DFL);
1448 if(last!=&sighandler){
1449 printf("1");
1450 exit(0);
1451 }
1452 printf("0");
1453 exit(0);
1454 }
1455 """
1456
1457 def CheckSigReset(context):
1458 context.Message("Checking signal handler reset... ")
1459 (is_ok,output) = context.TryRun(sigreset_test_text,'.c')
1460 if not is_ok:
1461 context.Result("ERROR")
1462 return False
1463 if int(output)==1:
1464 context.Result("required");
1465 context.env['ASC_RESETNEEDED'] = True
1466 else:
1467 context.Result("not required");
1468 context.env['ASC_RESETNEEDED'] = False
1469 return is_ok
1470
1471 #----------------
1472 # GCC Version sniffing
1473
1474 # TODO FIXME
1475
1476 gcc_version4 = False
1477
1478 #------------------------------------------------------
1479 # CONFIGURATION
1480
1481 conf = Configure(env
1482 , custom_tests = {
1483 'CheckMath' : CheckMath
1484 , 'CheckSwigVersion' : CheckSwigVersion
1485 , 'CheckPythonLib' : CheckPythonLib
1486 , 'CheckCUnit' : CheckCUnit
1487 , 'CheckDMalloc' : CheckDMalloc
1488 , 'CheckMFGraph' : CheckMFGraph
1489 , 'CheckUFSparse' : CheckUFSparse
1490 , 'CheckTcl' : CheckTcl
1491 , 'CheckTclVersion' : CheckTclVersion
1492 , 'CheckTk' : CheckTk
1493 , 'CheckTkVersion' : CheckTkVersion
1494 , 'CheckGcc' : CheckGcc
1495 , 'CheckGccVisibility' : CheckGccVisibility
1496 , 'CheckYacc' : CheckYacc
1497 , 'CheckLex' : CheckLex
1498 , 'CheckTkTable' : CheckTkTable
1499 , 'CheckX11' : CheckX11
1500 , 'CheckIDA' : CheckIDA
1501 , 'CheckIDAVersion' : CheckIDAVersion
1502 , 'CheckCONOPT' : CheckCONOPT
1503 , 'CheckScrollkeeperConfig' : CheckScrollkeeperConfig
1504 , 'CheckFPE' : CheckFPE
1505 , 'CheckSIGINT' : CheckSIGINT
1506 , 'CheckSigReset' : CheckSigReset
1507 # , 'CheckIsNan' : CheckIsNan
1508 # , 'CheckCppUnitConfig' : CheckCppUnitConfig
1509 }
1510 # , config_h = "config.h"
1511 )
1512
1513 def sconsversioncheck():
1514
1515 # uncomment the following line to skip the version check:
1516 # return 1
1517
1518 import SCons
1519 v = SCons.__version__.split(".")
1520 if v[0] != '0':
1521 return 0
1522 if v[1] != '96':
1523 return 0
1524 micro = int(v[2])
1525 if micro == 92 or micro == 93:
1526 return 1;
1527 return 0
1528
1529 if not sconsversioncheck():
1530 print "Scons version is not OK. Please try version 0.96.92 or 0.96.93,"
1531 print "or consult the developers in the case of newer versions. Modify"
1532 print "the function 'sconsversioncheck' in the file SConstruct if you"
1533 print "want to *force* SCons to continue."
1534 Exit(1)
1535
1536 # stdio -- just to check that compiler is behaving
1537
1538 if not conf.CheckHeader('stdio.h'):
1539 print "CPPPATH =",env.get('CPPPATH')
1540 print "Did not find 'stdio.h'! Check your compiler configuration."
1541 print ""
1542 print "You environment is printed here:"
1543 for k,v in os.environ.iteritems():
1544 print "%-30s%s" % ("%s :" % k, v)
1545 Exit(1)
1546
1547 if not conf.CheckFunc('snprintf'):
1548 print "Didn't find snprintf";
1549 exit(1)
1550
1551 # Math library
1552
1553 conf.env['HAVE_IEEE']=True
1554
1555 if need_libm and not conf.CheckMath():
1556 conf.env['HAVE_IEEE']=False
1557 print 'Did not find math library, exiting!'
1558 Exit(1)
1559
1560 # Where is 'isnan'?
1561
1562 if not conf.CheckFunc('isnan') and not conf.CheckFunc('_isnan'):
1563 print "Didn't find isnan"
1564 # Exit(1)
1565
1566 # GCC visibility
1567
1568 if conf.CheckGcc():
1569 conf.env['HAVE_GCC']=True;
1570 if env['WITH_GCCVISIBILITY'] and conf.CheckGccVisibility():
1571 conf.env['HAVE_GCCVISIBILITY']=True;
1572 conf.env.Append(CCFLAGS=['-fvisibility=hidden'])
1573 conf.env.Append(CPPDEFINES=['HAVE_GCCVISIBILITY'])
1574 conf.env.Append(CCFLAGS=['-Wall'])
1575
1576 # Catching SIGINT
1577
1578 if env['WITH_SIGNALS']:
1579 if not conf.CheckSIGINT():
1580 with_signals = False
1581 without_signals_reason = "SIGINT uncatchable"
1582
1583 # Catching SIGFPE
1584
1585 if conf.CheckFPE():
1586 conf.env['HAVE_C99FPE']=True
1587 else:
1588 conf.env['HAVE_C99FPE']=False
1589
1590 # Checking for signal reset requirement
1591
1592 if not conf.CheckSigReset():
1593 print "Unable to determine if signal reset is required"
1594 Exit(1)
1595
1596 # YACC
1597
1598 if not conf.CheckYacc():
1599 print "YACC NOT FOUND OR NOT WORKING"
1600 else:
1601 conf.env['HAVE_YACC']=True
1602
1603 if not conf.CheckLex():
1604 print "YACC NOT FOUND OR NOT WORKING"
1605 else:
1606 conf.env['HAVE_LEX']=True
1607
1608 # Tcl/Tk
1609
1610 if with_tcltk:
1611 if conf.CheckTcl():
1612 if conf.CheckTclVersion():
1613 if conf.CheckTk():
1614 if with_tcltk and conf.CheckTkVersion():
1615 if env['STATIC_TCLTK']:
1616 if conf.CheckTkTable():
1617 pass
1618 else:
1619 without_tcltk_reason = "TkTable not found"
1620 with_tcltk = False
1621 else:
1622 without_tcltk_reason = "Require Tk version <= 8.4. See 'scons -h'"
1623 with_tcltk = False
1624 else:
1625 without_tcltk_reason = "Tk not found."
1626 with_tcltk = False
1627 else:
1628 without_tcltk_reason = "Require Tcl <= 8.4 Tcl."
1629 with_tcltk = False
1630
1631 else:
1632 without_tcltk_reason = "Tcl not found."
1633 with_tcltk = False
1634
1635 if env['STATIC_TCLTK']:
1636 conf.CheckX11()
1637
1638 # Python... obviously we're already running python, so we just need to
1639 # check that we can link to the python library OK:
1640
1641 if not conf.CheckPythonLib():
1642 without_python_reason = 'libpython2.x not found or not linkable'
1643 with_python = False
1644 env['WITH_PYTHON']=False
1645
1646 # SWIG version
1647
1648 if with_python and not conf.CheckSwigVersion():
1649 without_python_reason = 'SWIG >= 1.3.24 is required'
1650 with_python = False
1651 env['WITH_PYTHON']=False
1652
1653 # CUnit
1654
1655 if with_cunit:
1656 if not conf.CheckCUnit():
1657 without_cunit_reason = 'CUnit not found'
1658 with_cunit = False
1659 #print "CUNIT NOT FOUND, LIBS=",conf.env.get('LIBS')
1660
1661 # DMALLOC
1662
1663 if with_dmalloc:
1664 if not conf.CheckDMalloc():
1665 without_dmalloc_reason = 'dmalloc not found'
1666 with_dmalloc = False
1667
1668 # MFGRAPH
1669
1670 if with_mfgraph:
1671 if not conf.CheckMFGraph():
1672 without_mfgraph_reason = 'mfgraph not found'
1673 with_mfgraph = False
1674 env['WITH_MFGRAPH'] = False
1675
1676 # UFSPARSE
1677
1678 if with_ufsparse:
1679 if not conf.CheckUFSparse():
1680 without_ufsparse_reason = 'mfgraph not found'
1681 with_ufsparse = False
1682 env['WITH_UFSPARSE'] = False
1683
1684 # IDA
1685
1686 if not with_ida:
1687 without_ida_reason = "Not selected (see config option WITH_SOLVERS)"
1688 elif not conf.CheckIDA():
1689 with_ida = False
1690 without_ida_reason = "IDA not found"
1691 elif not conf.CheckIDAVersion():
1692 with_ida = False
1693 without_ida_reason = "Unsupported (or undetected) SUNDIALS version"
1694
1695 # CONOPT
1696
1697 if not with_conopt:
1698 without_conopt_reason = "Not selected (see config option WITH_SOLVERS)"
1699 elif not conf.CheckCONOPT():
1700 with_conopt = False
1701 without_conpt_reason = "CONOPT not found"
1702
1703 # BLAS
1704
1705 need_blas=False
1706
1707 if with_lsode:
1708 need_fortran = True
1709 need_blas=True
1710
1711 if need_blas:
1712 if conf.CheckLib('blas'):
1713 with_local_blas = False
1714 without_local_blas_reason = "Found BLAS installed on system"
1715 else:
1716 with_local_blas = True
1717 need_fortran = True
1718 else:
1719 with_local_blas= False;
1720 without_local_blas_reason = "BLAS not required"
1721
1722 # FORTRAN
1723
1724 if need_fortran:
1725 conf.env.Tool('fortran')
1726 detect_fortran = conf.env.Detect(['g77','f77','gfortran'])
1727 if detect_fortran:
1728 # For some reason, g77 doesn't get detected properly on MinGW
1729 if not env.has_key('F77') and not env.has_key('FORTRAN'):
1730 print "Fixing detection of F77 on MinGW...(?)"
1731 conf.env.Replace(F77=detect_fortran)
1732 conf.env.Replace(F77COM='$F77 $F77FLAGS -c -o $TARGET $SOURCE')
1733 conf.env.Replace(F77FLAGS='')
1734 #print "F77:",conf.env['F77']
1735 #print "F77COM:",conf.env['F77COM']
1736 #print "F77FLAGS:",conf.env['F77FLAGS']
1737 fortran_builder = Builder(
1738 action='$F77COM'
1739 , suffix='.o'
1740 , src_suffix='.f'
1741 )
1742 conf.env.Append(BUILDERS={'Fortran':fortran_builder})
1743 if platform.system()=="Linux":
1744 conf.env.Append(SHFORTRANFLAGS=['-fPIC'])
1745 else:
1746 with_lsode=False;
1747 without_lsode_reason="FORTRAN-77 required but not found"
1748
1749 #else:
1750 # print "FORTRAN not required"
1751
1752 # F2C
1753
1754 if need_fortran:
1755 if platform.system()=="Windows":
1756 conf.env.Append(LIBPATH='c:\mingw\lib')
1757
1758 # scrollkeeper
1759
1760 if with_scrollkeeper:
1761 if not conf.CheckScrollkeeperConfig():
1762 with_scrollkeeper=False
1763 without_scrollkeeper_reason="unable to detect scrollkeeper-config"
1764
1765 # TODO: -D_HPUX_SOURCE is needed
1766
1767 # TODO: check size of void*
1768
1769 # TODO: detect if dynamic libraries are possible or not
1770
1771 if platform.system()=="Windows" and env.has_key('MSVS'):
1772 _found_windows_h = conf.CheckHeader('Windows.h')
1773
1774 if not _found_windows_h:
1775 print "Could not locate 'Windows.h' in CPPPATH. Check your configuration."
1776 Exit(1)
1777
1778 if with_python and not conf.CheckHeader(['basetsd.h','BaseTsd.h']):
1779 with_python = 0;
1780 without_python_reason = "Header file 'basetsd.h' not found. Install the MS Platform SDK."
1781
1782 conf.env.Append(CPPDEFINES=env['PACKAGE_LINKING'])
1783
1784 conf.Finish()
1785
1786 #---------------------------------------
1787 # SUBSTITUTION DICTIONARY for .in files
1788
1789 release = env.get('RELEASE')
1790 if release=="0.":
1791 release="0"
1792
1793 #print "SUBSTITUTED CONOPT_LIBPATH:",c_escape(env.subst("$CONOPT_LIBPATH"))
1794
1795 subst_dict = {
1796 '@DEFAULT_ASCENDLIBRARY@':env['DEFAULT_ASCENDLIBRARY']
1797 , '@GLADE_FILE@':'ascend.glade'
1798 , '@HELP_ROOT@':''
1799 , '@ICON_EXTENSION@':icon_extension
1800 , '@INSTALL_ASCDATA@':env['INSTALL_ASCDATA']
1801 , '@INSTALL_BIN@':env['INSTALL_BIN']
1802 , '@INSTALL_INCLUDE@':env['INSTALL_INCLUDE']
1803 , '@INSTALL_LIB@':env['INSTALL_LIB']
1804 , '@INSTALL_MODELS@':env['INSTALL_MODELS']
1805 , '@PYGTK_ASSETS@':env['PYGTK_ASSETS']
1806 , '@VERSION@':version
1807 , '@RELEASE@':release
1808 , '@DISTTAR_NAME@':env['DISTTAR_NAME']
1809 , '@WEBHELPROOT@':'http://pye.dyndns.org/ascend/manual/'
1810 , '@SHLIBSUFFIX@':env['SHLIBSUFFIX']
1811 , '@SHLIBPREFIX@':env['SHLIBPREFIX']
1812 , '@ASC_ENV_TK_DEFAULT@' : '$$ASCENDDIST/tcltk'
1813 , '@ASC_DISTDIR_REL_BIN@' : default_rel_distdir
1814 , '@PYTHON@' : python_exe
1815 , '@ASC_CONOPT_LIB@':env.get('CONOPT_LIB')
1816 , '@ASC_CONOPT_ENVVAR@':env.get('CONOPT_ENVVAR')
1817 , '@ASC_CONOPT_DLPATH@':c_escape(env.subst("$CONOPT_LIBPATH"))
1818 , '@SOURCE_ROOT@':c_escape(os.path.abspath(str(env.Dir("#"))))
1819 }
1820
1821 if env.get('WITH_LOCAL_HELP'):
1822 print "WITH_LOCAL_HELP:",env['WITH_LOCAL_HELP']
1823 subst_dict['@HELP_ROOT@']=env['WITH_LOCAL_HELP']
1824
1825 # bool options...
1826 for k,v in {
1827 'ASC_WITH_IDA':with_ida
1828 ,'ASC_WITH_DMALLOC':with_dmalloc
1829 ,'ASC_WITH_MFGRAPH':with_mfgraph
1830 ,'ASC_WITH_UFSPARSE':with_ufsparse
1831 ,'ASC_WITH_CONOPT':with_conopt
1832 ,'ASC_WITH_LSODE':with_lsode
1833 ,'ASC_WITH_MMIO':with_mmio
1834 ,'ASC_SIGNAL_TRAPS':with_signals
1835 ,'ASC_RESETNEEDED':env.get('ASC_RESETNEEDED')
1836 ,'HAVE_C99FPE':env.get('HAVE_C99FPE')
1837 ,'HAVE_IEEE':env.get('HAVE_IEEE')
1838 ,'ASC_ABSOLUTE_PATHS':env.get('ASC_ABSOLUTE_PATHS')
1839 ,'ASC_XTERM_COLORS':env.get('WITH_XTERM_COLORS')
1840 ,'MALLOC_DEBUG':env.get('MALLOC_DEBUG')
1841 }.iteritems():
1842
1843 if v: subst_dict["/\\* #define %s @%s@ \\*/" % (k,k)]='# define %s 1 ' % k
1844
1845 if with_python:
1846 subst_dict['@ASCXX_USE_PYTHON@']="1"
1847 env['WITH_PYTHON']=1;
1848
1849 if env.has_key('HAVE_GCCVISIBILITY'):
1850 subst_dict['@HAVE_GCCVISIBILITY@'] = "1"
1851
1852 env.Append(SUBST_DICT=subst_dict)
1853
1854 #for k,v in subst_dict.iteritems():
1855 # print "%-50s%s" % ("'%s'"%k,v)
1856
1857 # REMOVED: long command-line support on Win2k
1858
1859 #------------------------------------------------------
1860 # RECIPE: SWIG scanner
1861
1862 import SCons.Script
1863
1864 SWIGScanner = SCons.Scanner.ClassicCPP(
1865 "SWIGScan"
1866 , ".i"
1867 , "CPPPATH"
1868 , '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'
1869 )
1870
1871 env.Append(SCANNERS=[SWIGScanner])
1872
1873 #------------------------------------------------------
1874 # RECIPE: 'SubstInFile', used in pygtk SConscript
1875
1876 import re
1877 from SCons.Script import * # the usual scons stuff you get in a SConscript
1878
1879 def TOOL_SUBST(env):
1880 """Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
1881 from the source to the target.
1882 The values of SUBST_DICT first have any construction variables expanded
1883 (its keys are not expanded).
1884 If a value of SUBST_DICT is a python callable function, it is called and
1885 the result is expanded as the value.
1886 If there's more than one source and more than one target, each target gets
1887 substituted from the corresponding source.
1888 """
1889 env.Append(TOOLS = 'SUBST')
1890 def do_subst_in_file(targetfile, sourcefile, dict):
1891 """Replace all instances of the keys of dict with their values.
1892 For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
1893 then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
1894 """
1895 try:
1896 f = open(sourcefile, 'rb')
1897 contents = f.read()
1898 f.close()
1899 except:
1900 raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile
1901 for (k,v) in dict.items():
1902 try:
1903 #print "%s ---> %s" % (k,v)
1904 contents = re.sub(k, v, contents)
1905 except Exception,e:
1906 sys.stderr.write("Failed to substute '%s' with '%s': %s\n" % (k,v,e))
1907
1908 try:
1909 f = open(targetfile, 'wb')
1910 f.write(contents)
1911 f.close()
1912 except:
1913 raise SCons.Errors.UserError, "Can't write target file %s"%targetfile
1914 return 0 # success
1915
1916 def subst_in_file(target, source, env):
1917 if not env.has_key('SUBST_DICT'):
1918 raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set."
1919 d = dict(env['SUBST_DICT']) # copy it
1920 for (k,v) in d.items():
1921 if callable(v):
1922 d[k] = env.subst(v())
1923 elif SCons.Util.is_String(v):
1924 d[k]=env.subst(v)
1925 else:
1926 raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v))
1927 for (t,s) in zip(target, source):
1928 return do_subst_in_file(str(t), str(s), d)
1929
1930 def subst_in_file_string(target, source, env):
1931 """This is what gets printed on the console."""
1932 return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t))
1933 for (t,s) in zip(target, source)])
1934
1935 def subst_emitter(target, source, env):
1936 """Add dependency from substituted SUBST_DICT to target.
1937 Returns original target, source tuple unchanged.
1938 """
1939 d = env['SUBST_DICT'].copy() # copy it
1940 for (k,v) in d.items():
1941 if callable(v):
1942 d[k] = env.subst(v())
1943 elif SCons.Util.is_String(v):
1944 d[k]=env.subst(v)
1945 Depends(target, SCons.Node.Python.Value(d))
1946 return target, source
1947
1948 subst_action=SCons.Action.Action(subst_in_file, subst_in_file_string)
1949 env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
1950
1951 TOOL_SUBST(env)
1952
1953 #------------------------------------------------------
1954 # Recipe for 'CHMOD' ACTION
1955
1956 import SCons
1957 from SCons.Script.SConscript import SConsEnvironment
1958 SConsEnvironment.Chmod = SCons.Action.ActionFactory(os.chmod,
1959 lambda dest, mode: 'Chmod("%s", 0%o)' % (dest, mode))
1960
1961 def InstallPerm(env, dest, files, perm):
1962 obj = env.Install(dest, files)
1963 for i in obj:
1964 env.AddPostAction(i, env.Chmod(str(i), perm))
1965
1966 SConsEnvironment.InstallPerm = InstallPerm
1967
1968 # define wrappers
1969 SConsEnvironment.InstallProgram = lambda env, dest, files: InstallPerm(env, dest, files, 0755)
1970 SConsEnvironment.InstallHeader = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1971 SConsEnvironment.InstallShared = lambda env, dest, files: InstallPerm(env, dest, files, 0644)
1972
1973 #------------------------------------------------------
1974 # BUILD...
1975
1976 # so that #include <modulename/headername.h> works across all modules...
1977 env.AppendUnique(CPPPATH=['#base/generic'])
1978
1979 if env['DEBUG']:
1980 env.Append(CCFLAGS=['-g'])
1981
1982 if env['GCOV']:
1983 env.Append(
1984 CPPFLAGS=['-g','-fprofile-arcs','-ftest-coverage']
1985 , LIBS=['gcov']
1986 , LINKFLAGS=['-fprofile-arcs','-ftest-coverage']
1987 )
1988
1989 if with_ida:
1990 env.Append(WITH_IDA=1)
1991
1992 if with_conopt:
1993 env.Append(WITH_CONOPT=1)
1994
1995 #-------------
1996 # TCL/TK GUI
1997
1998 if with_tcltk:
1999 env.SConscript(['tcltk/generic/interface/SConscript'],'env')
2000 else:
2001 print "Skipping... Tcl/Tk bindings aren't being built:",without_tcltk_reason
2002
2003 #-------------
2004 # PYTHON INTERFACE
2005
2006 if with_python:
2007 env.SConscript(['pygtk/SConscript'],'env')
2008 else:
2009 print "Skipping... Python bindings aren't being built:",without_python_reason
2010
2011 #------------
2012 # BASE/GENERIC SUBDIRECTORIES
2013
2014 libascend_env = env.Copy()
2015
2016 dirs = ['general','utilities','compiler','system','solver','integrator','packages','linear']
2017
2018 srcs = []
2019 for d in dirs:
2020 heresrcs = libascend_env.SConscript('base/generic/'+d+'/SConscript','libascend_env')
2021 srcs += heresrcs
2022
2023 #-------------
2024 # IMPORTED CODE: LSODE, BLAS, etc
2025
2026 if with_lsode:
2027 srcs += env.SConscript(['lsod/SConscript'],'env')
2028 srcs += env.SConscript(['linpack/SConscript'],'env')
2029 else:
2030 print "Skipping... LSODE won't be built:", without_lsode_reason
2031
2032 if with_local_blas:
2033 srcs += env.SConscript(['blas/SConscript'],'env')
2034 else:
2035 print "Skipping... BLAS won't be built:", without_local_blas_reason
2036
2037 if not with_ida:
2038 print "Skipping... IDA won't be built:", without_ida_reason
2039
2040 if with_mmio:
2041 srcs += env.SConscript(['mmio/SConscript'],'env')
2042 else:
2043 print "Skipping... MMIO export won't be built:", without_mmio_reason
2044 #-------------
2045 # LIBASCEND -- all base/generic functionality
2046
2047 if with_dmalloc:
2048 libascend_env.Append(LIBS=['dmalloc'])
2049
2050 if with_ufsparse:
2051 libascend_env.Append(LIBS=['cxsparse'])
2052
2053 libascend = libascend_env.SharedLibrary('ascend',srcs)
2054
2055 env.Alias('libascend',libascend)
2056
2057 #-------------
2058 # UNIT TESTS (C CODE)
2059
2060 if with_cunit:
2061 testdirs = ['general','solver','utilities','linear']
2062 testsrcs = []
2063 for testdir in testdirs:
2064 path = 'base/generic/'+testdir+'/test/'
2065 env.SConscript([path+'SConscript'],'env')
2066 testsrcs += [i.path for i in env['TESTSRCS_'+testdir.upper()]]
2067
2068 #print "TESTSRCS =",testsrcs
2069
2070 env.SConscript(['test/SConscript'],'env')
2071 env.SConscript(['base/generic/test/SConscript'],'env')
2072
2073 env.Alias('test',[env.Dir('test'),env.Dir('base/generic/test')])
2074
2075 else:
2076 print "Skipping... CUnit tests aren't being built:",without_cunit_reason
2077
2078 #-------------
2079 # EXTERNAL FUNCTIONS
2080
2081 env['extfns']=[]
2082 modeldirs = env.SConscript(['models/SConscript'],'env')
2083
2084 if not with_extfns:
2085 print "Skipping... External modules aren't being built:",without_extfns_reason
2086
2087 env.Alias('extfns',env['extfns'])
2088
2089 #------------------------------------------------------
2090 # CREATE ASCEND-CONFIG scriptlet
2091
2092 ascendconfig = env.SubstInFile('ascend-config.in')
2093
2094 #------------------------------------------------------
2095 # INSTALLATION
2096
2097 if env.get('CAN_INSTALL'):
2098
2099 dirs = ['INSTALL_BIN','INSTALL_ASCDATA','INSTALL_LIB', 'INSTALL_INCLUDE']
2100 install_dirs = [env.Entry(env['INSTALL_ROOT']+env[d]) for d in dirs]
2101 install_dirs += modeldirs
2102
2103 # TODO: add install options
2104 env.Alias('install',install_dirs)
2105
2106 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_LIB'],libascend)
2107
2108 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendconfig)
2109
2110 #------------------------------------------------------
2111 # WINDOWS INSTALLER
2112 # For the windows installer, please see pygtk/SConscript
2113
2114 if with_installer:
2115 pass
2116 else:
2117 print "Skipping... Windows installer isn't being built:",without_installer_reason
2118
2119 #------------------------------------------------------
2120 # PROJECT FILE for MSVC
2121
2122 env.SConscript(['base/msvc/SConscript'],['env','libascend']);
2123
2124 #------------------------------------------------------
2125 # CREATE the SPEC file for generation of RPM packages
2126
2127 if platform.system()=="Linux":
2128 env.SubstInFile('ascend.spec.in')
2129
2130 #------------------------------------------------------
2131 # CREATE OMF FILE FOR USE WITH SCROLLKEEPER
2132
2133 if with_scrollkeeper:
2134 env.SubstInFile('#/pygtk/gnome/ascend.omf.in')
2135 env.InstallShared(env['INSTALL_ROOT']+env['OMFDIR'],"#/pygtk/gnome/ascend.omf")
2136
2137 #------------------------------------------------------
2138 # DISTRIBUTION TAR FILE
2139
2140 env['DISTTAR_FORMAT']='bz2'
2141 env.Append(
2142 DISTTAR_EXCLUDEEXTS=['.o','.os','.so','.a','.dll','.cc','.cache','.pyc','.cvsignore','.dblite','.log','.pl','.out']
2143 , DISTTAR_EXCLUDEDIRS=['CVS','.svn','.sconf_temp', 'dist']
2144 )
2145
2146 tar = env.DistTar("dist/"+env['DISTTAR_NAME']
2147 , [env.Dir('#')]
2148 )
2149
2150 env.Depends(tar,'ascend.spec')
2151
2152 Alias('dist',tar)
2153
2154 #------------------------------------------------------
2155 # USER'S MANUAL
2156
2157 env.SConscript('doc/SConscript',['env'])
2158
2159 #------------------------------------------------------
2160 # LIBASCEND DOXYGEN DOCUMENTATION
2161
2162 env.SConscript('base/doc/SConscript',['env'])
2163
2164 #------------------------------------------------------
2165 # RPM BUILD
2166
2167 # for RPM builds, 'scons dist' then 'rpmbuild -ta dist/ascend-*.tar.bz2'
2168 # (check * for the version number used to create the tarball)
2169
2170 #------------------------------------------------------
2171 # DEFAULT TARGETS
2172
2173 default_targets =['libascend']
2174 if with_tcltk:
2175 default_targets.append('tcltk')
2176 if with_python:
2177 default_targets.append('pygtk')
2178 if with_installer:
2179 default_targets.append('installer')
2180 if with_extfns:
2181 default_targets.append('extfns')
2182
2183 env.Default(default_targets)
2184
2185 print "Building targets:"," ".join([str(i) for i in BUILD_TARGETS])
2186
2187 # vim: set syntax=python:
2188

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