next up previous contents
Next: Preparing to Developing New Up: Makefiles in PSI3 Previous: Makefile Structure   Contents

PSI Makefiles

The Makefiles contained in the PSI package are complicated, in part due to the size of the package and the need for code portability. PSI3 Makefiles are generated automatically from simple input, called Makefile.in, by the configure script in the top-level $PSI directory. This script is designed to examine system-specific characterisctics, such as library locations, special compiler options, the existence of certain header files or functions, or Fortran-C cross-linkage conventions, among others. With the information it obtains, it constructs the large number of Makefiles needed for compilation of PSI's libraries, utilities, and modules.

As an example, consider the Makefile.in file associated with cscf:

srcdir = @srcdir@
VPATH = @srcdir@

include ../MakeVars

PSILIBS = -lPSI_file30 -lPSI_chkpt -lPSI_iwl -lPSI_psio -lPSI_ciomr -lPSI_ipv1

TRUESRC = \
cscf.c cleanup.c dft_inputs.c diis.c dmat.c \
dmat_2.c ecalc.c errchk.c findit.c \
formg2.c formgc.c formgo.c form_vec.c gprgid.c init_scf.c \
packit_c.c packit_o.c rdone.c rdtwo.c rotate_vector.c scf_input.c \
scf_iter.c scf_iter_2.c schmit.c sdot.c shalf.c check_rot.c phases.c\
guess.c sortev.c occ_fun.c init_uhf.c cmatsplit.c dmatuhf.c \
findit_uhf.c uhf_iter.c schmit_uhf.c diis2_uhf.c formg_direct.c \
orb_mix.c

BINOBJ = $(TRUESRC:%.c=%.o)
ALLOC =

include ../MakeRules

ifneq ($(DODEPEND),no)
$(BINOBJ:%.o=%.d): $(DEPENDINCLUDE)
include $(BINOBJ:%.o=%.d)
endif

install_man:: cscf.1
        $(MKDIRS) $(mandir)/man1
      	$(INSTALL_INCLUDE) $^ $(mandir)/man1

The @string@ directives tell the configure script where to insert certain variables is has determined from the system. This Makefile input also includes two external Makefiles, MakeVars and MakeRules, both of which are in the parent directory. These files contain (not surprisingly) numerous necessary variables (e.g. the local C compiler name) and rules (e.g. how to generate the module itself) for compilation and installation of cscf. Similar files exist for the PSI libraries as well. We recommend that programmer's spend some time studying the PSI Makefile structure.


next up previous contents
Next: Preparing to Developing New Up: Makefiles in PSI3 Previous: Makefile Structure   Contents
psi 2003-01-07