mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.89k stars 454 forks source link

Build errors using Linux (both with gcc 13.2.1 and clang 17.0.6) #435

Open plafl opened 3 months ago

plafl commented 3 months ago

My system:

Linux fedora 6.6.4-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Dec  3 18:13:11 UTC 2023 x86_64 GNU/Linux
Fedora release 39 (Thirty Nine)

Compiler versions:

gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)
clang version 17.0.6 (Fedora 17.0.6-1.fc39)

Commit (latest on main): 39e01e61f8de07b99859df04b271a02a53d9aeb2

Errors detected with both compilers (in several submodules: OpenEXR, flip for the first, glfw for the second):

Possible fix (it works on my machine): add the following two lines to CMakeLists.txt:

add_definitions(-include stdint.h)
add_definitions(-Wno-implicit-function-declaration)
pbrt4bounty commented 2 months ago

I have a similar issue with 'stdint' when I uses LLVM-mingw under Windows. I solved here adding new flag in PtexInt.h imagen FYI.. I always use this compilers here: https://github.com/mstorsjo/llvm-mingw Cheers..!

genmeblog commented 2 months ago

Similar here... src/pbrt-v4/src/ext/openexr/OpenEXR/IlmImf/ImfDwaCompressor.cpp:176:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’ Since I don't know cmake any idea what to add and where to make it working?