NVIDIAGameWorks / RayTracingDenoiser

NVIDIA Ray Tracing Denoiser
Other
504 stars 46 forks source link

Compiling on linux breaks due to "-Werror" #34

Closed stkrake closed 2 years ago

stkrake commented 2 years ago

CMakeLists.txt release v2.12.1 introduced -Werror for non-MSVC compilers. This breaks compilation on linux. See attached file: Werror_errs.txt. Most of it seems to be in MathLib.h (-Werror=strict-aliasing).

Compiler is gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)

dzhdanNV commented 2 years ago

Thanks! Some of these warnings can be fixed, some are really hard to fix. Let's keep this one open, but I would suggest removing -Werror for now as a suitable WAR.

stkrake commented 2 years ago

I am totally happy without -Werror is this case :smile: Some warnings in MathLib may not even be avoidable...

dzhdanNV commented 2 years ago

At least I will try to minimize the amount of warnings...

LeonBrands commented 2 years ago

Some warnings (when unreasonable) could instead be disabled (e.g. -Wno-unknown-pragmas)

dzhdanNV commented 2 years ago

Some warnings (when unreasonable) could instead be disabled (e.g. -Wno-unknown-pragmas)

Thanks. That's the plan :)

stkrake commented 2 years ago

On VC++ I usually put things with breaking warnings inside #pragma warning(push) #pragma warning( disable,...) #pragma warning(pop). This limits the "warning-lessness" to known areas. But this may become a compiler compatibility nightmare if extended to gcc and clang.

dzhdanNV commented 2 years ago

Unfortunately, I can't provide ETA. I wanna spend some time on this task, but need to find a remote Linux machine or setup a virtual machine first.

stkrake commented 2 years ago

I can now confirm that it compiles (and works) after simply removing -Werror from CMakeLists.txt.

dzhdanNV commented 2 years ago

@stkrake I believe I fixed the issue. Please, verify.

stkrake commented 2 years ago

Yes, compiles and works out of the box now. On win32 and linux. Without a single warning :smile:

Closing this. Many thanks.