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

Contents of /trunk/jam/Jamrules_general.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103 - (show annotations) (download)
Sun Dec 11 14:31:02 2005 UTC (18 years, 7 months ago) by jds
File size: 14426 byte(s)
Bug fixes & killing more compiler warnings:
- general/list.c - fixed AssertAllocatedMemory and AssertContainedMemory bugs.
- added #include of ascPanic.h where necessary to compile with ALLOCATED_TESTS defined.
- reworked utilities/ascDynaLoad to eliminate compiler warnings related to casting between data & function pointers.
- switched utilities/ascEnvVar.c over to ascstrdup (had static ascstringcopy, which did the same thing).

All regression tests passed on Windows and Linux (except pre-existing solver/slv_common issues).
1 #
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. The Ascend jam build system currently
31 # supports the MSVC, Borland, MinGW, and Watcom compilers
32 # (extension to gcc on Linux is on the TODO: list).
33 #
34 # This file is not currently customized by the configure mechanism,
35 # although this may be implemented in the future.
36 #
37 # Users should copy/rename this file to 'Jamrules_general', then
38 # modify the settings manually for their particular system.
39 # Ascend cannot be built by jam unless the Jamrules_general file
40 # is present.
41 #
42 # User-customized Jamrules_general files should not be placed in
43 # version control. Only the Jamrules_general.in template should
44 # be versioned.
45 #
46 #---------------------------------------------------------------------------
47
48 # Comment to compile with debugging & assertions enabled.
49 # Should be commented for regression tests to work properly.
50 NODEBUG = 1 ;
51
52 # Comment to compile without using the Epperly malloc debugger
53 # Should be UNcommented for regression tests to work properly.
54 #DEBUG_MALLOC = -DMALLOC_DEBUG ;
55
56 #======================================================================
57 # PACKAGES
58 #
59 # Package settings for building Ascend.
60 # Packages are bits of compiled code that represent models, or solvers,
61 # or, in general, any bits of external code.
62 #
63 # Choose one of the following, comment out the others:
64 # STATIC_PACKAGES packages should be statically linked/loaded
65 # DYNAMIC_PACKAGES packages should be dynamically linked/loaded
66 # NO_PACKAGES no packages
67 #
68 # If STATIC_PACKAGES are chosen, also indicate the location of
69 # the packages in PACK_LIBS. Otherwise leave PACK_LIBS empty.
70 #======================================================================
71 #PACKAGE_FLAGS = -DSTATIC_PACKAGES ;
72 PACKAGE_FLAGS = -DDYNAMIC_PACKAGES ;
73 #PACKAGE_FLAGS = -DNO_PACKAGES ;
74
75 PACK_LIBS = $(ASC_PACKAGES_LIB_PATH) ;
76 #PACK_LIBS = ;
77
78 #======================================================================
79 # SIGNAL TRAPS
80 #
81 # If you want to be able to interrupt ASCEND with ctrl-C, then comment the
82 # following line. Uncomment the line for the default (can't interrupt with
83 # ctrl-C) behaviour.
84 #
85 # Comment the line for regression testing to work properly.
86 #======================================================================
87 CCFLAGS += -DNO_SIGINT_TRAP -DNO_SIGSEGV_TRAP ;
88
89 #---------------------------------------------------------------------------
90
91 # Tools required for complete build (comment out if not present).
92 # The build system works around their absence if necessary.
93 # Note that they are available for Windows, for example:
94 # http://sourceforge.net/projects/gnuWin32
95 SED = sed ;
96 YACC = yacc ;
97 YACCFLAGS = -d ;
98 YACCFILES = y.tab ;
99 LEX = flex ;
100
101 # Location of system libraries on Linux.
102 # TODO This is a hack and needs to be redone.
103 if $(UNIX) || $(OS) = LINUX
104 {
105 DL_LIB_DIRS = /usr/lib ;
106 X11_LIB_DIRS = /usr/X11R6/lib ;
107 MATH_LIB_DIRS = /usr/lib ;
108 FOR_LIB_DIRS = /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1 ;
109 }
110
111 #======================================================================
112 # General build options
113 #======================================================================
114 # Build directory - - will be qualified for compiler & build type
115 BUILD_DIR_ROOT = $(DOT) ;
116
117 # Comment for normal jam deletion of object files after building targets
118 KEEPOBJS = true ;
119
120 # platform-independent options
121 # sizeof(void*) - change value if not a typical 32-bit system
122 SIZEOF_VOIDPTR = 4 ;
123
124 # Added $(PACKAGE_FLAGS)
125 CCFLAGS += $(PACKAGE_FLAGS) -DSIZEOF_VOID_P=$(SIZEOF_VOIDPTR) ;
126
127 if $(NODEBUG)
128 {
129 CCFLAGS += -DNDEBUG ;
130 BUILD_SUBDIR = $(SLASH)Release ;
131 }
132 else
133 {
134 BUILD_SUBDIR = $(SLASH)Debug ;
135 }
136
137 # platform- & complier-specific options
138 if $(NT)
139 {
140 # Windows-specific defines
141 CCFLAGS += -D_X86_=1 -DWIN32 -D_WIN32 -DASC_BUILD_LIB ;
142 SUFSHR = .dll ;
143
144 if $(BCCROOT) || ( $(TOOLSET) = BORLANDC )
145 {
146 FORTRAN = ;
147 CCFLAGS += -q -d -g0 -j0 -K -DMOD_ASCMALLOC ;
148 CCWARN = -w ;
149 if $(NODEBUG)
150 {
151 CCDEBUG = -v- -O2 ;
152 }
153 else
154 {
155 CCDEBUG = -v -y -Od ;
156 }
157 C++FLAGS = $(CCFLAGS) ;
158 COFF2OMF = coff2omf ; # add location if not in path
159 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ;
160 }
161
162 else if $(MSVCNT) || ( $(TOOLSET) = VISUALC )
163 {
164 FORTRAN = ;
165 CCFLAGS += /Ze ;
166 CCWARN = /W4 ;
167 if $(NODEBUG)
168 {
169 CCDEBUG = /O2 ;
170 }
171 else
172 {
173 CCDEBUG = /Zi /Od ;
174 }
175 # Libraries are in different paths depending on VC version
176 LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ;
177 LINKLIBS = advapi32.lib
178 libc.lib
179 oldnames.lib
180 gdi32.lib
181 user32.lib
182 kernel32.lib ;
183 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ;
184 }
185
186 else if $(MINGW) || ( $(TOOLSET) = MINGW )
187 {
188 FORTRANFLAGS = -c -I4 -O ;
189 F77_LIBS += $(MINGW)$(SLASH)lib$(SLASH)libg2c.a ;
190
191 CCFLAGS += -DHAVE_ERF=1 ;
192 # uncomment to select desired warning level and ansi-strictness
193 CCWARN += -Wall ;
194 CCWARN += -W ;
195 CCWARN += -pedantic ;
196 #CCWARN += -Wshadow ;
197 #CCWARN += -ansi ;
198 CCWARN += -std=c99 ;
199
200 if $(NODEBUG)
201 {
202 CCDEBUG = -O3 ;
203 }
204 else
205 {
206 CCDEBUG = -g -O0 ;
207 CCFLAGS += -ggdb ;
208 }
209 C++FLAGS = $(CCFLAGS) ;
210 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ;
211 }
212
213 else if $(WATCOM) || ( $(TOOLSET) = WATCOM )
214 {
215 FORTRANFLAGS = /NOER ;
216 CCFLAGS += /fr /dMOD_ASCMALLOC ;
217 CCWARN = /wx ;
218 if $(NODEBUG)
219 {
220 CCDEBUG = /ox ;
221 FORTRANFLAGS += /OX ;
222 }
223 else
224 {
225 CCDEBUG = /od /d2 ;
226 FORTRANFLAGS += /OD /D2 ;
227 }
228 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ;
229 }
230 }
231
232 else if $(UNIX) || $(OS) = LINUX
233 {
234 SUFSHR = .so ;
235 if $(CC) = gcc {
236
237 if $(NODEBUG)
238 {
239 CCDEBUG = -O3 ;
240 }
241 else
242 {
243 CCDEBUG = -g -O0 ;
244 Echo "DEBUGGER SYMBOLS TURNED ON" ;
245 CCFLAGS += -ggdb ;
246 }
247
248 # uncomment to select desired warning level and ansi-strictness
249 CCWARN += -Wall ;
250 CCWARN += -W ;
251 CCWARN += -pedantic ;
252 #CCWARN += -Wshadow ;
253 #CCWARN += -ansi ;
254 CCWARN += -std=c99 ;
255
256 FORTRANFLAGS = -c -I4 -O ;
257
258 }
259
260 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ;
261 }
262
263 CCFLAGS += $(CCWARN) $(CCDEBUG) $(DEBUG_MALLOC) ;
264 C++FLAGS = $(CCFLAGS) ;
265 BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ;
266
267 #======================================================================
268 # Ascend base library names & paths
269 #======================================================================
270 ASC_COMPILER_LIBROOT = libasc_compiler ;
271 ASC_GENERAL_LIBROOT = libasc_general ;
272 ASC_SOLVER_LIBROOT = libasc_solver ;
273 ASC_UTILITIES_LIBROOT = libasc_utilities ;
274 ASC_PACKAGES_LIBROOT = libasc_packages ;
275
276 ASC_COMPILER_LIB = $(ASC_COMPILER_LIBROOT)$(SUFLIB) ;
277 ASC_GENERAL_LIB = $(ASC_GENERAL_LIBROOT)$(SUFLIB) ;
278 ASC_SOLVER_LIB = $(ASC_SOLVER_LIBROOT)$(SUFLIB) ;
279 ASC_UTILITIES_LIB = $(ASC_UTILITIES_LIBROOT)$(SUFLIB) ;
280 ASC_PACKAGES_LIB = $(ASC_PACKAGES_LIBROOT)$(SUFLIB) ;
281
282 ASC_BASE_LIBS =
283 $(ASC_COMPILER_LIB)
284 $(ASC_GENERAL_LIB)
285 $(ASC_PACKAGES_LIB)
286 $(ASC_SOLVER_LIB)
287 $(ASC_UTILITIES_LIB)
288 ;
289
290 # Path to base library sources & libs from top-level jam directory
291 ASC_BASE_SOURCE_RELPATH = ..$(SLASH)base$(SLASH)generic ;
292 ASC_BASE_LIBS_RELPATH = ..$(SLASH)base$(SLASH)jam$(SLASH)$(BUILD_DIR)$(SLASH) ;
293
294 #======================================================================
295 # SOLVERS / INTEGRATORS
296 #
297 # If you are linking to MINOS or other external solvers, the solver
298 # interface needs to know about it.
299 # Set the comment flags as appropriate on the following definitions.
300 # If the settings here do not match the libraries you link, you will
301 # almost certainly get runtime errors if not link errors.
302 #======================================================================
303
304 # >>>> UNDER CONSTRUCTION <<<<
305
306 # Slv is the original ASCEND nonlinear solver. It is not currently supported.
307 # to build with slv, uncomment the next line.
308 #SOLVER_DEFS += -DSTATIC_SLV ;
309
310 # Opt is not currently supported.
311 # to build with optsqp, uncomment the next line
312 #SOLVER_DEFS += -DSTATIC_OPTSQP ;
313
314 # QRSlv is the current ASCEND nonlinear algebraic solver.
315 # to build with qrslv, uncomment the next line
316 SOLVER_DEFS += -DSTATIC_QRSLV ;
317
318 # makeMPS is currently not supported.
319 # to build with mps, uncomment the next line
320 #SOLVER_DEFS += -DSTATIC_MPS ;
321
322 # to build with ngslv, uncomment the next line
323 #SOLVER_DEFS += -DSTATIC_NGSLV ;
324
325 # to build with cmslv (requires CONOPT), uncomment the next line
326 #SOLVER_DEFS += -DSTATIC_CMSLV ;
327
328 # to build with lrslv, uncomment the next line
329 #SOLVER_DEFS += -DSTATIC_LRSLV ;
330
331 # TODO the configure script sets the following depending on its search for minos.
332 # Minos is an external solver. It is not currently supported.
333 # to force a build WITHOUT minos, comment the next line
334 #SOLVER_DEFS += -DSTATIC_MINOS ;
335 #
336 # Name & path to the minos library
337 #MINOSLIB = ;
338 #MINOSLIB_RELPATH = ;
339
340 # TODO the configure script sets the following depending on its search for conopt.
341 # to force a build WITHOUT conopt, comment the next line
342 #SOLVER_DEFS += -DSTATIC_CONOPT ;
343 #
344 # Path to the conopt library
345 #CONOPTLIB = ;
346 #CONOPTLIB_RELPATH = ;
347
348 # TODO the configure script sets the following depending on its search for lsode.
349 # Choose one of the following to build with lsode, comment both to build WITHOUT lsode
350 SOLVER_DEFS += -DSTATIC_LSOD ;
351 #SOLVER_DEFS += -DDYNAMIC_LSOD ;
352 #
353 # Name & path to the lsode library. Comment out if not using lsode.
354 ASC_LSOD_LIBROOT = liblsode ;
355 ASC_LSOD_LIB = $(ASC_LSOD_LIBROOT)$(SUFLIB) ;
356 LSODLIB_RELPATH = ..$(SLASH)lsod$(SLASH)jam$(SLASH)$(BUILD_DIR) ;
357 LSODLIB = $(ASC_LSOD_LIB) ;
358
359 #======================================================================
360 # FORTRAN options - set to override compiler defaults
361 #======================================================================
362 # Your FORTRAN compiler
363 #FORTRAN = g77 ;
364
365 # Fortran compilation flags & options:
366 # These are used for making the ASCEND libraries based on FORTRAN codes.
367 # These should be set to get the best performance possible out of your
368 # f77 compiler without optimizing away functions that are not obviously
369 # called, as some compilers do by default.
370 #
371 #FORTRANFLAGS = -c -I4 -O -lg2c ;
372
373 # F77LIBS is for the base f77 libraries. If you are linking no f77
374 # objects to ascend, it may be left undefined.
375 # Set F77LIBS appropriate for your machine and desired loader behavior.
376 #
377 #F77_LIBS = ;
378 if $(UNIX) || $(OS) = LINUX
379 {
380 F77_LIBS = -L$(FOR_LIB_DIRS) -lg2c ;
381 }
382
383 #======================================================================
384 # FORTRAN Support Libraries
385 #
386 # Point BLASLIB and LPAKLIB to machine-specific BLAS and LINPACK
387 # libraries (if you have them) to get the best speed out of ASCEND.
388 # Otherwise, generic versions can be built if FORTRAN is available.
389 #======================================================================
390
391 # Name & path to the blas library
392 ASC_BLAS_LIBROOT = libblas ;
393 ASC_BLAS_LIB = $(ASC_BLAS_LIBROOT)$(SUFLIB) ;
394 BLASLIB_RELPATH = ..$(SLASH)blas$(SLASH)jam$(SLASH)$(BUILD_DIR) ;
395 BLASLIB = $(ASC_BLAS_LIB) ;
396
397 # Name & path to the linpack library
398 ASC_LINPACK_LIBROOT = liblpak ;
399 ASC_LINPACK_LIB = $(ASC_LINPACK_LIBROOT)$(SUFLIB) ;
400 LPAKLIB_RELPATH = ..$(SLASH)linpack$(SLASH)jam$(SLASH)$(BUILD_DIR) ;
401 LPAKLIB = $(ASC_LINPACK_LIB) ;
402
403 #======================================================================
404 # Math libraries
405 #======================================================================
406 if $(UNIX) || $(OS) = LINUX
407 {
408 MATH_LIBS = -L$(MATH_LIB_DIRS) -lieee -lm ;
409 }
410
411 #======================================================================
412 # Dynamic loading support
413 #======================================================================
414 if $(UNIX) || $(OS) = LINUX
415 {
416 DL_LIBS = -L$(DL_LIB_DIRS) -ldl ;
417 }
418
419 #======================================================================
420 # X11
421 #======================================================================
422 if $(UNIX) || $(OS) = LINUX
423 {
424 X11_LIBS = -L$(X11_LIB_DIRS) -lX11 ;
425 }
426
427 #======================================================================
428 # Ascend-specific jam instructions
429 #======================================================================
430
431 #----------------------------------------------------------------------
432 # LEX_or_copy
433 #
434 # Generates a c source file using the lexer defined by $(LEX),
435 # or by copying a specified file if $(LEX) is not defined.
436 # The following parameters are used:
437 #
438 # 1 source file to generate
439 # 2 lex/flex definition file
440 # 3 pre-generated source file to copy if $(LEX) is empty
441 # 4 header file associated with the source file, if any
442 #----------------------------------------------------------------------
443 rule LEX_or_copy
444 {
445 if $(LEX)
446 {
447 Echo Generating $(1) from $(LEX) ;
448 DEPENDS $(1) : $(2) ;
449 Lex_with_options $(1) : $(2) ;
450 }
451 else
452 {
453 Echo Copying $(1) from $(4) ;
454 File $(1) : $(3) ;
455 }
456
457 # make the header dependent
458 if $(4)
459 {
460 INCLUDES $(1) : $(4) ;
461 }
462
463 Clean clean : $(1) ;
464 }
465
466 # run LEX using options specified in LEXOPTS
467 actions Lex_with_options
468 {
469 $(LEX) $(LEXOPTS) -o$(1) $(2)
470 }

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