Directory Structure Modular Layout Module Map Modules Description Customization Advanced Configuration
The basic idea is that the user wants to work with a package, test changes, and has different versions of particular routines for different purposes. He may also have other closely related problems which differs only in a small set of routines. An example would be a stellar evolution package where there is a main set of working routines which are used for production runs, a set of routines with different microphysics, and a reduced set of equations for computation of, e.g., polytropes for test purposes. These routines share a common set of drivers and output subroutines, numerical solvers and so on.
DarkStar consists of two file management scripts and a set of Fortran 90 modules for different purposes, bundled with sample driver routines into an exemplary stellar structure package. The scripts and the modules are also separately usable for other purposes. They are based on widely spread and freely available, modern and standard Unix software and therefore are platform independent.
All DarkStar modules adapt themselves to the actual sizes of the problem. This enables,e.g., adaptive as well as multigrid approaches to the set of equations. The core numerical modules provide a Newton-Raphson solver for local problems with an arbitrary discretization bandwidth, a variety of boundary forms, and an automatic Jacobi matrix constructor. A Gauss elimination matrix solver for block-band matrices of arbitrary bandwidth backs up this package. Because the user is relieved from the tedious computations of Jacobian derivatives, he is encouraged to experiment freely with the equations, hopefully enhancing creativity and productivity.
make <v>
make compiles the first version directory found,
or only source, if no version directory exists). To be platform independent,
make must be the GNU-Make program
(version >= 3.70, often installed as /usr/local/bin/make or gmake).
The version dependent files are identified by just being in one of the source_<v> directories, that means, files of the same name in the corresponding location in source are ignored. With this technique the different versions can have different version-dependent files. Additionally/alternatively, the source files can be specified by subset selection. By default, all files present in source and source_<v> are considered for compilation.
The same applies to files containing F90 modules or include files, which reside in the
modules or includes directories below
in the corresponding source directory (include files can also be placed into further
subdirectories in the includes directories or in other subdirectories instead of
includes). Each of these files can reference modules or
include files also from the corresponding other slot (references between different
version files are senseless here). Therefore, seemingly version independent files can
have indirect version dependencies by, e.g., including a version-dependent module
to specify array sizes or the like.
The dependency generator keeps track of all the complicated inter-dependencies of
the two slots when recompiling to another version.
Library archive files and precompiled library module files are supported, they reside in an extra directory library_F90 and are expected to be up to date. The best way to include libraries from outside the working directory is a link in library_F90 to these.
All compiler output files (.o objects files and .mod,.M module information files) as well as the resulting executable is placed inside an automatically created directory hierarchy objects, objects_<v>, which resembles the structure of the corresponding source hierarchy and relieves the user from being annoyed by garbage files polluting the working directory. The executable file is placed into the directory OS. Make_Depp/Makefile themselves produce two files which are hidden from view, the dependency file .DarkStar.dep and an empty version time stamp file, .Version_<v>. These files should not be edited or deleted.
For customization of all the directory names, see below (note: Any changes in Makefile or Make_Depp force recompilation of all files).
The modules themselves are only wrapper files which include the relevant source files and define the data structures common to all module routines. Therefore, the user not only can change methods by using other modules, but is free to change specific codes inside the module by just including another source file (which, of course, has to respect the interface and data conventions of that module).
A module is also usable as an entity from any other driver program independently and can be exchanged in favour for other methods. Detailed information is available via a clickable map
| Variable | Meaning | Default |
|---|---|---|
| SOURCE_FILES | Variable which the user can set to select a subset of the version independent source filenames (without directory and suffix, and except module source and include files). The main program file should be placed at the end. | <none = all> |
| SOURCE_V_FILES | Variable which the user can set to select a subset of the version dependent source filenames (without directory and suffix, and except module source and include files). The main program file should be placed at the end. | <none = all> |
| COMP | The f90 compiler brand (DEC, SUN, ABS, NAG, NEC, EPC, PGI ...). Used to configure include and module pathes, module name translation characteristics. Currently only the seven compilers above have been tested, and SUN, EPC and ABSoft need special handling. To configure for any other compiler, if necessary, see below. Caution: Case sensitive ! | |
| F90C | The Fortran 90 compiler command. | |
| OPTIONS | The compiler options desired. The user may not place any include directives (-I...) here. The options are vendor specific, but not set automatically ! | |
| LINK_OPTS | The linker options desired. | |
| SRC | The prefix name of the source slots: $(SRC), $(SRC)_$V, where $V is the variable for the version <v> (set automatically). | source |
| MOD | The name of the directories where F90 module sources in the source directories and the .mod or .M output files in the objects directories reside, relative to the corresponding source or objects slot. | modules |
| INC | The name of the directories where include sources in the source directories reside, relative to the corresponding source directory. Further include directories have to be located inside these ones. | includes |
| OBJD | Prefix of the directories where the output objects files shall go. These are organized analogously to the source slots and are generated automatically: $(OBD), $OBD_$V. | objects |
| LIB, LIBV | Module library files are constructed from $LIB and $LIBV as follows: $LIB=A[X] B[Y] and $LIBV=n m accesses Libraries A/$(OS)_n/libX.a and B/$(OS)_m/libY.a These libraries are assumed to be up to date. | |
| MLIBD | created module library file (gmake <v> Library) is $(MLIBD)/$(OS)_<v>/lib$(MAIN).a | |
| EXCD | Name of the directory of the executable file. | OS |
| MAIN | Name of the executable file inside the $(EXD) directory. This name is also used for the hidden dependency file, .$(MAIN).dep, which Make_Depp generates and which is included into the Makefile. | Main |
| VERB | Switch if verbose output from Make_Depp is desired (set to -v). | ... |
The following variables may be changed to what is appropriate for the specific compiler:
| Variable | Meaning | Default |
|---|---|---|
| FFLAGS | The complete list of Fortran 90 compiler flags. If the search path option for module information files is not -I..., then ADD (with +=) the correct search path options to FFLAGS, as already done for SUN and ABSoft. Changes here are also necessary if another compiler (e.g., F77) is used. The added pathes must be $(OMV),$(OMV),$(RLIB) (see next). | ... |
The following variables from the Makefile should not be changed, but are documented (in order of appearance) for further understanding of what's going on there:
| Variable | Meaning | Default |
|---|---|---|
| DEP | The name of the hidden dependency file generated by Make_Depp and included into the Makefile. The definitions there get valid in the next recursive call of make. | .DarkStar.dep |
| ECHO | A command string for echoing a separating line. | /bin/echo '==...' |
| VS | The list of all version dependent source directories source_<v>. | ... |
| VERSIONS | The list of all versions derived from $(VS). | ... |
| V | The version variable, set to whatever <v> currently is. Defaults to the first <v> found in the first call, reset in the next recursive make. Is 1 if only source is found. | 1 |
| VFIL | The version timestamp file prefix, file name is $(VFIL)_$V. | .Version |
| LR | The library archive filename stem, lib$(LR).a . | ... |
| LIBC | The compiler library option string. | -L$(RLIB) -l$(LR) |
| LIBR | The full library name | $(RLIB)/$(LIBF) |
| EXC | The executable file. | $(EXD)/$(MAIN) |
| SRV | The version dependent source path. | $(SRC)_$V |
| SIN | The version independent include path. | $(SRC)/$(INC) |
| SIV | The version dependent include path. | $(SRV)/$(INC) |
| SMD | The version independent module path. | $(SRC)/$(MOD) |
| SMV | The version dependent module path. | $(SRV)/$(MOD) |
| OBV | The version dependent objects path. | $(OBD)_$V |
| OMD | The version independent module objects path. | $(OBD)/$(MOD) |
| OMV | The version dependent module objects path. | $(OBV)/$(MOD) |
| MAKL | The list: Makefile, Make_Depp. Used for recompiling when one of these files is changed. | $(MAK) $(MAKD) |
| SRCL | The list of all source files in the version independent source directory. | ... |
| SRCLIST | $(SRCL) without directories and suffixes. | ... |
| SRC_USER | The list of all source files in the version dependent source_<v> directory. | ... |
| SRCUSER | $(SRC_USER) without directories and suffixes. | ... |
| SOURCE | The user source list with all files in $(SRCUSER) filtered out. | ... |
| SOURCES | The new complete user source list with all directories and suffixes. | ... |
| OBJECTS | The complete object list with all directories and suffixes. | ... |
Here is a list of all targets in Makefile for reference:
| Target | Meaning |
|---|---|
| .SUFFIXES: | Gmake special: delete list of suffix rules. |
| .PHONY: | Gmake special: all targets which are not real files. |
| .DELETE ON ERROR: | Gmake special: delete files created in a command that failed. |
| NIL: | First default entry, generates version 1 |
| $(VERSIONS): | Version targets, only create directories, manage version file and call make with target $Va again. |
| $Va: | Recursive version target, call Make_Depp and set version, then call make with target $(EXC) again. |
| $(EXC): | The executable file target. Depends on version time stamp file, objects and library. |
| $(OBD)/%.o: | The version independent objects file target. Depends on version independent sources. Other dependencies are resolved via the included dependency file. |
| $(OBV)/%.o: | The version dependent objects file target. Depends on version dependent sources. Other dependencies are resolved via the included dependency file. |
| $(VFIL)_$V | The version time stamp file target. Update if Makefile/_Depp changed. |
| $(DEP) | The dependency file target. Create empty dummy file if not existent. |
| CLEANUP | Say make CLEANUP if strange errors occur, possibly resulting from prematurely terminated makes, compiler mixing or timing errors. This will delete all object, dependency and version files, giving a clean directory for rebuild. |
The Make_Depp dependency generator should never be changed.