-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from kadir014/rewrite
Rewrite
- Loading branch information
Showing
169 changed files
with
48,989 additions
and
15,856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,218 +1,45 @@ | ||
# Nova Physics Build System Guidance | ||
Welcome to the Nova Physics building guide. | ||
# Building Nova Physics | ||
Nova Physics uses [Meson](https://mesonbuild.com/) as its build system. | ||
|
||
Nova Physics uses a dependency-free Python script to simplify and organize building. | ||
|
||
You can use `python nova_builder.py --help` to see the usage manual. Only requirement is to have Python 3.9 or higher installed on the system. | ||
|
||
|
||
**What you can do with the build system:** | ||
- [Build Nova Physics library](#building-nova-physics-static-libraries) | ||
- [Build & run example demos](#running-nova-physics-example-demos) | ||
- [Build & run benchmarks](#running-nova-physics-benchmarks) | ||
- [Build & run the test suite](#running-nova-physics-test-suite) | ||
|
||
|
||
<br><br><br> | ||
|
||
|
||
# Building Nova Physics Static Libraries | ||
This section covers building and generating static libraries yourself (in case you don't use the already-built archives from the [latest release.](https://github.com/kadir014/nova-physics/releases/latest)) | ||
|
||
## <img src="https://i.imgur.com/lyTfWAN.png" width=20> Windows | ||
❗ **Prerequisite**: Make sure you have either MinGW (GCC) or Visual Studio build tools installed. | ||
|
||
Download or clone the repository. | ||
``` | ||
git clone https://github.com/kadir014/nova-physics.git | ||
``` | ||
|
||
Set working directory as Nova Physics directory. | ||
``` | ||
cd "C:\...\nova-physics" | ||
``` | ||
|
||
Run Nova Physics's build system with `build` command to start building. To see options and arguments you can utilize for building use `--help`. | ||
``` | ||
python nova_builder.py build | ||
``` | ||
|
||
If successful, you should see the generated static libraries in the `nova-physics\build` sub-directory. | ||
|
||
|
||
## <img src="https://i.imgur.com/J3TG2gm.png" width=20> Linux | ||
|
||
❗ **Prerequisite**: Make sure you have GCC installed | ||
|
||
<br> | ||
|
||
Download or clone the repository. | ||
``` | ||
$ git clone https://github.com/kadir014/nova-physics.git | ||
``` | ||
|
||
Set working directory as Nova Physics directory. | ||
``` | ||
$ cd ./.../nova-physics | ||
``` | ||
|
||
Run Nova Physics's build system with `build` command to start building. (Can also be `py` or `python3` depending on the platform) To see options and arguments you can utilize for building use `--help`. | ||
``` | ||
$ python nova_builder.py build | ||
``` | ||
|
||
If successful, you should see the generated static libraries in `nova-physics/build` sub-directory. | ||
|
||
|
||
<br><br><br> | ||
|
||
|
||
# Running Nova Physics Example Demos | ||
This section covers building & running examples. | ||
|
||
## <img src="https://i.imgur.com/lyTfWAN.png" width=20> Windows | ||
❗ **Prerequisite**: Make sure you have MinGW (GCC) or Visual Studio build tools installed. Dependencies like SDL2 will be installed automatically by the script. | ||
|
||
Download or clone the repository. | ||
``` | ||
git clone https://github.com/kadir014/nova-physics.git | ||
If you're on macOS, install HomeBrew and Nova Physics's developer dependencies. | ||
```sh | ||
$ brew install glfw mesa sdl2 meson | ||
``` | ||
|
||
Set working directory as the Nova Physics directory. | ||
``` | ||
cd "C:\...\nova-physics" | ||
Install meson. (if you have any issues refer to [meson's installation guide](https://mesonbuild.com/Getting-meson.html)) | ||
```sh | ||
$ pip install meson | ||
``` | ||
|
||
Run Nova Physics's build system with `examples` command, it will detect the missing dependencies and download them on the fly. To see options and arguments you can utilize for building use `--help`. | ||
``` | ||
python nova_builder.py examples | ||
Change working dir to repository root. | ||
```sh | ||
$ cd path/to/nova-physics | ||
``` | ||
|
||
If successful, the example demos will be ran and you will see an SDL2 window open. | ||
|
||
## <img src="https://i.imgur.com/J3TG2gm.png" width=20> Linux | ||
❗ **Prerequisite**: Make sure you have GCC, SDL2 and SDL2-ttf development libraries installed via your package manager. | ||
Here are two sources explaining how to install SDL2 and the extensions on Linux: | ||
- https://wiki.libsdl.org/SDL2/Installation | ||
- https://lazyfoo.net/tutorials/SDL/01_hello_SDL/linux/index.php | ||
|
||
<br> | ||
|
||
After installing the dependencies, download or clone the repository. | ||
``` | ||
$ git clone https://github.com/kadir014/nova-physics.git | ||
Create a `build` directory for meson. | ||
```sh | ||
$ mkdir build | ||
``` | ||
|
||
Set working directory as Nova Physics directory | ||
``` | ||
$ cd ./.../nova-physics | ||
Setup meson configuration. For the other type of build types (optimization levels) see [here.](https://mesonbuild.com/Builtin-options.html#details-for-buildtype) | ||
```sh | ||
$ meson setup build --buildtype=debug | ||
``` | ||
|
||
Then run the build system with the `examples` command. (Can also be `py` or `python3` depending on the platform) To see options and arguments you can utilize for building use `--help`. | ||
We can finally start compiling. If successful you should see the built targets in `build` directory. | ||
```sh | ||
$ meson compile -C build | ||
``` | ||
$ python nova_builder.py examples | ||
``` | ||
|
||
If successful, the example demos will be ran and you will see an SDL2 window open. | ||
|
||
|
||
<br><br><br> | ||
|
||
|
||
# Running Nova Physics Benchmarks | ||
This section covers building & running benchmarks. | ||
|
||
## <img src="https://i.imgur.com/lyTfWAN.png" width=20> Windows | ||
❗ **Prerequisite**: Make sure you have either MinGW (GCC) or Visual Studio build tools installed. | ||
# Building Options | ||
While in the `build` dir (not root dir) you can use `$ meson configure` to see all building options and change them with `$ meson configure -Doption=nv_bool` | ||
|
||
Download or clone the repository. | ||
``` | ||
git clone https://github.com/kadir014/nova-physics.git | ||
``` | ||
|
||
Set working directory as Nova Physics directory. | ||
``` | ||
cd "C:\...\nova-physics" | ||
``` | ||
|
||
Run Nova Physics's build system with `bench` command with a benchmark argument (e.g `boxes.c`) to start benchmarking. To see options and arguments you can utilize for building use `--help`. | ||
``` | ||
python nova_builder.py bench <benchmark_source> | ||
``` | ||
|
||
If successful, the benchmark will start running, you can see the progress and remaining time on terminal. | ||
|
||
|
||
## <img src="https://i.imgur.com/J3TG2gm.png" width=20> Linux | ||
|
||
❗ **Prerequisite**: Make sure you have GCC installed | ||
|
||
<br> | ||
|
||
Download or clone the repository. | ||
``` | ||
$ git clone https://github.com/kadir014/nova-physics.git | ||
``` | ||
|
||
Set working directory as Nova Physics directory. | ||
``` | ||
$ cd ./.../nova-physics | ||
``` | ||
|
||
Run Nova Physics's build system with `bench` command with a benchmark argument (e.g `boxes.c`) to start benchmarking. (Can also be `py` or `python3` depending on the platform) To see options and arguments you can utilize for building use `--help`. | ||
``` | ||
$ python nova_builder.py bench <benchmark_source> | ||
``` | ||
|
||
If successful, the benchmark will start running, you can see the progress and remaining time on terminal. | ||
|
||
|
||
<br><br><br> | ||
|
||
|
||
# Running Nova Physics Test Suite | ||
This section covers building & running unit tests. | ||
|
||
## <img src="https://i.imgur.com/lyTfWAN.png" width=20> Windows | ||
❗ **Prerequisite**: Make sure you have either MinGW (GCC) or Visual Studio build tools installed. | ||
|
||
Download or clone the repository. | ||
``` | ||
git clone https://github.com/kadir014/nova-physics.git | ||
``` | ||
|
||
Set working directory as Nova Physics directory. | ||
``` | ||
cd "C:\...\nova-physics" | ||
``` | ||
|
||
Run Nova Physics's build system with `tests` command to start running the test suite. To see options and arguments you can utilize for building use `--help`. | ||
``` | ||
python nova_builder.py tests | ||
``` | ||
|
||
If successful, the unit tests will be run and results will be shown on the terminal. | ||
|
||
|
||
## <img src="https://i.imgur.com/J3TG2gm.png" width=20> Linux | ||
|
||
❗ **Prerequisite**: Make sure you have GCC installed | ||
|
||
<br> | ||
|
||
Download or clone the repository. | ||
``` | ||
$ git clone https://github.com/kadir014/nova-physics.git | ||
``` | ||
|
||
Set working directory as Nova Physics directory. | ||
``` | ||
$ cd ./.../nova-physics | ||
``` | ||
|
||
Run Nova Physics's build system with `tests` command to start running the test suite. (Can also be `py` or `python3` depending on the platform) To see options and arguments you can utilize for building use `--help`. | ||
``` | ||
$ python nova_builder.py tests | ||
``` | ||
Here's a list of our custom build options (You can also check `meson.options` file): | ||
- `build_examples`: Build example demos, installs SDL2. On by default. | ||
- `build_benchmarks`: Build bechmarks. Off by default. | ||
- `build_tests`: Build unit tests. On by default. | ||
- `enable_profiler`: Enable built-in profiler. If enabled, `<windows.h>` can be included. (Defines NV_ENABLE_PROFILER, on by default) | ||
- `enable_simd`: Enable usage of any SIMD extension. (Defines NV_ENABLE_SIMD, on by default) | ||
- `use_doubles`: Use double-precision floats. (Defines NV_USE_DOUBLE_PRECISION, off by default) | ||
|
||
If successful, the unit tests will be run and results will be shown on the terminal. | ||
For instance, if you didn't want to build example demos and just the static library, you could do `$ meson configure -Dbuild_examples=false`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.