Aller au contenu principal

[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
Lire la suite 

Contenu à venir...


LINUX
Lire la suite 

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. Copier VIABLAB à partir de GitHub 

  • Cloner le dépôt : 

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

      Ouvrir FileExplorer, créer le répertoire dev-cpp qui va contenir le programme et les résultats et y dézipper VIABLAB-main.zip. 

Step 3. Compiler VIABLAB 

Vous êtes maintenant prêts à compiler le code de ViabLab. 

D'abord, aller dans le répertoire build (le créer s'il n'existe pas) de VIABLAB-main dans un terminal (le chemin dépend de votre installation). Par exemple : 

cd dev-cpp/VIABLAB-main/build/

Ensuite, exécuter la commande cmake : 

cmake ../source

En cas d'erreur pendant le cmake, aller dans le répertoire build et effacer complètement son contenu avant de relancer la commande cmake.

La commande cmake ne doit être exécutée qu'à la première installation ; ensuite, la commande make ci-dessous sera suffisante pour compiler le code : 

make

Lorsque la compilation est terminée, l'exécutable viabLab.exe est généré dans le répertoire build. 

 


WINDOWS 
Lire la suite 

 

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.