Guidelines for Packaging NTCC Modules
- Use GNU make: usually available in /usr/local/bin or /usr/gnu/bin
- Provide a Makefile that supports:
-- see Makefile as an example.
(Note: this is a hand made Makefile. With the include file, it produces the same result as the examples below, using Autoconf.)
- different Operating Systems -- see Make.flags as an example for an include file
- options for source and target directories -- to allow one source for multiple architectures
- install -- to handle multiple packages
- Use Autoconf to generate configuration scripts for Makefiles
- see configure.in as an example for a configure template
- see Makefile.in as an example for a Makefile template for configure
- See GNU Autoconf for more information on Autoconf.
- See NERSC Tutorials for an introduction to Makefiles.
To avoid potential name conflicts of public f90 modules and public header files between various packages, follow these conventions:
| file type || name || destination ||usage |
|header ||<name>.h || <PREFIX>/include/<package> || #include "<package>/<name>.h" |
| -I <PREFIX>/include |
|f90 module || <package>_<name> || <PREFIX>/mod
|| USE <package>_<name>|
|library || lib<name>.a|| <PREFIX>/lib || -L<PREFIX>/lib -l<package>
|executable || <name> || <PREFIX>/bin || add to PATH
|script ||<name> || <PREFIX>/etc || add to PATH
Example: package xyz produces library libxyz.a and contains f90 module xyz_aaa and headerfile xxx.h
When installed in PREFIX=$HOME
usage would be:
in fortran source:
compiler flags: -M$HOME/mod -I$HOME/include
linker flags: -L$HOME/lib -lxyz
Note: -M is vendor dependent and could be -p or -I.
Send mail to transp_support with questions, comments, etc.
Guide for Submitters
This project is sponsored by the Office of Fusion Energy Sciences of the U. S. Department of Energy.