A 2D N-Body Simulator made using C.
  • C 61.2%
  • CMake 16.4%
  • GLSL 12.1%
  • Meson 10.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Abhirup Bhattacharyya dbb99c8f90
WIP: pool allocator
Signed-off-by: Abhirup Bhattacharyya <abhirup27022001@outlook.com>
2026-11-21 21:21:28 +05:30
src WIP: pool allocator 2026-11-21 21:21:28 +05:30
thirdparty add sun shader, add cmake build, other minor changes 2026-10-17 23:06:19 +05:30
.clang-format add sun shader, add cmake build, other minor changes 2026-10-17 23:06:19 +05:30
.gitignore feat: add arena allocator and WIP pool allocator 2026-10-20 23:58:44 +05:30
CMakeLists.txt add sun shader, add cmake build, other minor changes 2026-10-17 23:06:19 +05:30
meson.build add sun shader, add cmake build, other minor changes 2026-10-17 23:06:19 +05:30
README.md Initial Commit: setup C 17 project 2026-09-27 10:46:58 +05:30

Gravity N-Body Simulator

Dependencies

  • A C compiler which supports the C17 standard (Clang recommended).
  • Meson
  • Ninja

Install Dependencies

Windows:

winget install --id mesonbuild.meson --id Ninja-build.Ninja --id LLVM.LLVM

Arch Based Linux:

sudo pacman -S meson ninja clang

Build

configure the project with Meson:

Note: To use clang toolchain specifically, you need to set the CC environment variable in the shell before the configuration.

meson setup build

compile:

meson compile -C build

or

ninja -C builddir

For a debug build:

meson setup build --buildtype=debug
meson compile -C build

For an optimized release build:

meson setup build --buildtype=release
meson compile -C build

Run

Linux

./build/gravity-sim

Windows

build\gravity-sim.exe

Note