Alternative installation procedure#

Installation process#

The main installation procedure requires Cmake for both the installation and the usage of XLiFE++. Here is an alternative solution that do not use Cmake, and is targeted for Unix-like systems, namely Unix/Linux and macOS, since it needs the execution of a shell script:

  • Download the archive (release or snapshot containing the sources) from https://uma.ensta-paris.fr/soft/XLiFE++/?module=main&action=dl

  • Decompress the archive where the software is expected to be installed in the file system. This can be in the user’s home or at system-wide level, in which case administrator rights will be necessary.

  • Open a terminal and type in the command:

    $ bash {xlifepp_dir}/etc/installLibs
    

    This will create a single library in the xlifepp_dir/lib directory.

XLiFE++ may use other libraries (UmfPack, Arpack, LAPACK, BLAS) or third party software products (Gmsh, Paraview), depending on their presence on the computer. The script installLibs performs the installation automatically, without any user action. This means that these libraries or software products are really used only if they are detected or built.

The installation requires a C++ compiler. The C++ compiler to use can be imposed by the mean of the environment variable CPPCMP before calling the script installLibs (see details in the file xlifepp_dir/etc/installLibs.README). By default, its name is g++, which is the GNU compiler generally used under Linux; under macOS, this will make use of the native compiler shipped with Xcode, but the GNU compiler may be used as well.

The FORTRAN library is needed if Arpack is used. Thus, the name of the FORTRAN compiler, from which is deduced the name of the FORTRAN library, can also be imposed by the mean of the environment variable FCMP. By default, its name is gfortran.

The installation process conforms to the following rules:

  1. If they are not found in the file system, LAPACK and BLAS are not installed, neither any third party software.

  2. UmfPack and Arpack libraries present on the system are used first and foremost.

  3. If Arpack has not been found in the system and if a FORTRAN compiler is available, the Arpack library is built locally.

  4. If UmfPack has not been found in the system, SuiteSparse libraries are built locally.

Some options may be used to alter the default configuration:

-noAmo#
to prevent |xlifepp| from using `Amos`_ library (computation of Bessel functions),#
-noArp#
to prevent |xlifepp| from using `Arpack`_ library,#
-noOmp#
to prevent |xlifepp| from using |omp| capabilities,#
-noUmf#
to prevent |xlifepp| from using `UmfPack`_ (|suitesparse|) libraries.#

Thus, in case of trouble, the installation script may be relaunched with one or more of these options. Using all the options leads to the standalone installation of XLiFE++, which is perfectly allowed. The complete calling sequence is then:

$ bash {xlifepp_dir}/etc/installLibs [-noAmo] [-noArp] [-noOmp] [-noUmf]

Finally, the details of the installation are recorded in the file xlifepp_dir/installLibs.log.

Compilation of a program using XLiFE++#

To use XLiFE++:

  1. Create a new directory to gather all the source files related to the problem to be solved.

  2. In this directory, create the source files. This can be done with any text editor. One of them (only) should be a valid “XLiFE++ main file” (see Step-by-step explanations). For example, start by copying one of the files present in xlifepp_dir/examples.

  3. In a terminal, change to this directory and type in the command:

    $ {xlifepp_dir}/etc/xlmake
    

    This will compile all the C++ source files contained in the current working directory (valid extension are standard ones .c++, .cpp, .cc, .C, .cxx) and create the corresponding executable file, named xlifeppexec.

  4. Launch the execution of the program by typing in:

    $ xlifeppexec
    

    The files produced during the execution are created in the current directory.

Tip

To improve comfort, one can make a link to the script xlmake in the working directory, as suggested in the commentary inside the script:

$ ln -s {xlifepp_dir}/etc/xlmake

Or add xlifepp_dir/etc to the PATH environment variable. In both cases, the command typed in at step 3 above would then reduce to:

$ xlmake

See also

If OpenMP is used, it may be useful to adjust the number of threads to the problem size. Indeed, by default all threads available are used, which may be completely counterproductive for example for a small problem size and numerous threads. The number of threads to use can be modified at program level, generally in the main function, or at system level, by setting the environment variable OMP_NUM_THREADS before the execution is launched, e.g. with a Bourne shell:

$ export OMP_NUM_THREADS=2; ./xlifeppexec

or with a C shell:

$ setenv OMP_NUM_THREADS 2; ./xlifeppexec