CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > SU2 > SU2 Installation

Installing SU2 v5 for Parallel Computations

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By tjim
  • 1 Post By McAero

LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2017, 09:07
Default Installing SU2 v5 for Parallel Computations
Join Date: Aug 2017
Posts: 30
Rep Power: 7
McAero is on a distinguished road
Hello all,
excuse me since I am a beginner in ubuntu and Linux

I`ve been trying for many days to install Su2 v5 for parallel computations,
I have the parallel SU2 but v4 but I need to use v5
I already have the serial version of v5 but I need to install the parallel one, I am trying to use the git hub and SU2 wiki but unfortunately, i couldn`t understand it very much because I am a beginner in the Linux and the steps are not clear for me.
if I could find some help to update the v4 to v5 or install the v5 - the parallel version I'd be very grateful
Thanks very very much for your support
McAero is offline   Reply With Quote

Old   November 30, 2017, 02:36
New Member
Tim Jim
Join Date: Sep 2017
Posts: 25
Rep Power: 7
tjim is on a distinguished road
Hi, it's a bit of a tough journey for newbies like us, it seems! Let me share with you the process I went through to get things installed and you can give it a go. Depending on your Linux setup your steps may vary slightly from mine! Also, I may be wrong - so I hope other more informed members of the group can correct those parts!

I'm afraid it's going to be a bit of a long post, but since I recently went through the process, I hope this makes a good log of the install process for other newbies (and myself when I have to reinstall and I've forgotten what I'm doing)!

You want a parallel build - is that with all the other bots such as hdf5, zlib, szip, and Lapack support? If so, you'll need to build those and link to them later on! For the bare bones, I think I'm right in saying you need to get just one (or two) things:
1. An MPI installation
2. mpi4py plus python 2.7 (if you want the parallel python wrappers for SU2 to work, if not, you can forget this)

The basic workflow is:
1. Download and install all the dependencies (MPI, mpi4py, plus all the other packages you want support for). Usually, every package you download will have a readme or install text file with some directions. Some are better than others.
2. Get yourself a copy of SU2 and run the install process (N.B. in Linux, this is usually some combination of running a 'configure' script which figures out where stuff is on your computer, then some kind of 'make' command to build the program, and finally a 'make install' which will actually put the program in a usable state where you want to access it)

I'm not sure what you've got or not, so below, I'll walk through the steps for the package installations and SU2 install. You can give it a go and see what works for you. If you're from a Windows background like me, there are a few differences when moving to Linux - the file system layout and file permissions are one of many things, as is working in th terminal rather than graphical interfaces! I'd suggest making a directory that you have read and write permissions for your programs. You can make the folder in your home directory (the shorthand for home is '~') or wherever is useful for you. So, go open up a new terminal window and, for example's sake, I'm going to make a new directory called programs in my home using:
mkdir ~/programs
I tend to try and keep my downloaded files and install files etc. orderly so I can easily rebuild them if something goes wrong but you don't have to follow my file layout So if I download some program installer XYZ-1.0.0, my preference is to rename the downloaded installation/build folder to XYZ-1.0.0_src, and then install the program to a new folder named XYZ-1.0.0. Anyway, as I say, this is optional but many Linux programs will require that your build directory and install directory be different, I believe!

Firstly, if you don't have some kind of MPI installed, go get one (there are several to choose from, I went for Open MPI, v3.0.0 at the time of writing this). The install goes something like this:
1. Navigate to your new programs directory and make a new directory to hold all your OpenMPI files; maybe something like:
cd ~/programs
mkdir openmpi
cd openmpi
2. Download Open MPI - you can either click the download link and 'mv' it over to your new directory or just use wget to download it:
3. Extract your new package with tar:
tar xvf openmpi-3.0.0.tar.bz2
4. Rename your newly extracted file (optional) and naviage into it:
mv openmpi-3.0.0 openmpi-3.0.0_src
cd openmpi-3.0.0_src
5. Run configure using './configure' to set up all the paths, find all your system libraries etc. N.B. Generally, this is where you can set the install location by using the 'PREFIX' flag like this (it sometimes differs from program to program though):
./configure --prefix=~/programs/openmpi/openmpi-3.0.0
Note, at this point, your program has not been installed yet (that path you specify in prefix hasn't even been made!) - it's just finding all the paths and stuff. By the way, depending on your system, you might want to use the full path instead of the tilde ~ home shortcut.
6. Now you can build and install it! For this package, it's in one step:
make all install
7. Right, assuming you set a PREFIX previously, you'll need to open up your .bashrc in your favourite editor and add following line(s) at the bottom of the file (btw, the '.bashrc' is a file usually found in your home dir, i.e. '~/.bashrc' - it is a file which has a lot of settings in it and is loaded everytime you open a new terminal window):
# added for OpenMPI 3.0.0 N.B. Anything you type after a # is commented! I.e. This line!
export PATH=/home/FIa/FIa164/programs/openmpi/openmpi-3.0.0/bin:$PATH
export LD_LIBRARY_PATH=/home/FIa/FIa164/programs/openmpi/openmpi-3.0.0/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export LD_RUN_PATH=/home/FIa/FIa164/programs/openmpi/openmpi-3.0.0/lib${LD_RUN_PATH:+:${LD_RUN_PATH}}
You can replace the paths with your locations. The basic layout is `export PATH=/my/path/to/bin:$PATH` and `export LD_LIBRARY_PATH=/my/path/to/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}` etc. The `bin` is where the executables are stored and `lib` is for the library files that other programs might want to link to.
Basically, if you used a PREFIX, then the program will not be in the so-called 'standard' install locations and won't be found (unlike Windows, Linux has many places, not just a Program Files directory), so by adding the above lines, you tell the system to search those paths also for the programs you want to run.This step can be skipped if you did not add a PREFIX. In some cases, you can skip this step if you have linked your install with rpath flags but I don't want to get into can search up the joys of linking libraries in your favourite search engine later if you are so inclined!

Congrats! In theory, you have managed to install Open MPI! To test this, you either type `source ~/.bashrc` to reload the .bashrc with your new settings or open a new terminal, then trying running `mpirun` or try `which mpirun`. Hopefully, you'll see your installed PREFIX bin pop here. if you cd to that bin directory, you can have a quick look around and get a feel for Linux directory layouts.

I'll post this for you to get working while I type up the next sections Good luck and give a shout if you need any pointers!
Calum likes this.

Last edited by tjim; November 30, 2017 at 02:46. Reason: Correct makedir to mkdir
tjim is offline   Reply With Quote

Old   December 1, 2017, 03:18
Default Part 2
New Member
Tim Jim
Join Date: Sep 2017
Posts: 25
Rep Power: 7
tjim is on a distinguished road
If you want the all the other support, I'll detail them more briefly here. Out of laziness, I'm going to leave my file paths unedited but obviously, you'll want to put your own $HOME path in the place of mine! (My home path is `/home/FIa/FIa164`, you can replace that bit with your ~).

Also, the links I am grabbing with wget or curl - they may be out of date, I'll leave it to you to grab the versions you want!

For szip:
0. make a new dir for szip files and cd in (assuming you're in your programs dir):
mkdir szip && cd szip
I'm just going to put the rest here in plain text
1. curl -O
2. tar xvf szip-2.1.1.tar.gz
3. mv szip-2.1.1 szip-2.1.1_src
4. cd szip-2.1.1_src
5. ./configure prefix=/home/FIa/FIa164/programs/szip/szip-2.1.1
6. make
7. make check
8. make install
9. Add to LD_LIBRARY_PATH in ~/.bashrc (paste this at the bottom of your .bashrc)
# added for szip
export LD_LIBRARY_PATH=/home/FIa/FIa164/programs/szip/szip-2.1.1/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
For zlib:
0. mkdir zlib && cd zlib
1. wget --no-check-certificate
2. tar xvf zlib-1.2.11.tar.gz
3. mv zlib-1.2.11 zlib-1.2.11_src
4. cd zlib-1.2.11_src
5. ./configure
6. make test
7. make install prefix=/home/FIa/FIa164/programs/zlib/zlib-1.2.11
8. Add to LD_LIBRARY_PATH in ~/.bashrc:
# added for zlib
export LD_LIBRARY_PATH=/home/FIa/FIa164/programs/zlib/zlib-1.2.11/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
For hdf5 (N.B. this needs the previous two installed ):
0. mkdir hdf5 && cd hdf5
1. Get file from and dump it here (for some reason wget and curl both bugged out on me here)
2. tar xvf hdf5-1.10.1.tar.gz
3. mv hdf5-1.10.1 hdf5-1.10.1_src
4. cd hdf5-1.10.1_src
5. CC=mpicc ./configure --prefix=/home/FIa/FIa164/programs/hdf5/hdf5-1.10.1 --enable-optimization=high --enable-parallel --with-zlib=/home/FIa/FIa164/programs/zlib/zlib-1.2.11/include,/home/FIa/FIa164/programs/zlib/zlib-1.2.11/lib --with-szlib=/home/FIa/FIa164/programs/szip/szip-2.1.1
6. make
7. make -i check
8. make install
9. make check-install
10. Add to .bashrc:
# added for hdf5
export LD_LIBRARY_PATH=/home/FIa/FIa164/programs/zlib/zlib-1.2.11/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
tjim is offline   Reply With Quote

Old   December 1, 2017, 03:19
Default Part 3
New Member
Tim Jim
Join Date: Sep 2017
Posts: 25
Rep Power: 7
tjim is on a distinguished road
If you want mpi4py:
0. mkdir mpi4py && cd mpi4py
1. wget -O mpi4py-3.0.0.tar.gz
2. tar xvf mpi4py-3.0.0.tar.gz
3. mv mpi4py-3.0.0 mpi4py-3.0.0_src
4. cd mpi4py-3.0.0_src
5. Set in mpi.cfg the location to your mpi install:
mpi_dir = /home/FIa/FIa164/programs/openmpi/openmpi-3.0.0
mpicc = %(mpi_dir)s/bin/mpicc
mpicxx = %(mpi_dir)s/bin/mpicxx
library_dirs = %(mpi_dir)s/lib
runtime_library_dirs = %(library_dirs)s
6. python build
7. python install

You probably need some kind of LAPACK implementation as well. If you have the permissions in the standard Linux install locations (i.e. you can sudo stuff there), you can try getting a LAPACK installation via pip. Else, you can try OpenBLAS which includes LAPACK.

After all of this, you can finally try to install SU2 in parallel! You probably figured that basically, you need to ./configure, make, make install. To enable the various options, you just have to set the flags during configure. Mine looked like this:
./configure --prefix=/home/FIa/FIa164/programs/su2/SU2-5.0.0 CXXFLAGS="-O3" --enable-mpi --with-cc=/home/FIa/FIa164/programs/openmpi/openmpi-3.0.0/bin/mpicc --with-cxx=/home/FIa/FIa164/programs/openmpi/openmpi-3.0.0/bin/mpicxx --enable-PY_WRAPPER --with-HDF5-lib=/home/FIa/FIa164/programs/hdf5/hdf5-1.10.1/lib --with-HDF5-include=/home/FIa/FIa164/programs/hdf5/hdf5-1.10.1/include --with-ZLIB-lib=/home/FIa/FIa164/programs/zlib/zlib-1.2.11/lib --with-ZLIB-include=/home/FIa/FIa164/programs/zlib/zlib-1.2.11/include --with-SZIP-lib=/home/FIa/FIa164/programs/szip/szip-2.1.1/lib --with-SZIP-include=/home/FIa/FIa164/programs/szip/szip-2.1.1/include --with-LAPACK-lib=/home/FIa/FIa164/programs/openblas/OpenBLAS-0.2.20/lib --with-LAPACK-include=/home/FIa/FIa164/programs/openblas/OpenBLAS-0.2.20/include
Follow that up with a make, make install, and hopefully, you'll have a working install! Don't forget to add the paths to your .bashrc! I guess you will have something similar - but if you use pip to install LAPACK, I guess your LAPACK flags may be something like this in stead: `--with-LAPACK-lib=/usr/lib --with-LAPACK-include=/usr/include`.

I hope that points you in the right direction!
tjim is offline   Reply With Quote

Old   December 10, 2017, 18:02
Join Date: Aug 2017
Posts: 30
Rep Power: 7
McAero is on a distinguished road
Thanks very much for your reply Tjim!
I really appreciate your effort and time to help me in this way )
Thanks again very much
tjim likes this.
McAero is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing SU2 how ? McAero SU2 Installation 1 October 14, 2017 05:50
Installing SU2 5.0.0 with lubuntu - tecio not found quarkz SU2 Installation 4 March 2, 2017 00:01
[] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 22:53
Installing SU2 on Linux tonino SU2 Installation 1 August 8, 2015 17:33
Problem while Compiling and Installing SU2 3.2 using Cygwin yona SU2 Installation 2 July 25, 2015 11:23

All times are GMT -4. The time now is 05:31.