Installation
Linux
This procedure has been tested on Ubuntu22.04 (Linux x86).
Open a terminal.
Download Miniconda by running:
$ curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Install Miniconda by running:
$ bash ~/Miniconda3-latest-Linux-x86_64.sh
Accept the license term.
Accept the installation folder.
Accept to initialize Miniconda3.
Close the terminal and open a new one. (base) should appear at the beginning of the terminal line.
To prevent conda’s base environment to be activated when a new terminal is open:
$ conda config --set auto_activate_base false
Create a new Python3.9 environment thanks to Miniconda3:
$ conda create --name pySBOenv python=3.9
Activate the new environment:
$ conda activate pySBOenv
When pySBOenv is activated, (pySBOenv) appears at the beginning of a terminal line.
Install Pygmo(>=2.19.0):
(pySBOenv) $ conda config --add channels conda-forge (pySBOenv) $ conda config --set channel_priority strict (pySBOenv) $ conda install pygmo
Install the other dependencies, either one-by-one:
(pySBOenv) $ pip install numpy>=1.24.2 (pySBOenv) $ pip install mpi4py>=3.1.4 (pySBOenv) $ pip install matplotlib>=3.7.0 (pySBOenv) $ pip install pybnn>=0.0.5 (pySBOenv) $ pip install gpytorch>=1.9.1 (pySBOenv) $ pip install tensorflow-cpu>=2.11.0 (pySBOenv) $ pip install scipy>=1.10.1 (pySBOenv) $ pip install pyDOE>=0.3.8 (pySBOenv) $ pip install pyKriging>=0.2.0 (pySBOenv) $ pip install scikit_learn>=1.2.1 (pySBOenv) $ pip install pyro-ppl>=1.8.4
or by retrieving the requirement file
available hereand running:(pySBOenv) $ pip install -r requirements.txt
Check the dependencies have been properly installed by importing them in Python:
(pySBOenv) $ python >>> import pygmo, numpy, mpi4py, matplotlib, pybnn, gpytorch >>> import tensorflow, scipy, pyDOE, pyKriging, sklearn, pyro
If some error related to GLIBCXX version shows up, update libstdc++.so.6 by running:
(pySBOenv) $ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test (pySBOenv) $ sudo apt update (pySBOenv) $ sudo apt upgrade libstdc++6
Download pySBO by running:
(pySBOenv) $ wget https://github.com/GuillaumeBriffoteaux/pySBO/archive/refs/heads/main.zip
Extract from the archive:
(pySBOenv) $ unzip main.zip
To test the installation, go to the pySBO-main/examples directory and run the parallel Surrogate-Assisted Evolutionary Algorithm:
(pySBOenv) $ mpiexec -n 2 python SAEA.py
Check the outputs directory.
Windows
This procedures has been tested on Windows10.
Install Miniconda3 by following the instructions given at:
https://conda.io/projects/conda/en/latest/user-guide/install/index.html
Once Miniconda3 is installed, open Anaconda Prompt (miniconda3).
Deactivate the base environment:
(base) > conda deactivate
Create a new Python3.9 environment:
> conda create --name pySBOenv python=3.9Activate the new environment:
> conda activate pySBOenvWhen pySBOenv is activated, (pySBOenv) appears at the beginning of the prompt line.
Install Pygmo(>=2.19.0):
(pySBOenv) > conda config --add channels conda-forge (pySBOenv) > conda config --set channel_priority strict (pySBOenv) > conda install pygmo
Install the other dependencies:
(pySBOenv) > pip install numpy>=1.24.2 (pySBOenv) > pip install mpi4py>=3.1.4 (pySBOenv) > pip install matplotlib>=3.7.0 (pySBOenv) > pip install pybnn>=0.0.5 (pySBOenv) > pip install gpytorch>=1.9.1 (pySBOenv) > pip install tensorflow-cpu>=2.11.0 (pySBOenv) > pip install scipy>=1.10.1 (pySBOenv) > pip install pyDOE>=0.3.8 (pySBOenv) > pip install pyKriging>=0.2.0 (pySBOenv) > pip install scikit_learn>=1.2.1 (pySBOenv) $ pip install pyro-ppl>=1.8.4
Check the dependencies have been properly installed by importing them in Python:
(pySBOenv) > python >>> import pygmo, numpy, mpi4py, matplotlib, pybnn, gpytorch, tensorflow, scipy >>> import pyDOE, pyKriging, sklearn, pyro
Download MS MPI from:
https://www.microsoft.com/en-us/download/details.aspx?id=57467
and install it (by running msmpisetup.exe).
Add the MS MPI bin folder (by default C:\Program Files\Microsoft MPI\Bin\) to the %PATH% environment variable. Follow the following tutorial to edit the %PATH% environment variable in Windows.
Download pySBO from
https://github.com/GuillaumeBriffoteaux/pySBO/archive/refs/heads/main.zip
and extract from the archive.
To test the installation, go to the pySBO-main/examples directory from the Anaconda Prompt (miniconda3). Then run:
(pySBOenv) > mpiexec /np 2 python SAEA.py
Check the outputs directory.