Installing igatools

Massimiliano Martinelli edited this page Mar 18, 2016 · 16 revisions

Currently, to install igatools you need to compile it from its sources. Below there are some explanatory steps to guide you through the process.

The library is developed and tested on Unix-like architectures (Linux, Mac OS X). The compilation and installation on Windows machines is not tested and is not supported by the igatools main developers.

In order to get the source code, you can download from the GitHub Download ZIP button or you can use git to download the library from the GitHub repository.


Prerequisites pre-installation

To configure and compile the sources you need to have the following programs available in your system:

  • CMake;
  • a modern C++14 compiler (some notes about the compiler choice can be found here);
  • a python interpreter (from our experience, this was usually pre-installed in all Linux/Mac OS X machine we have tested).

In order to generate the documentation from the code (optional), you need to have the following programs

If you are a Linux user we assume you know how to install the appropriate packages for your distribution.

Additionally, igatools relies on some libraries that also need to be available in your system:

Other libraries may be needed if you configure igatools in order to use some parts that are not active by default (more details about the configuration options can be found here).


The installation process

In order to be general and flexible, in the installation process we'll use the following environment variables that you can set to point to some (existing) directories, at your choice (the only constraint is that the source directory and the build directory cannot be the same).

Variable name Description
IGATOOLS_SOURCE Directory where the igatools sources are stored (i.e. the directory that is used to clone the GitHub repository)
IGATOOLS_WS The directory used as workspace, i.e. where the library is build (configured, compiled and linked)
IGATOOLS_PREFIX The directory where the library will be installed after the build phase
TRILINOS_PREFIX The directory where the Trilinos libraries are installed

In all the steps below, we assume that the shell used is Bash and the above environment variables are defined with your system paths. They are usually defined at the start-up of the shell. Moreover, for better undestanding, we set IGATOOLS_SOURCE to point to ~/igatools and IGATOOLS_WS to point to ~/build_igatools.

After the directories are created and the above environment variables set, we clone the igatools repository into the ${IGATOOLS_SOURCE} directory

~$ git clone https://github.com/igatoolsProject/igatools.git ${IGATOOLS_SOURCE}

After the clone process we move into the ${IGATOOLS_WS} directory and we launch the cmake command in order to populate the workspace with the needed files:

cd ${IGATOOLS_WS}
cmake ${IGATOOLS_SOURCE} \
   -DTrilinos_PREFIX=${TRILINOS_PREFIX} \
   -DCMAKE_INSTALL_PREFIX=${IGATOOLS_PREFIX} \
   -DCMAKE_CXX_COMPILER=clang++

At the end of a successful cmake configuration, is a good idea to export the igatools path to the library path. This depends on your system (Linux or Mac OS X) and shell but basically you need to add to your .bash_login or .bash_rc something like

  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IGATOOLS_PREFIX/lib

for Linux machines and

  export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$IGATOOLS_PREFIX/lib

for Mac OS X.

Then we launch the compilation (with a certain number of threads, depending on the machine...here we use 5) and the installation of the library, and optionally the generation of the documentation (the path for documentation main page will be ${IGATOOLS_PREFIX}/doc/index.html)

 ~$ make -j5 install
 ~$ make doc

Post-installation

After the installation we suggest to check if everything is ok running the tests that come with the library. In order to do so, you should move into the test directory and run the ctest -jN command (where N is the number of threads tou want to use to run the tests)

 ~$ cd $IGATOOLS_WS/tests
 ~$ ctest -j5

Please note that the success of the tests depends on which set of configuration options have been used to compile igatools. In order to have most of the tests passing, we suggest to activate USE_NURBS, MESH_REFINEMENT, SERIALIZATION, XML_IO.

The tests named with the suffix -bug are not passing (usually they refers to some old version of the library and are under revision).

After installing the library and running the tests, the suggested starting point for a new user is the tutorial. The tutorial consists of a set of simple example programs, each of which teaches the user some use of the library. They also suggest the user some modifications to allow him for hands-on learning. To access the tutorial start your browser and open the documentation main page ${IGATOOLS_PREFIX}/doc/index.html.

 ~$ firefox $IGA_PREFIX/doc/html/index.html

To access the tutorial click the Tutorial link on the left.

In order to do the exercises you need to modify a source file. This will require a text editor, is up to you to pick one. Be advised (in case this is your first time dealing with a C++ project) that there many convenient development environments (IDE). Some examples are Eclipse, KDevelop, XCode, Emacs, Vim, etc.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.