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

Contents of /trunk/jam/Jamrules_general.in

Parent Directory Parent Directory | Revision Log Revision Log


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

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