Create howToBuild.md

This commit is contained in:
hamidrezanorouzi 2022-09-05 17:15:21 +04:30 committed by GitHub
parent d94abcfaa6
commit 5d8018a5af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 53 additions and 0 deletions

53
doc/howToBuild.md Normal file
View File

@ -0,0 +1,53 @@
# How to build PhasicFlow?
PhasicFlow uses CMake as the build system. you need to have CMake-3.22 or higher installed on your machine. you can either use the command line for setting-up the build system, or use `cmake-gui` to setup your build system through the GUI.
### Step 1:
Make sure you have installed all the required packages on your computer (tbb and CMake and compilers).
### Step 2: Cloning Kokkos
It is assumed that Kokkos source is located in the home folder of your OS. Clone the current version of Kokkos into your home folder:
```
cd ~
mkdir Kokkos
cd Kokkos
git clone https://github.com/kokkos/kokkos.git
```
or simply download and extract the source code of Kokkos in `~/Kokkos` folder. In the end, the top level CMakeLists.txt file should be located in `~/Kokkos/kokkos` folder.
### Step 3: Cloning PhasicFlow
Create the PhasicFlow folder in your home folder and then clone the source code into that folder:
```
cd ~
mkdir PhasicFlow
cd PhasicFlow
git clone https://github.com/hamidrezanorouzi/phasicFlow.git
```
### Step 4: Environmental variables
In the terminal enter the following command:
`gedit ~/.bashrc`
and add the following line to the end of file, save and close it.
source $HOME/PhasicFlow/phasicFlow/cmake/bashrc
close the terminal.
### Step 5: Building PhasicFlow
Follow one of the followings to build PhasicFlow for one mode of execution.
#### Serial build for CPU
Open a new terminal and enter the following commands:
```
cd ~/PhasicFlow/phasicFlow/build
cmake ../ -DpFlow_Build_Serial=On
make install
```
For faster builds, use `make install -j`. This will use all the CPU cores on your computer for building.
#### OpenMP build for CPU
#### GPU build for parallel execution on CUDA-enabled GPUs
After building, `bin`, `include`, and `lib` folders will be created in `~/PhasicFlow/phasicFlow/` folder. Now you are ready to use PhasicFlow.