-
cdinto the folder whereDockerfileis. -
Create a docker ubuntu system image for installing SU2:
docker build -t su2 .(-tto specify image name assu2, and.means using theDockerfilein this folder) -
Create a docker image for installing SU2 by executing
./create_su2_container.sh -
Create a docker container for installing SU2 by executing
./start_su2.sh -
Now, you should be in docker container, and the current path in docker container should correspond to
testfolder in your host system. Runls, you can see two files:Miniconda3-latest-Linux-x86_64.shandsu2code-SU2-v7.3.1-0-g328a1b7.tar.gz. -
Install
Miniconda3bybash Miniconda3-latest-Linux-x86_64.sh. Setyesto all install options. -
Put
export OMPI_MCA_btl_vader_single_copy_mechanism=noneinto.bashrc(See this issue) -
Create a vistual environment for installing SU2:
conda create -n su2 numpy python=3.7(numpyis needed byparallel_computation.py) -
Install
mpi4pybypython -m pip install mpi4py --user. Warning: DO NOT useconda install mpi4py. See this discussion -
Uncompress
su2code-SU2-v7.3.1-0-g328a1b7.tar.gzbytar zxvf su2code-SU2-v7.3.1-0-g328a1b7.tar.gz. Rename the code folder tosu2code, and thencd su2code. -
Important: change the
static: trueargument tostatic: falseinexternals/cgns/hdf5/meson.build. See this issue -
Install
SU2following the guidance:Firstly, executing (remember change
usernameto your own system)./meson.py build -Denable-autodiff=true -Denable-directdiff=true -Denable-pywrapper=true -Dwith-mpi=enabled --prefix=/home/username/SU2Then put the suggested path (see the terminal outputs) into your
.bashrc.Then executing
./ninja -C build install
SU2 should be installed successfully now.
Note: Consider using Tsinghua mirrors for anaconda and pip if you are in China.
For anaconda, see https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
For pip, see https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
For the FSI tutorial, do some extra steps (make sure you are now in the created su2 python virtual environment)
-
Install
blasandlapacklibraries bysudo apt-get install -y libblas-dev liblapack-dev -
Install
Cythonandscipybypython -m pip install Cython scipy -
Uncompress
petsc-with-docs-3.16.1.tar.gz, and rename it topetsc, thencd petsc -
Config petsc by
./configure -with-petsc4py=1, then following the terminal outputs to install PETSc (make PETSC_DIR=/home/username/petsc PETSC_ARCH=arch-linux-c-debug alland thenmake PETSC_DIR=/home/username/petsc PETSC_ARCH=arch-linux-c-debug check) -
Put the following settings into
.bashrc(again, changeusernameaccording to your own host system)
export PYTHONPATH=$PYTHONPATH:/home/username/petsc/arch-linux-c-debug/lib
export PETSC_DIR=/home/username/petsc
export PETSC_ARCH=arch-linux-c-debug
export PATH=$PATH:$PETSC_DIR/$PETSC_ARCH/bin
- Install
spatialindex:
tar zxvf spatialindex-src-1.9.2.tar.gz
mv spatialindex-src-1.9.2 spatialindex-src
cd spatialindex-src
cmake . # (do not forget the .)
make
sudo make install
- Install
rtreebypython -m pip install rtree.
Things should work now.
Test the dynamic FSI python tutorial by mpirun -n 2 python -m mpi4py $SU2_RUN/fsi_computation.py --parallel -f fsi.cfg > log 2>&1 (remember put mesh into subfolder)