BrutPitt / glChAoS.P

3D GPUs Strange Attractors and Hypercomplex Fractals explorer - up to 256 Million particles in RealTime
https://michelemorrone.eu/glchaosp
BSD 2-Clause "Simplified" License
786 stars 61 forks source link

runtime path requirements? #11

Open mhuesch opened 1 year ago

mhuesch commented 1 year ago

hi, first of all thanks for this epic project! I've been really enjoying using it for "ambient background fractals".

I have a question about the build + runtime requirements of the project. I was able to very easily build it, but I am only able to run it successfully from the project root directory:

$ cd src
$ sh build_glChAoSP.sh

    glChAoS.p build starts . . .

    ---  CMake stage  ---

-- selected OpenGL_45 ...
-- OPENGL_INCLUDE_DIRS:
-- OPENGL_LIBRARY: /nix/store/cw3vvzl0ql7s4hb7cw0fw1y60pz7wmlp-libGL-1.6.0/lib/libOpenGL.so;/nix/store/cw3vvzl0ql7s4hb7cw0fw1y60pz7wmlp-libGL-1.6.0/lib/libGLX.so
GNU...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mhueschen/projects-reference/glChAoS.P/src/build

    ---  make stage  ---

[100%] Built target glChAoSP_Linux

    . . . end glChAoS.P

$ ../glChAoSP_Linux
[1]    1283199 floating point exception (core dumped)  ../glChAoSP_Linux
$ cd ..
$ ./glChAoSP_Linux
# (application opens in a new window and works as expected)

my goal in manually building it is to create a nix (https://github.com/NixOS/nix) derivation for the project, so it can be reproducibly built and installed on my NixOS system. it could also, then, be submitted to https://github.com/NixOS/nixpkgs which would allow others to easily install and use this fantastic tool.

I have a derivation which works and produces the same glChAoSP_Linux, but if I run it from anywhere but the project root, it crashes with the same floating point exception as above.

my guess is that there could be assumptions in the code about loading files relative to the project root, but I am not C++ literate enough to know for certain.

when you make the release builds, is there a process for producing the executables beyond sh build_glChAoSP.sh?

thanks!