/[ascend]/trunk/SConstruct
ViewVC logotype

Contents of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


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

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