Skip to main content

Viablab

[Texte] Installation ViabLab à partir de GitHub

Niveau de difficulté
Thématique
Présentation formation

How to install and compile ViabLab from GitHub

Contenu
MAC OS
Read more 

Step 1. Copy VIABLAB from GitHub 

Go to https://github.com/lastre-viab/VIABLAB, click on Code button and download the ZIP file VIABLAB-main.zip. 

Open Finder, create the folder viablab that will contain the  program and results and unzip VIABLAB-main.zip there. 

Step 2. Prerequisite

Go to the VIABLAB-main folder and verify the build folder is empty (create it if it doesn't exist). 

Open a terminal and go to the created folder VIABLAB-main/build. With the example folder shown above :

cd viablab/VIABLAB-main/build

  • Install gcc/g++. To verify gcc and g++ are installed :
which gcc
which g++

If not installed :

brew update
brew install gcc
brew install g++
  • Install cmake
brew install cmake
  • Install external libraries
brew install boost
brew install spdlog
brew install libomp
  • [PAS UTILE A NE PAS FAIRE tout ce qui est ci dessous aller au step 3]Install cmake 3.13.5. To verify the correct version is installed :
which cmake

If not installed or not the correct version, uninstall cmake :

brew uninstall --force cmake brew cleanup -s cmake 

Then command which cmake should answer cmake not found.

Download cmake-3.13.5-Darwin-x86_64.tar at https://github.com/Kitware/CMake/releases/tag/v3.13.5 

Verify cmake version :

ls ~/Downloads | grep cmake cmake-3.13.5-Darwin-x86_64.tar 

Go to download folder and unzip the archive

cd ~/Downloads tar -xvf cmake-3.13.5-Darwin-x86_64.tar

 Move the folder to viablab folder : 

 mv cmake-3.13.5-Darwin-x86_64 ~/<your path>/viablab/cmake 

Verify the version :

~/<your path>/viablab/cmake/CMake.app/Contents/bin/cmake --version

should answer cmake version 3.13.5.

Add cmake command to global PATH global to use it more easily :

nano ~/.zshrc

 Add the following line at the end of file :

 export PATH="$HOME/Desktop/viablab/cmake/cmake-3.13.5-Darwin-x86_64/CMake.app/Contents/bin:$PATH" 

Save and quit :  Ctrl + X, then Y, and Return).

 Apply the modifications :

source ~/.zshrc

[REPRENDRE L'INSTALLATION ICI]

Step 3. Build VIABLAB 

  • in Finder , Shift + command + G  to go to the folder /opt
  • Go to homebrew folder and find inside the subfolder libopm
  • Check the path and compare it with the one used in VIABLAB-main/source/CmakeLists.txt file lines 10,11 and 13. Substitute your path if necessary.

You are now ready to build VIABLAB code. 

Go back to the terminal, ensure that it is open in VIABLAB-main/build

Then cmake command : 

cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../source

[A SAUTER REPRENDRE QUAND C EST ECRIT ON REPREND ICI ]

Si 1 ne fonctionne pas :

[2 - First, replace the CMakeLists.txt file in VIABLAB-main/source by this file CMakeLists.txt
In the new CMakeLists.txt file, replace the content below the line <## Substitute the text within the parentheses with your ... path> with your own file paths.

Then go to the build folder :

cd build

and the cmake command :

cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../source

[ON REPREND ICI]

Note that cmake command must be executed only once, on first installation; further, only the make command below will be sufficient to build the code : 

make

Or to use all the Mac's CPUs to speed up compilation :

make -j$(sysctl -n hw.logicalcpu)

Once the compilation process finished, the executable viabLab.exe is created in build folder. 

 


Linux 
Read more 

FEDORA : 

Step 1. Installation des dépendances

  • Mettre à jour le manager de paquets apt :

sudo dnf update
  • Installer les compilateurs C/C++:   

 Pour vérifier si gcc/g++ sont installés, dans un terminal : 

gcc --version
g++ --version

Si gcc/g++ ne sont pas installés sur votre système :        

sudo dnf install gcc
sudo dnf install g++
  • Installer Cmake (version >= 3.22.1) : 

Pour vérifier si cmake est installé et connaitre sa version, dans un terminal :

cmake --version

Si ce n'est pas la bonne version , supprimer les versions existantes de CMake, dans un terminal :

sudo dnf remove cmake

Puis

sudo dnf install cmake
  • Installer git (optionnel - si on souhaite cloner la dernière version de travail du code)

sudo dnf install git
  • Installer les librairies externes open source

sudo dnf install boost-devel
sudo dnf install spdlog-devel
sudo dnf install libcurl-devel

Step 2. Copy VIABLAB from GitHub 

  • Cloner le dépôt : 

git clone https://github.com/lastre-viab/VIABLAB.git

      Open FileExplorer, create the folder dev-cpp that will contain the  program and results and unzip VIABLAB-main.zip there. 

Step 3. Build VIABLAB 

You are now ready to build VIABLAB code. 

First, go to the build folder (create it if it doesn't exist) of VIABLAB in bash (depending on your personal installation). With the example folder shown above : 

cd dev-cpp/VIABLAB-main/build/

Then cmake command : 

cmake ../source

If an error occurs during cmake, go to the build directory and completely delete its contents before restarting the cmake command.

Note that cmake command must be executed only once, on first installation; further, only the make command below will be sufficient to build the code : 

make

Once the compilation process finished, the executable viabLab is created in build folder. 

 

UBUNTU :

Step 1. Installation des dépendances

  • Mettre à jour le manager de paquets apt :

sudo apt update
  • Installer les compilateurs C/C++:   

 Pour vérifier si gcc/g++ sont installés, dans un terminal : 

gcc --version
g++ --version

Si gcc/g++ ne sont pas installés sur votre système :        

sudo apt install gcc
sudo apt install g++
  • Installer Cmake (version >= 3.22.1) : 

Pour vérifier si cmake est installé et connaitre sa version, dans un terminal :

cmake --version

Si ce n'est pas la bonne version , supprimer les versions existantes de CMake, dans un terminal :

sudo apt remove --purge cmake

Puis

sudo apt install cmake
  • Installer git (optionnel - si on souhaite cloner la dernière version de travail du code)

sudo apt install git
  • Installer les librairies externes open source

sudo apt install libboost-all-dev
sudo apt install libspdlog-dev
sudo apt install libcurl4

Step 2. Copy VIABLAB from GitHub 

  • Cloner le dépôt : 

git clone https://github.com/lastre-viab/VIABLAB.git

      Open FileExplorer, create the folder dev-cpp that will contain the  program and results and unzip VIABLAB-main.zip there. 

Step 3. Build VIABLAB 

You are now ready to build VIABLAB code. 

First, go to the build folder (create it if it doesn't exist) of VIABLAB in bash (depending on your personal installation). With the example folder shown above : 

cd dev-cpp/VIABLAB-main/build/

Then cmake command : 

cmake ../source

If an error occurs during cmake, go to the build directory and completely delete its contents before restarting the cmake command.

Note that cmake command must be executed only once, on first installation; further, only the make command below will be sufficient to build the code : 

make

Once the compilation process finished, the executable viabLab is created in build folder. 

 


WINDOWS 
Read more 

 

Step 1. Install MSYS2 

Follow instructions from https://www.msys2.org/

Download and run the installer :

Welcome to the MSYS2 Setup 

Choose the installation folder :

Installation folder

 

Follow installation steps : 

Installation steps

Wait for installation process to finish : 

Wait...

 

then click on Finish : 

Finish

Once installed, the MinGW64 bash can be launched from Windows menu :

Windows menu

MinGW64

 

Step 2. Install compiler tools and dependencies

Msys provides the package manager , called pacman, that can be used to install all necessary tools and dependencies Doc here : https://www.msys2.org/docs/package-management/

You will need to install the following packages ( you can use the commands below provided for each of them, or look for in https://packages.msys2.org/queue and choose Mingw64 binaries) : 

  • GCC: pacman -S mingw-w64-x86_64-gcc

  • CMake: pacman -S mingw-w64-x86_64-ccmake

  • Make: pacman -S mingw-w64-x86_64-make

  • Boost: pacman -S mingw-w64-x86_64-boost

  • Dlfcn: pacman -S mingw-w64-x86_64-dlfcn

  • Spdlog: pacman -S mingw-w64-x86_64-spdlog

To finish the installation, add into System Path variable the path to Mingw64 binaries C:\msys64\mingw64\bin:

Add path variable

 

After this operation you may need to restart your computer to ensure that the Path modifications are well registered. 


Step 3. Copy VIABLAB in MSyS folder 

Go to https://github.com/lastre-viab/VIABLAB, click on Code button and download the ZIP file VIABLAB-main.zip. 

By default the MSyS shell is open in /home/username folder. You can see it in FileExplorer 



 

Open this folder in FileExplorer, create the folder dev-cpp that will contain the  program and results and unzip VIABLAB-main.zip there. Example : 


Step 4. Install Eclipse (Integrated development environment) (optional)

Go to  https://www.eclipse.org/downloads/packages/release/kepler/sr2/eclipse-ide-cc-developers

Click on "download", again "download".

Once downloaded, run the installer and choose  Eclipse IDE for C/C++ developers.

Click on ‘’launch’’, and 'launch" again.

Step 5. Build VIABLAB in MSyS folder 

Go back to the MSyS MINGW64 shell . You are now ready to build VIABLAB code. 

First, go to the build folder (create it if it doesn't exist) of VIABLAB in bash (depending on your personal installation). With the example folder shown above : 

cd dev-cpp/VIABLAB-main/build/

Then cmake command : 

  • cmake -G"MinGW Makefiles" -D BUILD_LIB=OFF ../source

  • If you use Eclipse C++ IDE, you can use the cmake command below to generate Eclipse project settings and enable debugging in Eclipse :

    cmake -G"Eclipse CDT4 - MinGW Makefiles" -D CMAKE_BUILD_TYPE=Debug -D BUILD_LIB=OFF ../source

    After running CMake, the project is ready to be imported into Eclipse: the build directory (initially empty) contains the data generated by CMake.

    In Eclipse, go to the File menu => Import and select the Existing Projects into Workspace option.

    Click Next.

    Then, in the following window, select the build directory.

    Click Finish.

    After the import, you will see the project tree in the left panel.

Note that cmake command must be executed only once, on first installation; further, only the make command below will be sufficient to build the code : 

mingw32-make

Once the compilation process finished, the executable viabLab.exe is created in build folder. 

 

[Texte] Calculs de viability-theory.org dans ViabLab en anglais

Niveau de difficulté
Thématique
Présentation formation

Reproduire les calculs des exemples de viability-theory.org :

Aller sur la page du cas d'usage choisi, par exemple l'exemple de Julia, et télécharger les deux fichiers .h et .json associés à l'implémentation dans Viablab.

Copier le fichier .json dans le répertoire ~/ViabLabGui/bin/VIABLAB/INPUT et le fichier .h dans le répertoire  ~/ViabLabGui/bin/VIABLAB/source/data/ 

Editer le fichier ~/ViabLabGui/bin/VIABLAB/source/data/ModelDataInclusion.h

Remplacer la ligne qui commence par string paramsFile avec le nom du fichier .json que vous venez de copier. Par exemple, si ce fichier s'appelle toto .json, il faut écrire écrire :

string paramsFile = "toto.json";

Remplacer dans la ligne qui commence par #include, le nom du fichier .h par celui du fichier que vous venez de copier : si ce fichier se nomme data_toto.h, écrire

#include  "../data//data_toto.h"

Enregistrer le fichier ModelDataInclusion.h

Retourner dans le répertoire ~/ViabLabGui/bin/VIABLAB/build :

 

Pour Linux : 

make

pour créer le fichier exécutable viabLabExe, puis, pour l'exécuter :

./viabLabExe

 

Pour MacOS : 

Générer avec make (en utilisant tous les CPU du Mac pour accélérer la compilation)

make -j$(sysctl -n hw.logicalcpu)

Pour exécuter viabLabExe

 ./viabLabExe 

 

 

Vous venez de lancer le calcul de noyau de viabilité identique à celui du site !

 

[Texte] Fichiers de sortie de ViabLab en anglais

Niveau de difficulté
Thématique
Présentation formation

Les fichiers de sortie de ViabLab

Les fichiers sorties de ViabLab se trouvent dans le répertoire ~/ViabLabGui/bin/VIABLAB/OUTPUT.

Un calcul génère plusieurs fichiers qui sont nommés avec le même préfixe.

Le fichier <prefixe>-grid_data.dat contient les informations sur le grille régulière sur laquelle est basée le calcul, ci-dessous un exemple :

2  ---- nombre de dimensions de l'espace des états
-2 ---- première coordonnée du point inférieur (dans toutes les dimensions) de la grille 
-2 ---- deuxième (ici seconde puisqu'on est en dimension 2) coordonnée du point inférieur (dans toutes les dimensions) de la grille
2  ---- première coordonnée du point supérieur (dans toutes les dimensions) de la grille
2  ---- deuxième (ici seconde puisqu'on est en dimension 2) coordonnée du point inférieur (dans toutes les dimensions) de la grille
4001 -- nombre de points de la grille selon le premier axe
4001 -- nombre de points de la grille selon le second axe
0
0     Anya HELP !
1
1

Le fichier <prefixe>-viab.dat contient les coordonnées des points de la grille suivies de 0.0 si le point n'appartient pas au noyau calculé et 1.0 s'il y appartient ; le nombre de colonnes est donc égale au nombre de dimensions de l'espace des états plus 1.

Le fichier <prefixe>-viab-bound.dat contient la liste des coordonnées des points de la grille qui ont au moins un voisin qui n'appartient pas au noyau calculé. Ils représentant la frontière de ce noyau.

[Texte] Installation ViabLab with Gui v3.0

Niveau de difficulté
Thématique
Présentation formation

Sous MAC

Pas possible pour le moment, le fichier binaire n'est disponible que pour Linux et Windows, il faut cloner à partir d'un dépôt.

 

Sous LINUX

Prérequis : 

  • Avoir installé g++ :   

 Pour vérifier si g++ est installé, dans un terminal : 

g++ --version

Si g++ n'est pas encore installé sur votre système :        

sudo apt install g++
  • Avoir installé cmake version 3.22.1 : 

Pour vérifier si cmake est installé et connaitre sa version, dans un terminal :

cmake --version

Si ce n'est pas la bonne version , supprimer les versions existantes de CMake, dans un terminal :

sudo apt remove --purge cmake

Vérifier la version de votre Ubuntu, dans un terminal : 

lsb_release -a

 Si votre version est 22.04, installer CMake 3.22.1 automatiquement :

    sudo apt update
    sudo apt install cmake

Si votre version n’est pas 22.04, installer les dépendances nécessaires :
 

    sudo apt update
    sudo apt install -y build-essential libssl-dev

 Télécharger CMake 3.22.1 :

       wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1.tar.gz

  Extraire l'archive :

    tar -zxvf cmake-3.22.1.tar.gz
    cd cmake-3.22.1

    Construire et installer :

    ./bootstrap
    make -j$(nproc)      # Compiles using all available CPU cores
    sudo make install

Vérifier la version de cmake, dans un terminal :

cmake --version

Doit afficher  cmake version 3.22.1.

  • Avoir installé l'IDE Eclipse (facultatif)

    sudo apt-get install -y eclipse-cdt

 

Installation de Viablab :

chmod +x InstallerViabLabGui_v1_linux.run
  • Pour exécuter l'installeur
./InstallerViabLabGui_v1_linux.run
  • Next - Next - Next - Install - Finish
  • Puis se placer à l’aide de la commande cd dans le répertoire build : ~/ViabLabGui/bin/VIABLAB/build  
  • puis, pour une utilisation sans l'IDE Eclipse :
cmake -G "Unix Makefiles" ../source
make

 L'exécutable viabLabExe apparaît dans le répertoire build ! 

  • ou, pour une utilisation avec Eclipse :
cmake -D_ECLIPSE_VERSION=4.5 -DCMAKE_BUILD_TYPE=Debug ../source -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE

 

Sous WINDOWS :

Prérequis : 

  • Avoir installé MinGW, une distribution de compilateurs C/C++ GNU pour Windows :   

 A l'adresse https://sourceforge.net/projects/mingw/files/latest/download , téléchargez l'application MinGW Installation Manager.

Ouvrir cette application 

Dans le panneau gauche, développer All packages => MinGW, sélectionner MinGW Base System. Sélectionner dans la liste des packages tous les packages dont le nom contient « pthread », choisir Mark For Installation. Faire de même pour les packages gcc, omp, g++, libstd, mingw s’ils ne sont pas sélectionnés.

Une fois les packages sélectionnés, dans le menu Installation, cliquer sur Apply changes et attendre la fin d’installation.

Ajouter l’emplacement de l’installation MinGW dans la variable PATh du système :

Dans paramètres/settings du système, on cherche environmental/environnement et on clique dans «edit environment variables for your account »

Aller dans Path, edit, new et on copie colle : C:\MinGW\bin

Eteindre et redémarrer l'ordinateur.
 

  • Avoir installé cmake version 3.31.7:

Pour vérifier si cmake est installé et connaitre sa version, dans un terminal :

??

Si ce n'est pas la bonne version , supprimer les versions existantes de CMake, dans un terminal :

??

 Aller à l'adresse https://github.com/Kitware/CMake/releases/download/v3.31.7/cmake-3.31.7-windows-x86_64.msi pour télécharger le Windows x64 installer.

Vérifier la version de cmake, dans un terminal :

????

Doit afficher  cmake version 3.31.7.

  • Avoir installé Eclipse Environnement de développement intégré) (facultatif) :  

Aller à l'adresse  https://www.eclipse.org/downloads/packages/release/kepler/sr2/eclipse-ide-cc-developers

Cliquer sur download, à nouveau sur download.

Une fois téléchargé, cliquer sur l’installeur et chosir  Eclipse IDE for C/C++ developers

On ‘’launch’’ par la suite (première exécution pour voir que tout fonctionne)

On ‘’launch’’ de nouveau.

 

Installation de Viablab :

??
  • Pour exécuter l'installeur
??
  • Next - Next - Next - Install - Finish
  • Puis ouvrir un PowerShell, se placer à l’aide de la commande cd dans le répertoire build : ~/ViabLabGui/bin/VIABLAB/build  
  • puis, pour une utilisation sans l'IDE Eclipse :
cmake -G "MinGW Makefiles" ../source
make

 L'exécutable viabLabExe apparaît dans le répertoire build

  • ou, pour une utilisation avec Eclipse :
cmake -G"Eclipse CDT4 - MinGW Makefiles" -D CMAKE_BUILD_TYPE=Debug ../source

Après l’exécution de cmake le projet est prêt pour être importé dans Eclipse : le répertoire build ( vide au début) contient les données générées par cmake.

Dans Eclipse, aller dans le menu File => Import et sélectionner l’option Existing Projects into Workspace

Cliquer sur Next

Ensuite dans le fenêtre suivante sélectionner le répertoire build

Cliquer sur Finish

Après l’import on voit l’arborescence du projet dans le panneau gauche

Théorie mathématique de la viabilité en anglais

Université des Antilles, Pôle Martinique
01-08-2025
20
Niveau de difficulté
Présentation de l'atelier

Cet atelier propose une introduction appliquée à la théorie de la viabilité, notamment dans le cadre des écosystèmes soumis à des contraintes environnementales. Les participants exploreront comment formaliser des politiques durables de gestion à l’aide d’algorithmes de viabilité, et comment modéliser la résilience d’un système via des cas concrets comme l’eutrophisation d’un lac ou la gestion d'une population.

Objectifs de l'atelier
  • Comprendre les bases mathématiques de la viabilité dynamique.
  • Utiliser des modèles simples pour représenter des contraintes écologiques.
  • Manipuler un simulateur interactif pour visualiser les trajectoires viables.
  • Favoriser les échanges entre chercheurs, étudiants et praticiens.
Programme

LUNDI 27 avril

LUNDI 27 AVRIL

8h15 - Rendez-vous de l’ensemble des participants devant la Bibliothèque Universitaire

 

SESSION 1 : POSER UN PROBLEME EN VIABILITE

Animateur : Bates – De Lapparent - Lavallée - Désilles

8h30 - 8h50 La viabilité mathématique en question ? (Samuel Bates)

8h50 - 9h50 Concept et illustration du noyau de viabilité (François Lavallée)

Pause & discussion

10h00-11h15 Formuler mathématiquement un problème de viabilité (François Lavallée)

11h15-12h00 Cas de résolution analytique de la viabilité (François Lavallée)

Déjeuner

13h30-14h15 Cas de résolution numérique de la viabilité (François Lavallée)

14h15-15h00 Cas de résolution de viabilité avec cible terminale (François Lavallée)

Pause & discussion

15h15-16h00 Cas de résolution de viabilité en situation de risque (François Lavallée)

16h00-16h45 Cas de résolution de viabilité en situation d’incertitude (François Lavallée)

Pause & discussion

17h00-17h45 Cas de résolution de viabilité multi-agent (Alice De Lapparent)

 

MARDI 28 AVRIL

SESSION 2 : L’INFORMATIQUE DE LA VIABILITE

Animateur : Désilles - Lavallée

 

8h00-9h00 Préparation à l’informatique de la viabilité (Anya Désilles)

9h00-10h30 Présentation du logiciel Viablab (Anya Désilles)

Pause & discussion

10h45-11h15 Enjeux informatiques sur les noyaux de viabilité (Anya Désilles)

11h15-12h00 Enjeux informatiques sur les trajectoires de viabilité (Anya Désilles)

Déjeuner

13h30-15h30 Atelier de manipulation du Logiciel autour d’un cas d’étude (1/2) (François Lavallée & Anya Désilles)

Pause & discussion

15h45-17h45 Atelier de manipulation du Logiciel autour d’un cas d’étude (2/2) (François Lavallée & Anya Désilles)


MERCREDI 29 AVRIL

SESSION 3 : ATELIERS THEMATIQUES D’APPLICATION

Animateurs Désilles - Gloglo

 

8h00-10h00 Atelier autour de AgroViablab : Illustration vers une montée en
complexité (Anya Désilles)

Pause & discussion

10h15-12h15 Brainstorming autour d’AgroViablab (collectif)

Déjeuner

13h45-15h45 Atelier d’application sur un système monétaire : Illustration vers une simplification de complexité (Beringer Gloglo)

15h45-17h45 Brainstorming sur les applications (collectif)


18h00-19h00 Séminaire sur la viabilité en économie monétaire (en marge de l’école chercheur à destination des étudiants de Master d’économie) (Beringer Gloglo, Samuel Bates)

 

JEUDI 30 AVRIL



 

SESSION 4 : MODELISATION EN VIABILITE

8h00-09h00 Brainstroming autour d’un 1er sujet de modélisation (collectif)

9h00-10h00 Brainstroming autour d’un 2e sujet de modélisation (collectif)

Pause & discussion

10h15-11h15 Brainstroming autour d’un 3e sujet de modélisation (collectif)

11h15-12h00 Retour d’expériences



 

Déjeuner & clôture hors les murs (13h00-17h00 : Saint-Pierre)

Description localisation

L'atelier aura lieu à l'Université des Antilles, Pôle Martinique

14.620041056675, -61.0940054

Intervenant(s)
M. Samuel Bates, Contenu à venir !
De Lapparent Alice
François Lavallée
Anya Désilles
Béringer Gloglo
Liste des participants
Science économique

- Pablo Andres-Domenech
- Valérie Angeon
- Samuel Bates
- Abdoul Cisse
- Issaka Dialga
- Beringer Gloglo
- Thaly Janloup
- Eric Kamwa
- Kevin Spinassou

Mathématique

- Severine Andouze/Bernard
- James Larrouy
- François Lavallée
- Loïc Louison
- Paul Silvere Nuiro

Géographie

- Etienne Delay
- Pastel Audrey

Agronomie

- Alice De-Lapparent

Informatique

- Anya Désilles