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 {\cmakeopt XLIFEPP\_LAPACK\_LIB\_DIR} and/or {\cmakeopt XLIFEPP\_BLAS\_LIB\_DIR} to set the directory containing \lapack and \blas libraries:
28
29\begin{lstlisting}[language=]
30cmake [...] -DXLIFEPP_BLAS_LIB_DIR=path/to/Blas/library/directory -DXLIFEPP_LAPACK_LIB_DIR=path/to/Lapack/library/directory path/to/CMakeLists.txt
31\end{lstlisting}
32
33\begin{remark}
34It is useless to use {\cmakeopt XLIFEPP\_LAPACK\_LIB\_DIR} and/or {\cmakeopt XLIFEPP\_BLAS\_LIB\_DIR} options if you do not activates configuration with \umfpack or \arpack
35\end{remark}
36
37\section{Installation and use of \umfpack library}\label{a.s.umfpack}
38
39The 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 \textbf{already installed or compiled} in the user's system. \\
40In order to make use of \umfpack routines, user must configure \cmake with options: {\cmakeopt XLIFEPP\_ENABLE\_UMFPACK}, {\cmakeopt XLIFEPP\_UMFPACK\_INCLUDE\_DIR} and {\cmakeopt XLIFEPP\_UMFPACK\_LIB\_DIR}.
41
42\vspace{.1cm}
43\begin{lstlisting}[language=]
44cmake  -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
45\end{lstlisting}
46\vspace{.1cm}
47
48\begin{remark}
49Theoretically, \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.
50\end{remark}
51
52\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.
53
54In this case, you have a simpler way to define paths: by using {\cmakeopt 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 {\cmakeopt XLIFEPP\_XXX\_INCLUDE\_DIR} and {\cmakeopt XLIFEPP\_XXX\_LIB\_DIR}, where XXX can be AMD, COLAMD, CAMD, CCOLAMD, CHOLMOD, SUITESPARSECONFIG or UMFPACK.
55
56\section{Installation and use of \arpack library}\label{a.s.arpack}
57
58\arpack library can be obtained from the following URL: \url{http://www.caam.rice.edu/software/ARPACK/}. It requires \blas and \lapack routines, so make sure these two libraries are installed in the system. Like \arpack, these two libraries are available under some Unix-like systems.
59
60By default, the intern eigensolver of \xlifepp is used for calculating eigenvalues and eigenvectors. To make use of \arpack instead, users must configure \cmake with options : {\cmakeopt XLIFEPP\_ENABLE\_ARPACK} and {\cmakeopt XLIFEPP\_ARPACK\_LIB\_DIR}.
61
62The current directory is the root directory containing \xlifepp source code. To enable \arpack, we use the command:
63\vspace{.1cm}
64\begin{lstlisting}
65cmake -DXLIFEPP_ENABLE_ARPACK=ON -DXLIFEPP_ARPACK_LIB_DIR=path/to/arpack/libraries/directory path/to/CMakeLists.txt
66\end{lstlisting}
67\vspace{.1cm}
68After configuring, we can make the library
69\vspace{.1cm}
70\begin{lstlisting}
71make
72\end{lstlisting}
73\vspace{.1cm}
74
75\begin{remark}
76\xlifepp uses the wrapper \arpackpp. Because of its deprecation, a patch at \url{http://reuter.mit.edu/index.php/software/arpackpatch/} needs to be applied to ensure a correct compilation. With the evolution of compilers, this patch is often not enough now. This is the reason why \xlifepp contains its own patched release of \arpackpp, used by default.
77\end{remark}
78
79\section{Installation of MinGW 64 bits}\label{s.mingw64}
80
81When you download {\tt CodeBlocks}, the default compiler is MinGW 32bits. To use the full capabilities of \xlifepp, you may want to use a 64 bits compiler. 2 ways to download MinGW-W64:
82
83\begin{itemize}
84\item Download the installer from the url \url{https://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe?r=&ts=1522254087&use_mirror=netcologne}. The installer
85\item Download the binaries directly from the url from the \url{https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/}. You select the version you need, for instance 7.3.0. You click on "threads-posix" directory, on one of the directories (sjlj, seh, \ldots). Personnally, I would choose the directory having the best download rate per week. FInally, you click on the archive to donwload it.
86\end{itemize}
87