gudhi-devel icon indicating copy to clipboard operation
gudhi-devel copied to clipboard

Feature/sanitizer option

Open VincentRouvreau opened this issue 2 years ago • 2 comments

A new cmake gudhi option to activate gcc/clang sanitizers. Default value is WITH_GUDHI_SANITIZER=''. In a command line one can easily activate sanitizer with i.e.: cmake -DWITH_GUDHI_SANITIZER=address . This will activate debug mode (-g) and add the compilation flag -fsanitize=addess. With MSVC, a warning message to explain the feature is not available is displayed. It does not activate sanitizer for the python module. To be discussed.

Some material about gcc and clang.

VincentRouvreau avatar Sep 14 '22 06:09 VincentRouvreau

With MSVC, a warning message to explain the feature is not available is displayed.

https://docs.microsoft.com/en-us/cpp/sanitizers/asan ?

mglisse avatar Sep 14 '22 06:09 mglisse

With MSVC, a warning message to explain the feature is not available is displayed.

https://docs.microsoft.com/en-us/cpp/sanitizers/asan ?

Sorry, I didn't know it was available under MSVC. I made the change on 6b373b8 and tested it under Windows.

VincentRouvreau avatar Sep 16 '22 07:09 VincentRouvreau

cmake -DCMAKE_CXX_FLAGS=-fsanitize=address .

Not that much, you are right. Maybe a better way would be to add a how_to_compile_gudhi_with_sanitizers.md (or a better name) in order to explain to contributors how to deal with it.

VincentRouvreau avatar Oct 19 '22 08:10 VincentRouvreau