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

Contents of /trunk/jam/Jamrules_general.in

Parent Directory Parent Directory | Revision Log Revision Log


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

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