/[ascend]/trunk/jam/Jamrules.in
ViewVC logotype

Annotation of /trunk/jam/Jamrules.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 129 - (hide annotations) (download)
Tue Dec 20 20:22:56 2005 UTC (17 years, 11 months ago) by jds
File size: 18602 byte(s)
Reworked jam build system:
- integrated Jamrules.in and Jamrules_tcltk98.in with autoconf
- now support single-point building from trunk/jam
- old jam files still in place but deprecated
- may be buggy, please report back bugs for fixing

Compiled on both Windows and Linux.
1 jds 129 #
2     # General Jamrules support file for building Ascend4
3     # (see http://www.freetype.org/jam/index.html)
4     #
5     # This file is part of the Ascend Build System.
6     #
7     # Copyright (C) 2005 Jerry D. St.Clair
8     #
9     # The Ascend Build System is free software; you can redistribute
10     # it and/or modify it under the terms of the GNU General Public
11     # License as published by the Free Software Foundation; either
12     # version 2 of the License, or (at your option) any later version.
13     #
14     # This program is distributed in hope that it will be useful,
15     # but WITHOUT ANY WARRANTY; without even the implied warranty of
16     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17     # GNU General Public License for more details.
18     #
19     # You should have received a copy of the GNU General Public License
20     # along with the program; if not, write to the Free Software
21     # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA.
22     # Check the file named COPYING.
23     #---------------------------------------------------------------------------
24     #
25     # UNDER CONSTRUCTION
26     #
27     # This is a template Jamrules file which supports building the
28     # Ascend libraries and executables. It contains general variable
29     # and rule definitions required for execution of jam in any of the
30     # source subdirectories.
31     #
32     # This file is part of the ASCEND jam build system rooted at ../../jam.
33     # See ../../jam/ReadMe.txt for more information.
34     #
35     # This file is customized on unix/linux by configure.
36     #
37     # On other platforms, users should copy/rename this file to 'Jamrules',
38     # then modify the settings manually for their particular system.
39     # Ascend cannot be built by jam unless the Jamrules file is present.
40     #
41     # User-customized Jamrules files should not be placed in version
42     # control. Only the Jamrules.in template should be versioned.
43     #
44     #---------------------------------------------------------------------------
45    
46     JAMRULES_ALREADY_SEEN = TRUE ;
47    
48     # The slash thing gets messed up sith SubDir somehow - make sure it's correct!
49     SLASH = / ;
50     if $(NT)
51     {
52     SLASH = \\ ;
53     }
54    
55     # Comment to compile with debugging & assertions enabled.
56     # Should be commented for regression tests to work properly.
57     #NODEBUG = 1 ;
58    
59     # Comment to compile without using the Epperly malloc debugger
60     # Should be UNcommented for regression tests to work properly.
61     DEBUG_MALLOC = -DMALLOC_DEBUG -DALLOCATED_TESTS ;
62    
63     #======================================================================
64     # PACKAGES
65     #
66     # Package settings for building Ascend.
67     # Packages are bits of compiled code that represent models, or solvers,
68     # or, in general, any bits of external code.
69     #
70     # Choose one of the following, comment out the others:
71     # STATIC_PACKAGES packages should be statically linked/loaded
72     # DYNAMIC_PACKAGES packages should be dynamically linked/loaded
73     # NO_PACKAGES no packages
74     #
75     # If STATIC_PACKAGES are chosen, also indicate the location of
76     # the packages in PACK_LIBS. Otherwise leave PACK_LIBS empty.
77     #======================================================================
78     #PACKAGE_FLAGS = -DSTATIC_PACKAGES ;
79     PACKAGE_FLAGS = -DDYNAMIC_PACKAGES ;
80     #PACKAGE_FLAGS = -DNO_PACKAGES ;
81    
82     PACK_LIBS = $(ASC_PACKAGES_LIB_PATH) ;
83     #PACK_LIBS = ;
84    
85     #======================================================================
86     # SIGNAL TRAPS
87     #
88     # If you want to be able to interrupt ASCEND with ctrl-C, then comment the
89     # following line. Uncomment the line for disabling of ctrl-C.
90     #
91     # Comment the line for regression testing to work properly.
92     #======================================================================
93     #CCFLAGS += -DNO_SIGINT_TRAP -DNO_SIGSEGV_TRAP ;
94    
95     #---------------------------------------------------------------------------
96    
97     # Tools required for complete build (comment out if not present).
98     # The build system works around their absence if necessary.
99     # Note that they are available for Windows, for example:
100     # http://sourceforge.net/projects/gnuWin32
101     SED = sed ;
102     YACC = yacc ;
103     YACCFLAGS = -d ;
104     YACCFILES = y.tab ;
105     LEX = flex ;
106    
107     #======================================================================
108     # General build options
109     #======================================================================
110     # Build directory - - will be qualified for compiler & build type
111     BUILD_DIR_ROOT = $(TOP)$(SLASH)jam ;
112    
113     # Comment for normal jam deletion of object files after building targets
114     KEEPOBJS = true ;
115    
116     #---------------------------------------------------------------------------
117     # platform-independent options
118     #---------------------------------------------------------------------------
119     # sizeof(void*) - change value if not a typical 32-bit system
120     SIZEOF_VOIDPTR = 4 ;
121     CCFLAGS += $(PACKAGE_FLAGS) -DSIZEOF_VOID_P=$(SIZEOF_VOIDPTR) ;
122    
123     if $(NODEBUG)
124     {
125     CCFLAGS += -DNDEBUG ;
126     BUILD_SUBDIR = $(SLASH)Release ;
127     }
128     else
129     {
130     BUILD_SUBDIR = $(SLASH)Debug ;
131     }
132    
133     #---------------------------------------------------------------------------
134     # platform- & complier-specific options
135     #---------------------------------------------------------------------------
136     if $(NT)
137     {
138     # Windows-specific commands not done right in Jambase
139     RM = del ;
140     MV = move /Y ;
141    
142     # Windows-specific defines
143     CCFLAGS += -D_X86_=1 -DWIN32 -D_WIN32 -DASC_BUILD_LIB ;
144     SUFSHR = .dll ;
145    
146     if $(BCCROOT) || ( $(TOOLSET) = BORLANDC )
147     {
148     CC = bcc32 ;
149     C++ = $(CC) ;
150     FORTRAN = ;
151     CCFLAGS += -q -d -g0 -j0 -K -DMOD_ASCMALLOC ;
152     CCWARN = -w ;
153     if $(NODEBUG)
154     {
155     CCDEBUG = -v- -O2 ;
156     }
157     else
158     {
159     CCDEBUG = -v -y -Od ;
160     }
161     C++FLAGS = $(CCFLAGS) ;
162     LINKFLAGS += -L$(STDLIBPATH) ;
163     COFF2OMF = coff2omf ; # add location if not in path
164     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ;
165     }
166    
167     else if $(MSVCNT) || ( $(TOOLSET) = VISUALC )
168     {
169     CC = cl /nologo ;
170     C++ = $(CC) ;
171     FORTRAN = ;
172     CCFLAGS += /Ze ;
173     CCWARN = /W4 ;
174     if $(NODEBUG)
175     {
176     CCDEBUG = /O2 ;
177     }
178     else
179     {
180     CCDEBUG = /Zi /Od ;
181     }
182     # Libraries are in different paths depending on VC version
183     LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ;
184     LINKLIBS = advapi32.lib
185     libc.lib
186     oldnames.lib
187     gdi32.lib
188     user32.lib
189     kernel32.lib ;
190     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ;
191     }
192    
193     else if $(MINGW) || ( $(TOOLSET) = MINGW )
194     {
195     CC = gcc ;
196     C++ = $(CC) ;
197    
198     CCFLAGS += -DHAVE_ERF=1 ;
199     # uncomment to select desired warning level and ansi-strictness
200     CCWARN += -Wall ;
201     CCWARN += -W ;
202     CCWARN += -pedantic ;
203     #CCWARN += -Wshadow ;
204     #CCWARN += -ansi ;
205     CCWARN += -std=c99 ;
206    
207     if $(NODEBUG)
208     {
209     CCDEBUG = -O3 ;
210     }
211     else
212     {
213     CCDEBUG = -g -O0 ;
214     CCFLAGS += -ggdb ;
215     }
216     C++FLAGS = $(CCFLAGS) ;
217    
218     FORTRAN = g77 ;
219     FORTRANFLAGS = -c -I4 -O ;
220     F77_LIBS = $(MINGW)$(SLASH)lib$(SLASH)libg2c.a ;
221    
222     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ;
223     }
224    
225     else if $(WATCOM) || ( $(TOOLSET) = WATCOM )
226     {
227     CC = wcc386 ;
228     C++ = wpp386 ;
229     FORTRAN = wfc386 ;
230     FORTRANFLAGS = /NOER ;
231     CCFLAGS += /fr /dMOD_ASCMALLOC ;
232     CCWARN = /wx ;
233     if $(NODEBUG)
234     {
235     CCDEBUG = /ox ;
236     FORTRANFLAGS += /OX ;
237     }
238     else
239     {
240     CCDEBUG = /od /d2 ;
241     FORTRANFLAGS += /OD /D2 ;
242     }
243     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ;
244     }
245     }
246    
247     else if $(UNIX) || $(OS) = LINUX
248     {
249     SUFSHR = @SHLIB_SUFFIX@ ;
250     CC = @CC@ ;
251     CPP = @CPP@ ;
252    
253     # DEFS = defines generated by configure
254     CCFLAGS += @DEFS@ ;
255     if $(CC) = gcc {
256    
257     if $(NODEBUG)
258     {
259     CCDEBUG = -O3 ;
260     }
261     else
262     {
263     CCDEBUG = -g -O0 ;
264     Echo "DEBUGGER SYMBOLS TURNED ON" ;
265     CCFLAGS += -ggdb ;
266     }
267    
268     # uncomment to select desired warning level and ansi-strictness
269     CCWARN += -Wall ;
270     CCWARN += -W ;
271     CCWARN += -pedantic ;
272     #CCWARN += -Wshadow ;
273     #CCWARN += -ansi ;
274     CCWARN += -std=c99 ;
275     }
276    
277     # YACC
278     # On some old systems yacc writes some K&R extern definitions to
279     # the .c file that it generates. This has caused havoc on at least
280     # one system. Define your yacc here. For the Suns in particular
281     # /usr/lang/SC1.0/ansi/yacc was required. If you cannot find an ansi
282     # compatible yacc, delete the 'extern char *malloc(), realloc() definitions
283     # if generated at the top of your .c created from the .y file.
284     #
285     YACC = @YACC@ ;
286    
287     # LEX
288     # We require the flex lexer
289     #
290     LEX = @LEX@ ;
291     LEXLIB = @LEXLIB@ ;
292    
293     # Some compilers need to be told where to find the math libraries
294     # -L$(MATH_LIB_DIRS) -lieee -lm ;
295     MATH_LIBS = @MATH_LIBS@ ;
296    
297     # The interface and 1 file in the solver directory need to know where the
298     # include files and library for X11 are. If your C compiler doesn't know
299     # automatically where the X files are, or if they are in a non-standard
300     # place, set the following variables to point at them. These should be
301     # the same X files that Tk was built with on your system.
302     # Most systems do not need these variables to be set.
303     #
304     # The include and library files for X11:
305     X11_INCS = @X11_INCLUDES@ ;
306     X11_LIBS = @X11_LIBRARIES@ -lX11 @X11_EXTRA_LIBS@ @X11_RUN_PATH@ ;
307    
308     # Library file(s) to link against for dynamic loading to work
309     DL_LIBS = @DL_LIBS@ ;
310    
311     # FORTRAN options
312     # your f77 compiler
313     FORTRAN = @F77@ ;
314    
315     # Fortran compilation flags:
316     # These are used for making the ASCEND libraries based on FORTRAN codes.
317     # These should be set to get the best performance possible out of your
318     # f77 compiler without optimizing away functions that are not obviously
319     # called, as some compilers do by default.
320     #
321     F77FLAGS = -c -I4 -O ;
322     #
323     # F77LIBS is for the base f77 libraries. If you are linking no f77
324     # objects to ascend, it may be left undefined.
325     # Set F77LIBS appropriate for your machine and desired loader behavior.
326     # -L$(FOR_LIB_DIRS) -lg2c ;
327     #
328     F77_LIBS += @F77LIBS@ ;
329     #
330     # F77_OPTS are for miscellaneous options, such as -tmpdir=
331     #
332     F77_OPTS = ;
333     #
334     # All the flags to pass to F77
335     #
336     FORTRANFLAGS = $(F77FLAGS) $(F77_OPTS) ;
337    
338     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ;
339     }
340    
341     CCFLAGS += $(CCWARN) $(CCDEBUG) $(DEBUG_MALLOC) ;
342     C++FLAGS = $(CCFLAGS) ;
343     BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ;
344    
345     #======================================================================
346     # Ascend base library names & paths
347     #======================================================================
348     ASC_COMPILER_LIBROOT = libasc_compiler ;
349     ASC_GENERAL_LIBROOT = libasc_general ;
350     ASC_SOLVER_LIBROOT = libasc_solver ;
351     ASC_UTILITIES_LIBROOT = libasc_utilities ;
352     ASC_PACKAGES_LIBROOT = libasc_packages ;
353    
354     ASC_COMPILER_LIB = $(ASC_COMPILER_LIBROOT)$(SUFLIB) ;
355     ASC_GENERAL_LIB = $(ASC_GENERAL_LIBROOT)$(SUFLIB) ;
356     ASC_SOLVER_LIB = $(ASC_SOLVER_LIBROOT)$(SUFLIB) ;
357     ASC_UTILITIES_LIB = $(ASC_UTILITIES_LIBROOT)$(SUFLIB) ;
358     ASC_PACKAGES_LIB = $(ASC_PACKAGES_LIBROOT)$(SUFLIB) ;
359    
360     ASC_BASE_LIBS =
361     $(ASC_COMPILER_LIB)
362     $(ASC_GENERAL_LIB)
363     $(ASC_PACKAGES_LIB)
364     $(ASC_SOLVER_LIB)
365     $(ASC_UTILITIES_LIB)
366     ;
367    
368     # Path to base library sources & libs from top-level jam directory
369     ASC_BASE_SOURCE_RELPATH = $(TOP)$(SLASH)base$(SLASH)generic ;
370     ASC_BASE_LIBS_RELPATH = $(BUILD_DIR)$(SLASH) ;
371    
372     #======================================================================
373     # SOLVERS / INTEGRATORS
374     #
375     # If you are linking to MINOS or other external solvers, the solver
376     # interface needs to know about it.
377     # Set the comment flags as appropriate on the following definitions.
378     # If the settings here do not match the libraries you link, you will
379     # almost certainly get runtime errors if not link errors.
380     #======================================================================
381    
382     #------------------------------------------------------------------------------
383     # Slv is the original ASCEND nonlinear solver. It is not currently supported.
384     # To build with slv:
385     # - add -DSTATIC_SLV or -DDYNAMIC_SLV (unsupported) to SOLVER_DEFS
386     #
387     #SOLVER_DEFS += -DSTATIC_SLV ;
388    
389     #------------------------------------------------------------------------------
390     # OptSQP is an interface to the Larry Biegler OPT code.
391     # It is not currently supported.
392     # To build with optsqp:
393     # - add -DSTATIC_OPTSQP or -DDYNAMIC_OPTSQP (unsupported) to SOLVER_DEFS
394     # - add location of OPT library to FOR_LIBS
395     #
396     if $(UNIX) || $(OS) = LINUX
397     {
398     # SOLVER_DEFS += @HAVE_OPTSQP@ ;
399     # FOR_LIBS += @OPTSQPLIB@ ;
400     }
401     else
402     {
403     #SOLVER_DEFS += -DSTATIC_OPTSQP ;
404     #FOR_LIBS += ;
405     }
406    
407     #------------------------------------------------------------------------------
408     # QRSlv is the current ASCEND nonlinear algebraic solver.
409     # To build with slv:
410     # - add -DSTATIC_SLV or -DDYNAMIC_SLV (unsupported) to SOLVER_DEFS
411     #
412     SOLVER_DEFS += -DSTATIC_QRSLV ;
413    
414     #------------------------------------------------------------------------------
415     # makeMPS is currently not supported.
416     # To build with mps:
417     # - add -DSTATIC_MPS or -DDYNAMIC_MPS (unsupported) to SOLVER_DEFS
418     #
419     #SOLVER_DEFS += -DSTATIC_MPS ;
420    
421     #------------------------------------------------------------------------------
422     # NGSlv is an experimental solver (Ken Tyner) that is not currently supported
423     # To build with NGSlv:
424     # - add -DSTATIC_NGSLV or -DDYNAMIC_NGSLV (unsupported) to SOLVER_DEFS
425     #
426     #SOLVER_DEFS += -DSTATIC_NGSLV ;
427    
428     #------------------------------------------------------------------------------
429     # CMSlv is the ASCEND conditional modeling solver (requires CONOPT).
430     # To build with cmslv:
431     # - add -DSTATIC_CMSLV or -DDYNAMIC_CMSLV (unsupported) to SOLVER_DEFS
432     #
433     #SOLVER_DEFS += -DSTATIC_CMSLV ;
434    
435     #------------------------------------------------------------------------------
436     # LRSlv is the ASCEND logical relation solver.
437     # To build with lrslv:
438     # - add -DSTATIC_LRSLV or -DDYNAMIC_LRSLV (unsupported) to SOLVER_DEFS
439     #
440     #SOLVER_DEFS += -DSTATIC_LRSLV ;
441    
442     #------------------------------------------------------------------------------
443     # MINOS is an interface to the MINOS solver. It is not currently functional.
444     # To build with minos:
445     # - add -DSTATIC_MINOS or -DDYNAMIC_MINOS (unsupported) to SOLVER_DEFS
446     # - add location of MINOS library to FOR_LIBS
447     if $(UNIX) || $(OS) = LINUX
448     {
449     # SOLVER_DEFS += @HAVE_MINOS@ ;
450     # FOR_LIBS += @MINOSLIB@ ;
451     }
452     else
453     {
454     #SOLVER_DEFS += -DSTATIC_MINOS ;
455     #FOR_LIBS += ;
456     }
457    
458     #------------------------------------------------------------------------------
459     # CONOPT is an interface to the proprietary CONOPT solver.
460     # To build with conopt:
461     # - add -DSTATIC_CONOPT or -DDYNAMIC_CONOPT (unsupported) to SOLVER_DEFS
462     # - add location of CONOPT library to FOR_LIBS
463     if $(UNIX) || $(OS) = LINUX
464     {
465     # SOLVER_DEFS += @HAVE_CONOPT@ ;
466     # FOR_LIBS += @CONOPTLIB@ ;
467     }
468     else
469     {
470     #SOLVER_DEFS += -DSTATIC_CONOPT ;
471     #FOR_LIBS += ;
472     }
473    
474     #------------------------------------------------------------------------------
475     # LSODE is an ODE solver. ASCEND is distributed with a standard lsode
476     # implementation that can be used if you have FORTRAN and don't have an
477     # optimized LSODE library.
478     # To build with lsode:
479     # - add -DSTATIC_LSOD or -DDYNAMIC_LSOD to SOLVER_DEFS
480     # - if you are providing an optimized lsode library:
481     # - add the location of the library to FOR_LIBS
482     # - set BUILD_LSODE = FALSE to disable building of the standard lsode
483     #
484     if $(UNIX) || $(OS) = LINUX
485     {
486     SOLVER_DEFS += @HAVE_LSOD@ ;
487     if ! @make_lsodlib@
488     {
489     BUILD_LSODE = FALSE ;
490     FOR_LIBS += @LSODLIB@ ;
491     }
492     }
493     else
494     {
495     SOLVER_DEFS += -DSTATIC_LSOD ;
496     FOR_LIBS += ;
497     # uncomment the following if you are providing an external lsode library
498     # BUILD_LSODE = FALSE ;
499     }
500     BUILD_LSODE ?= TRUE ;
501    
502     #======================================================================
503     # FORTRAN options - set to override configure defaults
504     #======================================================================
505     # Your FORTRAN compiler
506     #FORTRAN = g77 ;
507    
508     # Fortran compilation flags & options:
509     # These are used for making the ASCEND libraries based on FORTRAN codes.
510     # These should be set to get the best performance possible out of your
511     # f77 compiler without optimizing away functions that are not obviously
512     # called, as some compilers do by default.
513     #
514     #FORTRANFLAGS = -c -I4 -O -lg2c ;
515    
516     # F77LIBS is for the base f77 libraries. If you are linking no f77
517     # objects to ascend, it may be left undefined.
518     # Set F77LIBS appropriate for your machine and desired loader behavior.
519     #
520     #F77_LIBS = ;
521    
522     #======================================================================
523     # FORTRAN Support Libraries
524     #
525     # Point BLASLIB and LPAKLIB to machine-specific BLAS and LINPACK
526     # libraries (if you have them) to get the best speed out of ASCEND.
527     # Otherwise, generic versions will be built if FORTRAN is available.
528     #======================================================================
529    
530     # Name & path to the blas library
531     ASC_BLAS_LIBROOT = libblas ;
532     ASC_BLAS_LIB = $(ASC_BLAS_LIBROOT)$(SUFLIB) ;
533     BLASLIB_PATH = $(BUILD_DIR) ;
534     BLASLIB = $(BLASLIB_PATH)$(SLASH)$(ASC_BLAS_LIB) ;
535    
536     # Name & path to the linpack library
537     ASC_LINPACK_LIBROOT = liblpak ;
538     ASC_LINPACK_LIB = $(ASC_LINPACK_LIBROOT)$(SUFLIB) ;
539     LPAKLIB_PATH = $(BUILD_DIR) ;
540     LPAKLIB = $(LPAKLIB_PATH)$(SLASH)$(ASC_LINPACK_LIB) ;
541    
542     # Name & path to the internal lsode library.
543     if $(BUILD_LSODE) = TRUE
544     {
545     Echo Building internal LSODE library ;
546     ASC_LSOD_LIBROOT = liblsode ;
547     ASC_LSOD_LIB = $(ASC_LSOD_LIBROOT)$(SUFLIB) ;
548     LSODLIB_PATH = $(BUILD_DIR) ;
549     LSODLIB = $(LSODLIB_PATH)$(SLASH)$(ASC_LSOD_LIB) ;
550     }
551    
552     FOR_LIBS += $(LSODLIB) $(LPAKLIB) $(BLASLIB) $(F77_LIBS) ;
553    
554     #======================================================================
555     # Ascend-specific jam instructions
556     #======================================================================
557    
558     #----------------------------------------------------------------------
559     # LEX_or_copy
560     #
561     # Generates a c source file using the lexer defined by $(LEX),
562     # or by copying a specified file if $(LEX) is not defined.
563     # The following parameters are used:
564     #
565     # 1 source file to generate
566     # 2 lex/flex definition file
567     # 3 pre-generated source file to copy if $(LEX) is empty
568     # 4 header file associated with the source file, if any
569     #----------------------------------------------------------------------
570     rule LEX_or_copy
571     {
572     if $(LEX)
573     {
574     Echo Generating $(1) from $(LEX) ;
575     DEPENDS $(1) : $(2) ;
576     Lex_with_options $(1) : $(2) ;
577     }
578     else
579     {
580     Echo Copying $(1) from $(4) ;
581     File $(1) : $(3) ;
582     }
583    
584     # make the header dependent
585     if $(4)
586     {
587     INCLUDES $(1) : $(4) ;
588     }
589    
590     Clean clean : $(1) ;
591     }
592    
593     # run LEX using options specified in LEXOPTS
594     actions Lex_with_options
595     {
596     $(LEX) $(LEXOPTS) -o$(1) $(2)
597     }

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