FLAMEGPU / FLAMEGPU2

FLAME GPU 2 is a GPU accelerated agent based modelling framework for CUDA C++ and Python
https://flamegpu.com
MIT License
107 stars 22 forks source link

Environmental variables for Jitify/RTC #253

Open ptheywood opened 4 years ago

ptheywood commented 4 years ago

Currently 2 environment variables are required to jitify/rtc compilation:

This could be improved by:

This needs to be

The current implementation (fbf2c8e) also doesn't check that the value of FLAMEGPU2_INC_DIR is valid or correct, leading to misleading errors, rather than an appropraite exception.

When including the FLAMEGPU2 repo via cmake in an individual example project, the include dir is not found automatically, requiring the env variable to be set. The env variable being set globally is also a potential issue, i.e. if you have 2 examples each using a different version of the core F2 on the same machine.

  what():  /home/ptheywood/code/flamegpu/FLAMEGPU2-circles-benchmark/build/_deps/flamegpu2-src/src/flamegpu/util/JitifyCache.cu(106): Error compiling runtime agent function: Unable to automatically determine include directory and FLAMEGPU2_INC_DIR environment variable does not exist, in JitifyCache::buildProgram().
Robadob commented 4 years ago

Possibly pack the include headers into the executable? (this seems daft)

It's certainly unusual, however current headers dir is 503kb, size of the smallest debug executable on windows is 20mb.

Bearing in mind, we plan to reduce the size of header dir further in future, it's not the most insane idea.

It's also the only portable method, assuming no weird machines without write access. Although jitify does just load the headers from disk, so we could pass them as string in the jitify (filename)\n<file data> format.

ptheywood commented 4 years ago

The recent patch searches relative to the current working directory, rather than the current binary's directory, so calling from outside can lead to the path not being found. Both would probably be a wise choice.

Robadob commented 4 years ago

That's a good shout, I didn't consider it tbh. I'd just need to check each platform's way of getting binary location. Trivial addition.

https://stackoverflow.com/a/1528493/1646387

ptheywood commented 3 years ago

Some of this should also be conisdered pre binary release #514

Robadob commented 3 years ago

Worth noting, the Python wheel now includes the RTC headers. Though C RTC binaries don't.

ptheywood commented 3 years ago

support FLAMEGPU2_INC_DIR (deprecated but works, lwoer priotiy) and FLAMEGPU_INC_DIR

Robadob commented 1 year ago

1074 Adds GLM headers to Python wheels (as this seems compliant with the license as that's packaged too) and setups up GLM_INC_DIR environment variable to override path.