Skip to content

Commit

Permalink
Adding a Getting Started guide (#999)
Browse files Browse the repository at this point in the history
As F3D position itself as beginer friendly project
we need to provide a getting started guide for
developers that may not be used to compile software for themselves.
  • Loading branch information
mwestphal authored Sep 29, 2023
1 parent 2dba13e commit b377edd
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 9 deletions.
13 changes: 10 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@ Also, do not hesitate to join our [discord](https://discord.f3d.app)!

## How to get started with development

To contribute to F3D as a developer, you may want to take a look at the opened [issues](https://github.com/f3d-app/f3d/issues),
To contribute to F3D as a developer, first you may want to try and build F3D for yourself.
If you are already familiar with software compilation, you can take a look at our [build](doc/dev/BUILD.md) guide.
If not, you may want to look at our [getting started](doc/dev/GETTING_STARTED.md) guide, that provide steps to compile F3D.

Once you are able to build F3D, you may want to take a look at the opened [issues](https://github.com/f3d-app/f3d/issues),
especially, the ones with the ["good first issue"](https://github.com/f3d-app/f3d/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) label.
If one sounds interesting to you, then you should just go ahead and comment on the issue and ask for any help or clarification needed.
F3D maintainers will see your comment and provide guidance as needed.
F3D maintainers will see your comment and provide guidance as needed. You can also reach out on discord.

You can then fix the issue in your side and contribute it to the F3D repository,
by following the workflow described below.

Of course, if you are already using F3D and want to improve it for your specific needs, because you want a feature or found a bug,
that is definitely possible. Feel free to reach out for guidance by opening an issue or asking on discord.

Another way to get started is to improve the documentation.

## F3D Development workflow
Expand All @@ -41,7 +48,7 @@ It also means that adding a new feature or behavior means adding a associated te
Make sure to check the results for yourself, and ask for help if needed.

F3D continuous integration will also check the coverage as it is a good way to evaluate if new features are being tested or not.
When adding code to F3D, always to to cover it by adding/modifying [tests](doc/dev/TESTING.md).
When adding code to F3D, always try to cover it by adding/modifying [tests](doc/dev/TESTING.md).

F3D continuous integration also check formatting using clang-format and will inform you if changes needs to be made.
However, some [formatting rules](doc/dev/CODING_STYLE.md) are not enforced by clang-format and will be checked during the review process.
Expand Down
18 changes: 13 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,43 +178,51 @@ defaults:
nav_order: 4
has_children: true

-
scope:
path: "doc/dev/GETTING_STARTED.md"
values:
title: Getting Started
parent: Developer Documentation
nav_order: 0

-
scope:
path: "doc/dev/BUILD.md"
values:
title: Build
parent: Developer Documentation
nav_order: 0
nav_order: 1

-
scope:
path: "doc/dev/TESTING.md"
values:
parent: Developer Documentation
nav_order: 1
nav_order: 2

-
scope:
path: "CONTRIBUTING.md"
values:
title: Contribute
parent: Developer Documentation
nav_order: 2
nav_order: 3

-
scope:
path: "doc/dev/GENERATE.md"
values:
title: Generate
parent: Developer Documentation
nav_order: 3
nav_order: 4

-
scope:
path: "doc/dev/CODING_STYLE.md"
values:
parent: Developer Documentation
nav_order: 4
nav_order: 5

# Licenses doc
# _licenses.md uses front matter
Expand Down
3 changes: 2 additions & 1 deletion doc/dev/BUILD.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Build guide

F3D uses a CMake based build system, so building F3D just requires installing
needed dependencies, configuring and building.
needed dependencies, configuring and building. If you are not used to such processes
please take a look at our [getting started guide](GETTING_STARTED.md).

## Dependencies

Expand Down
172 changes: 172 additions & 0 deletions doc/dev/GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Getting started guide

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](BUILD.md).

This guide will help you to compile your own version of F3D with required dependencies.
Optional dependencies or covered in the build guide.

- If you are using [Linux](#Linux)
- If you are using [Windows](#Windows)
- If you are using [macOS](#macOS)

## Linux

Note: The following steps were tested with Ubuntu 22 and ArchLinux but
should work for other OSes as stated, as long as listed packages are available.

### Install dependencies

First make sure your system is up-to-date,
then install the required dependencies using the terminal.

#### Debian/Ubuntu/Mint

```
sudo apt install build-essential git git-lfs cmake libvtk9-dev
```

#### Fedora/Centos/RedHat

```
sudo yum install make automake gcc gcc-c++ kernel-devel git git-lfs cmake vtk
```

#### Arch Linux

```
sudo pacman -S base-devel git git-lfs cmake vtk
```

### Compile F3D

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
```

## Windows

Note: The following steps were tested with Visual Studio Community 2022 using Windows 10, but should also work for other versions

#### Install Dependencies
* Download and install [git bash for windows][gitforwindows]
* Download and install [cmake][cmake-download]
* Download and install [Visual Studio 2022 Community Edition][visual-studio]

#### Recover F3D sources

* Open git bash

```sh
cd C:
mkdir dev
cd dev
mkdir f3d
cd f3d
git clone https://github.com/f3d-app/f3d.git src
mkdir build
```

#### Install dependencies using vcpkg

* Open git bash

```sh
cd C:/dev
git clone https://github.com/Microsoft/vcpkg.git
```

* Open cmd

```sh
cd C:\dev
./vcpkg/bootstrap-vcpkg.sh
cmake -B ./f3d/build -S ./f3d/src -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
```

Note: Last command will take a while. It download, compile and install all dependencies, including
many optional ones.

#### Build F3D

* Open cmd

```sh
cd C:\dev\f3d\build
cmake .
cmake --build .
```

#### Run

* Double click on the `C:\dev\f3d\build\bin_Debug\f3d.exe` executable

## macOS

Note: The following steps were tested with macOS Catalina using Xcode 12.4, but should also work for other versions

### Install Xcode

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.

### Install Homebrew

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)"
```

### Install dependencies

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.

### Compile F3D

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-download]: https://cmake.org/download
[gitforwindows]: https://gitforwindows.org/
[visual-studio]: https://visualstudio.microsoft.com/vs/community/
1 change: 1 addition & 0 deletions doc/dev/README_DEV.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Developer Documentation
- [How to get started with building F3D.](GETTING_STARTED.md)
- [How to build F3D.](BUILD.md)
- [How to test F3D.](TESTING.md)
- [How to contribute to F3D.](../../CONTRIBUTING.md)
Expand Down

0 comments on commit b377edd

Please sign in to comment.