<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\chapter{Application makefile}
\label{s:application makefile}

In this section, the organization of the application makefile is
described which is used for the examples in this tutorial. The same
organization can be used for other user applications, too.

In the first block, user flags and directories are specified. 

\begin{verbatim}
# ============================================================================
# ===== flags and directories (to be modified by the user) ===================
# ============================================================================

USE_PARALLEL_AMDIS = 0      
USE_OPENMP = 0              
USE_UMFPACK = 1             
USE_MKL = 0                 
USE_SERVER =                
USE_COMPILER = gcc          
DEBUG = 0

AMDIS_DIR = ../AMDiS
MPI_DIR = 
\end{verbatim}

If \verb+USE_PARALLEL_AMDIS+ is set to $1$, parallel applications will
be supported. If AMDiS is compiled with OpenMP supported,
\verb+USE_OPENMP+ must be set to $1$. If you want to make use of
UMFPACK oder Intel's Math Kernel Library, set \verb+USE_UMPFACK+ and
\verb+USE_MKL+, repsectively, to $1$. In both cases, AMDiS must be
compiled with the corresponding options. If you run your computations
on one of the high performance computers installed at the TU Dresden,
insert the name of the corresponding system to
\verb+USE_SERVER+. Using the flag \verb+USE_COMPILER+ you may decide
to use either the GNU C++ or the Intel C++ compiler. Note that your
program must be compiled with the same compiler AMDiS has been
compiled with. To the last you can enable the debuge mode in your code
setting \verb+DEBUG+ to $1$.

\verb+AMDIS_DIR+ stores the AMDiS installation path and must be set by
the user. This is the path given to the AMDiS configure script by the
\verb+--prefix+ option. If you have not changed the directory
structure of your AMDiS installation, or you do not want to use some
other AMDiS installation for the demo examples, you do not need to
change the standard value. The value of \verb+MPI_DIR+ is only
required for parallel computations. If you run your parallel
computations on the high performance computers of the TU Dresden, do
not set a value here.

Then the AMDiS makefile is included from the corresponding AMDiSinstallation:

\begin{verbatim}
#==== standard definitions and rules to compile AMDiS user programs ==========
include $(AMDIS_DIR)/other/include/Makefile_AMDiS.mk
\end{verbatim}

Finally, we define rules for the linking of user applications. Here,
we present only the rule for the \verb+ellipt+ application. Other
applications can be created in an analog way.

\begin{verbatim}
# ============================================================================
# ===== user programs ========================================================
# ============================================================================

VPATH = .:./src

# ===== myprog ===============================================================

ELLIPT_OFILES = ellipt.o

ellipt: $(ELLIPT_OFILES)
        $(LINK) $(CPPFLAGS) -o ellipt $(ELLIPT_OFILES) $(LIBS)
\end{verbatim}

The \verb+VPATH+ variable contains all pathes, where sources can be
located. The \verb+ellipt+ rule first creates all needed object files
defined in \verb+ELLIPT_OFILES+. In this example, only \verb+ellipt.o+
is needed. Then all needed object files and libraries are linked
together. The \verb+-o+ option specifies that the executable will be
written to the file \verb+ellipt+.
</pre></body></html>