File: adding_new_code.tex

package info (click to toggle)
psicode 3.4.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 46,416 kB
  • ctags: 18,563
  • sloc: cpp: 291,425; ansic: 12,788; fortran: 10,489; perl: 3,206; sh: 2,702; makefile: 2,205; ruby: 2,178; yacc: 110; lex: 53
file content (44 lines) | stat: -rw-r--r-- 1,910 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Given the complexity of the \PSIthree\ package, the prospect of adding
new modules or libraries may seem daunting at first.  Let's assume you
want to begin writing a new module named \file{great\_code} for
\PSIthree.  The following series of steps will generate the proper
directories and \file{Makefile}s to get started.  For convenience, the
top-level directory of the programmer's \PSIthree\ source tree will be
referred to as \$PSI3 and the top-level directory of the compilation
area as \$prefix:
\begin{enumerate}
\item Generate the new directory in the source tree: \\
{\tt mkdir \$PSI3/src/bin/great\_code}

\item {\tt cd \$PSI3/src/bin/great\_code}

\item Copy an existing \file{Makefile.in} from another module: \\
{\tt cp ../cscf/Makefile.in .}

\item Edit the \file{Makefile.in} so that it lists only the source
files for \file{great\_code} and includes in \shellvar{PSILIBS} only
those libraries needed to link the executable.

\item Return to the top of the source tree: {\tt cd \$PSI3}

\item Add the name of \file{great\_code}'s \file{Makefile} to
\file{configure.ac} (near the bottom of the file) and run
\file{autoconf} to generate a new \file{configure} script.

\item Go to the top of the compilation tree: {\tt cd \$prefix}.

\item Re-run the configure script to generate the \file{Makefile} for
\file{great\_code}.  Make sure you use the same options to
\file{configure} that you used before or other \file{Makefile}'s may
not function properly.  The command you used before can be found in
\file{\$prefix/config.status}.  (See also the \PSIthree\ installation
manual for more details on the options to \file{configure}.)

\end{enumerate}

Now you are ready to work on the code.  Changes to source files
(including the \file{Makefile} should be made to the files in
\shellvar{\$PSI3}\file{/src/bin/great\_code} and all compilations
should be run in \file{\$prefix/src/bin/great\_code}.