You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debug info and the use of __FILE__ embed absolute paths into binary files, which is probably bad if we end up distributing any pre-compiled files.
GCC/clang support -fdebug-prefix-map=OLD=NEW as a way of changing paths in debug info.
More recent GCC / Clang also support modifying the behaviour of __FILE__ via -fmacro-prefix-map=OLD=NEW. -ffile-prefix-map=OLD=NEW can be used to set both these options.
I am unsure if NVCC / MSVC will have comparible options (I've not yet looked). This might include use of -lineinfo/-G in NVCC.
Worth checking to see if Cmake has a feature for these.
Rob suggested that we could just prune the __FILE__ value from the exception printing so that it starts with include/flamepgu?, Not as nice as preventing the strings from being embedded, but should work on compilers which do not support the use of __FILE__ and relative paths.
Will also need to consider exceptions trhwon from src/flamegpu too
Using -ffile-prefix-map where appropriate on gcc /clang does appear to work, and works for hots compilation of NVCC (but probably not for device code?)
# in game of life main.cu::main()
printf("FILE LINE %s:%d\n", __FILE__, __LINE__);
# before
FILE LINE /home/ptheywood/code/flamegpu/FLAMEGPU2/examples/game_of_life/src/main.cu:35
# after
FILE LINE ./examples/game_of_life/src/main.cu:35
Although i'm not super keen on it starting with the . but I'm not sure what the alt would be.
Debug info and the use of
__FILE__
embed absolute paths into binary files, which is probably bad if we end up distributing any pre-compiled files.GCC/clang support
-fdebug-prefix-map=OLD=NEW
as a way of changing paths in debug info.More recent GCC / Clang also support modifying the behaviour of
__FILE__
via-fmacro-prefix-map=OLD=NEW
.-ffile-prefix-map=OLD=NEW
can be used to set both these options.source
I am unsure if NVCC / MSVC will have comparible options (I've not yet looked). This might include use of
-lineinfo/-G
in NVCC.Worth checking to see if Cmake has a feature for these.
Cmake may also need some changins making, as it embeds some paths into the binary by default.
experimental:deterministic
For GCC Clang versions which support it, rough cmake would be:
The text was updated successfully, but these errors were encountered: