mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.88k stars 1.19k forks source link

Cygwin build fails #155

Closed tsulej closed 6 years ago

tsulej commented 6 years ago

I've tried to compile pbrt under Cygwin. There are three problems. All were introduced with this commit: https://github.com/mmp/pbrt-v3/commit/d42c4b08a8abeae203b201de8e7103d461014b67

  1. setitimer detection in CMakeFile (https://github.com/mmp/pbrt-v3/issues/127 fixed previously with commit https://github.com/mmp/pbrt-v3/commit/957018c77c692a901f0881a536ea062c1addb675) is wrong. setitimer is available under Cygwin but is not implemented for ITIMER_PROF. That means that setitimer call returns -1 and this should be checked during the test.

  2. PBRT_THREAD_LOCAL should be equal to __thread for Cygwin. There is a bug in gcc compiler under Cygwin (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697) when thread_local is used.

  3. In CMakeFile, noinline part, PBRT_NOINLINE=__declspec(noinline) - parentheses should be escaped: PBRT_NOINLINE=__declspec\\(noinline\\).

mmp commented 6 years ago

I believe that the change I pushed will fix all three of these but can't easily test it; please let me know if it does.

tsulej commented 6 years ago

Testing. It still has some errors. I'll prepare PR.