RapidCFD-dev Setup Tutorial
This guide assumes that:
You are running Ubuntu 18.04
You are using the terminal
You have a CUDA enabled GPU
Install packages:
sudo apt-get install git build-essential linux-headers-$(uname -r) screen
Also install all the required packages for OpenFOAM v2.3.1.
These can be found here.
sudo apt-get update sudo apt-get install -y build-essential flex bison cmake zlib1g-dev libboost-system-dev libboost-thread-dev libopenmpi-dev openmpi-bin gnuplot libreadline-dev libncurses-dev libxt-dev sudo apt-get install -y qt4-dev-tools libqt4-dev libqt4-opengl-dev freeglut3-dev libqtwebkit-dev sudo apt-get install -y libscotch-dev libcgal-dev
Install appropriate NVIDIA driver + CUDA toolkit
Reboot system
sudo reboot
Create a screen
screen -S compile
Create installation directory
sudo mkdir /opt/RapidCFD && cd /opt/RapidCFD
Clone RapidCFD-dev repository:
sudo git clone https://github.com/Atizar/RapidCFD-dev
Go to RapidCFD directory and configure
cd /opt/RapidCFD && sudo chown -R user:user ./
Replace “user:user” with your Linux username. This command sets the permissions of the directory so you can access it without using sudo.
Edit the bashrc configuration.
nano RapidCFD-dev/etc/bashrc
Then:
Comment out 'foamInstall=$HOME/$WM_PROJECT' Uncomment 'foamInstall=/opt/$WM_PROJECT'
Edit the wmake c/c++ rules
nano /opt/RapidCFD/RapidCFD-dev/wmake/rules/linux64Nvcc/c nano /opt/RapidCFD/RapidCFD-dev/wmake/rules/linux64Nvcc/c++
Change the CC architecture flags to match your GPU device. For example, for the NVIDIA Tesla K80, replace all instances of “sm30” to “sm37”.
Compile
cd /opt/RapidCFD/RapidCFD-dev && export WM_NCOMPPROCS=`nproc` && ./Allwmake
This will compile using all cores available on the computer, and may take at least an hour.
Note: If you encounter errors like “no such file or directory” when sourcing the bashrc, exit the terminal, start a new one, and source the bashrc again. I think this is due to some bug in the software.
Taking too long to compile? Yeah, same… Check out my other projects while it’s compiling! Or, just watch htop…
By the way, don’t forget to use screen when you compile. If the terminal exits, screen will allow the compilation to continue in the background. If you need to get back into the screen, type “screen -r” in the terminal.
If there are multiple screen sessions, you will need to use “screen -r <name>”, where name is the name of the screen session we created.