This is a getting started guide, aimed to people that are not used to C++ programming, configuring and compiling. If you are already used to such processes, you may be looking for our build guide.
This guide will help you to compile your own version of F3D with required dependencies. Optional dependencies or covered in the build guide.
Note: The following steps were tested with Ubuntu 23 and ArchLinux but should work for other OSes as stated, as long as listed packages are available.
First make sure your system is up-to-date, then install the required dependencies using the terminal.
sudo apt update
sudo apt upgrade
sudo apt install build-essential git git-lfs cmake libvtk9-dev
sudo yum update
sudo yum install make automake gcc gcc-c++ kernel-devel git git-lfs cmake vtk
sudo pacman -Syu
sudo pacman -S base-devel git git-lfs cmake vtk nlohmann-json hdf5 netcdf fmt verdict openmpi glew ospray boost libxcursor
Open a terminal.
mkdir f3d
cd f3d
git clone https://github.com/f3d-app/f3d src
mkdir build
cd build
cmake ../src
make
You can then simply run F3D from the command line:
./bin/f3d
cmake -DBUILD_TESTING=ON ../src
make
ctest
Note: The following steps were tested with Visual Studio Community 2022 using Windows 10, but should also work for other versions
- Download and install git bash for windows
- Download and install cmake
- Download and install Visual Studio 2022 Community Edition
- Open git bash
cd C:
mkdir dev
cd dev
mkdir f3d
cd f3d
git clone https://github.com/f3d-app/f3d.git src
mkdir build
- Open git bash
cd C:/dev
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git fetch origin c9140a3b500812ad3206317885860d9553b93f13
- Open cmd
cd C:\dev
.\vcpkg\bootstrap-vcpkg.bat
cmake -B .\f3d\build -S .\f3d\src -DCMAKE_TOOLCHAIN_FILE=C:\dev\vcpkg\scripts\buildsystems\vcpkg.cmake
Note: Last command will take a while. It download, compile and install all dependencies, including many optional ones.
- Open cmd
cd C:\dev\f3d\build
cmake .
cmake --build .
- Double click on the
C:\dev\f3d\build\bin_Debug\f3d.exe
executable
cmake -DBUILD_TESTING=ON .
cmake --build . --config Release
ctest -C Release
Note: The following steps were tested with macOS Catalina using Xcode 12.4, but should also work for other versions
There are different ways to install Xcode, you can use the AppStore or download it from apple developer website and then extract and install it.
Open a terminal.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Open a terminal.
brew install git git-lfs cmake curl vtk
git lfs install
Note: Homebrew is downloading, compiling and installing all vtk dependencies. This command may take a very long time.
Open a terminal.
mkdir f3d
cd f3d
git clone https://github.com/f3d-app/f3d src
mkdir build
cd build
cmake ../src
make
You can then simply run F3D from the command line:
./bin/f3d.app/Contents/MacOS/f3d
cmake -DBUILD_TESTING=ON ../src
make
ctest