Project-based on Angel Uriot's Galaxy_simulation in which
we add negative masses and apply either Newton (m gamma = mM/d^2) or anti-Newton law (|m| gamma = mM/d^2).
More information on this model: https://www.januscosmologicalmodel.fr/post/janus
sudo apt-get install pkg-config ocl-icd-opencl-dev opencl-clhpp-headers libsfml-dev libglm-dev libglew-dev libglfw3-dev libdw-dev
git clone https://github.com/Lecrapouille/Janus.git --recursive
cd Janus
make download-external-libsmake download-external-libs reads external/manifest: Dimension3D, Dear ImGui (docking, required by Dimension3D), imgui-sfml 2.6.x (plus patches/imgui-sfml-imgui192.patch for ImGui ≥ 1.92 texture API), Khronos OpenCL-Headers, Khronos OpenCL-CLHPP. You still need an OpenCL ICD (ocl-icd, GPU driver, or CPU runtime) to link and run.
make -j`nproc --all`
./build/JanusPour libOpenCL (liaison -lOpenCL), Fedora utilise les paquets Khronos sous ces noms (pas toujours ocl-icd seuls) :
# Chargeur ICD + lien /usr/lib64/libOpenCL.so + OpenCL.pc (pkg-config)
sudo dnf install OpenCL-ICD-Loader-develSur certaines versions on peut encore avoir ocl-icd / ocl-icd-devel à la place ou en doublon ; dans tous les cas il faut le paquet -devel qui fournit la bibliothèque pour le linker.
Ensuite installez au moins une implémentation OpenCL (sinon le programme peut linker mais ne voir aucun appareil) :
- GPU AMD / pilote Mesa :
sudo dnf install mesa-libOpenCL - Intel GPU :
sudo dnf install intel-compute-runtime(ouintel-openclselon dépôts) - CPU / essais :
sudo dnf install pocl
Dépendances de build du projet (exemple) :
sudo dnf install pkgconf-pkg-config glm-devel SFML-devel glew-devel glfw-devel libdw-devel OpenCL-ICD-Loader-devel(glm-devel n’expose pas de glm.pc sur Fedora : ce n’est pas un problème, GLM est en-têtes seuls et le Makefile ne le passe plus à pkg-config.)
Note: You need SFML v2.6 (not the v 3.0).
- Depending on whether you are using Ubuntu 20, Ubuntu 22, or Debian 11, you may need to modify the OpenCL header in libraries.hpp.
Choose between
#include <CL/opencl.hpp>and#include <CL/cl2.hpp>. - Fedora : installer
OpenCL-ICD-Loader-devel(ouocl-icd-devel) pour-lOpenCL; voir section Fedora ci‑dessus. Avec ce paquet,pkg-config OpenCLfonctionne en général. - Not working for MacOS because OpenCL cannot be used because Apple no longer supports OpenGL 4.x used by OpenCL.
Two colors: red for positive masses, green for negative masses.


