Compiling specific versions of Tonto
From Tonto Wiki
There are a variety of different types of Tonto executable that you can compile.
Some of them are darn useful.
Contents |
Introduction
The compilation/customisation options are contained in the platform-specific compiler options file, in the platforms/ directory.
For example, if you are using gfortran on Linux, it is the platforms/GNU-gfortran-on-LINUX file.
The particular file in your case depends on your compiler and operating system.
Please identify the correct file beore doing anything!
Then edit it to control what kind of executables you get.
- Note: whenever you change this file Tonto will rebuild from the start.
- Note: generally you should only need to change the switches which are uncommented in this file.
- Note: there are usually several commented-out suggested options that can be used
A summary of groups switches which control the customised executables is as follows
Switches controlling Foo language translation to Fortran
Compiling the specialised executables involves setting the DEFS macro (see above) to include one or more of the switches in the table below e.g.
DEFS = -DUSE_ERROR_MANAGEMENT -DNO_GENERIC_NAMES -DNO_MOD_USE -DFLUSH
Click on the links to see more about that option.
| Switch | Explanation. |
|---|---|
| -DMPI | Generate a parallel version of Tonto, using MPI. You must specify the parallel libraries you need with the -L and -l options in the platforms file. |
| -DFLUSH | Flush output to stdout. The fortran compiler must have the flush() routine.<>br> |
| -DNO_TONTO_SYSTEM_CALLS | No Tonto system checks and no parallel calls are generated in the code. |
| -DNO_TONTO_SYSTEM_CHECKS | No system checks are generated e.g. no ENSURE, DIE, or WARN messages. However, MPI parallel calls are generated if requested; you must also use the -DMPI switch. |
| -DNO_GENERIC_NAMES | Generated routine names with the module name prepended. This may reduce compile time by reducing namespace, but will have nonstandard routine names greater than 31 characters long. Particularly effective some compilers. |
| -DUSE_ERROR_MANAGEMENT | Use DIE and WARN, minimal Tonto system error checking routines. This default is recommended for fast executables. |
| -DUSE_PRECONDITIONS | Check that routine arguments and inputs satisfy ENSURE preconditions . This involves checking, so there will be a performance hit. This option sets the -DUSE_ERROR_MANAGEMENT switch. |
| -DUSE_CALL_STACK_MANAGEMENT | Generated code to track and report the call stack and memory usage. This involves a big performance hit. This option sets -DUSE_PRECONDITIONS switch. Recommended for use with debugging executables and for test jobs. |
| -DTRACK_MEMORY_LOCATIONS | Generates code to tracks all allocates and deallocates, useful for eliminating memory leaks . The Fortran compiler must have the loc() pointer function or equivalent, set with the LOC macro. This option sets the -DUSE_CALL_STACK_MANAGEMENT switch. |
| -DUSE_TIME_PROFILING | Generates code to time and profile routines. This feature is not very accurate. Use for large-block timing or relative timing. It sets the BROKEN_PURE switch. |
| -DBROKEN_PURE | Generates code with no Fortran90 pure routines. This switch is needed for time profiling, to allow IO from pure routines. |
| -DBROKEN_TYPE_INITIALIZATION | Generates code which eliminates derived type initialisation. Rarely needed these days, most compilers work with initialised derived types. |
| -DLANGUAGE_FORTRAN_90 | This sets the -DBROKEN_TYPE_INITIALIZATION and -DBROKEN_PURE switches. |
| -DESSL | Use ESSL math libraries. For IBM machines only. Lapack libraries are normally used. |
| -DNO_CASE_OPTIONS | Removes informative error on string-based case statements. Not recommended to remove. |
Switches for file extensions and file names
| Switch | Explanation. |
|---|---|
| FSUFFIX | The compiler-preferred Fortran file extension
|
| PROGSUFFIX | The preferred file extension for executables
|
| MODSUFFIX | The Fortran module file extension produced by the compiler
|
| MODCASE | If the compiler outputs module files that have the head part of the file name in uppercase rather than lowercase use MODCASE = -uc
|
| OBJSUFFIX | The file extension for object files
|
| PROGSUFFIX | Option to specify the file extension for the executable
|
Library-related switches
- Library related options
- -----------------------
- LIBSUFFIX = a
- The file extension for library files
- MKLIB = ar -ru
- Command for making libraries
LIBS = -L$(objdir) -llapack -lblas
- Specifies the library paths to search (-L) and the LAPACK/BLAS libraries,
- or their equivalent. Note: is using ESSL libraries, add -DESSL
- switch to to DEFS above
Compiling compact executables
Executables in tonto tend to be big. That is no good.
If your executable is too big for your liking, you can remove all dead code from your application by typing.
make compactify make
Consider also using the -DNO_GENERIC_NAMES compile option. See below to make an even smaller executable (though, you may break the 32 character limit on routine names in this case).
