1%%%%%%%%%%%%%%%%%%%
2% XLiFE++ is an extended library of finite elements written in C++
3%     Copyright (C) 2014  Lunéville, Eric; Kielbasiewicz, Nicolas; Lafranche, Yvon; Nguyen, Manh-Ha; Chambeyron, Colin
4%
5%     This program is free software: you can redistribute it and/or modify
6%     it under the terms of the GNU General Public License as published by
7%     the Free Software Foundation, either version 3 of the License, or
8%     (at your option) any later version.
9%     This program is distributed in the hope that it will be useful,
10%     but WITHOUT ANY WARRANTY; without even the implied warranty of
11%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12%     GNU General Public License for more details.
13%     You should have received a copy of the GNU General Public License
14%     along with this program.  If not, see <http://www.gnu.org/licenses/>.
15%%%%%%%%%%%%%%%%%%%
16
17\section{Installation and use of \blas and \lapack libraries}\label{a.s.blas}
18
19Using \umfpack or \arpack means using \blas and \lapack libraries. \xlifepp offers the ability to choose your \blas/\lapack installation :
20
21\begin{itemize}
22\item Using \blas/\lapack installed with \umfpack or \arpack
23\item Using default \blas/\lapack installed on your computer
24\item Using standard \blas/\lapack libraries, such as \openblas.
25\end{itemize}
26
27To do so, you juste have to use {\bf XLIFEPP\_LAPACK\_LIB\_DIR} and/or {\bf XLIFEPP\_BLAS\_LIB\_DIR} to set the directory containing \lapack and \blas libraries:
28\begin{lstlisting}[language=]
29cmake [...] -DXLIFEPP_BLAS_LIB_DIR=path/to/Blas/library/directory -DXLIFEPP_LAPACK_LIB_DIR=path/to/Lapack/library/directory path/to/CMakeLists.txt
30\end{lstlisting}
31
32\begin{remark}
33It is useless to use {\bf XLIFEPP\_LAPACK\_LIB\_DIR} and/or {\bf XLIFEPP\_BLAS\_LIB\_DIR} options if you do not activates configuration with \umfpack or \arpack
34\end{remark}
35
36\section{Installation and use of \umfpack library}\label{a.s.umfpack}
37
38The prerequisite to make use of \umfpack is to have it installed or at least its libraries are compiled. The {\lib umfpackSupport} can be linked with or without \umfpack in case of none of its functions is invoked. Otherwise, any try to use its provided functions can lead to a linkage error. Details to compile and install \umfpack can be found at \url{http://www.cise.ufl.edu/research/sparse/umfpack/}. All the steps will be described below supposing \umfpack {\bfseries already installed or compiled} in the user's system. \\
39In order to make use of \umfpack routines, user must configure \cmake with options: {\bf XLIFEPP\_ENABLE\_UMFPACK}, {\bf XLIFEPP\_UMFPACK\_INCLUDE\_DIR} and {\bf XLIFEPP\_UMFPACK\_LIB\_DIR}.
40
41\vspace{.1cm}
42\begin{lstlisting}[language=]
43cmake  -DXLIFEPP_ENABLE_UMFPACK=ON -DXLIFEPP_UMFPACK_INCLUDE_DIR=path/to/UMFPACK/include/directory -DXLIFEPP_UMFPACK_LIB_DIR=path/to/UMFPACK/library/directory path/to/CMakeLists.txt
44\end{lstlisting}
45\vspace{.1cm}
46
47\begin{remark}
48Theoretically, \umfpack does not need to use \blas/\lapack, but as it is highly recommended by \umfpack (for accuracy reasons), \xlifepp demand that you use \blas/\lapack.
49\end{remark}
50
51\umfpack is provided by \suitesparse. When looking how \umfpack is compiled, it seems that it can depend (maybe in the same way as \blas/\lapack) from other libraries provided by \suitesparse.
52
53In this case, you have a simpler way to define paths: by using {\bf XLIFEPP\_SUITESPARSE\_HOME\_DIR}. When given alone, it consider the given directory as the home directory containing every library provided by \suitesparse with a specific tree structure. If it is not the case, you can use more specific options of the form {\bf XLIFEPP\_XXX\_INCLUDE\_DIR} and {\bf XLIFEPP\_XXX\_LIB\_DIR}, where XXX can be AMD, COLAMD, CAMD, CCOLAMD, CHOLMOD, SUITESPARSECONFIG or UMFPACK.
54
55\section{Installation and use of \arpackpp library}\label{a.s.arpackpp}
56
57\arpackpp distribution can be obtained from the following URL: \url{http://www.ime.unicamp.br/~chico/arpack++/}. However, because of the deprecation of this version, a patch at \url{http://reuter.mit.edu/index.php/software/arpackpatch/} needs applied to make sure a correct compilation. Users of Unix-like system can follow the instructions on \url{https://help.ubuntu.com/community/Arpack%2B%2B} to make the patch. And this patch is often not enough to compile correctly with recent compilers. \\
58So \xlifepp contains its own patched release of \arpackpp, used by default.
59
60\medskip
61
62Because \arpackpp is an interface to the original \arpack \fortran library, this library must be available when installing the \cpp code. Although \fortran files are not distributed along with \arpackpp, they can be easily downloaded from Netlib and are even available under some Unix-like systems.
63
64The \blas and \lapack routines are required by the \arpack \fortran, so make sure these two libraries are installed in the system. Like \arpack, these two libraries are available under some Unix-like systems.
65
66By default, the intern eigensolver of \xlifepp is used for calculating eigenvalues and eigenvectors. To make use of \arpackpp, users must configure \cmake with options : {\bf XLIFEPP\_ENABLE\_ARPACK} and {\bf XLIFEPP\_ARPACK\_LIB\_DIR}.
67
68The current directory is the root directory containing \xlifepp source code. To enable \arpack, we use the command:
69\vspace{.1cm}
70\begin{lstlisting}
71cmake -DXLIFEPP_ENABLE_ARPACK=ON -DXLIFEPP_ARPACK_LIB_DIR=path/to/arpack/libraries/directory path/to/CMakeLists.txt
72\end{lstlisting}
73\vspace{.1cm}
74After configuring, we can make the library
75\vspace{.1cm}
76\begin{lstlisting}
77make
78\end{lstlisting}
79\vspace{.1cm}
80