Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues on Windows #64

Closed
lookup1980 opened this issue Apr 12, 2016 · 1 comment
Closed

Build issues on Windows #64

lookup1980 opened this issue Apr 12, 2016 · 1 comment

Comments

@lookup1980
Copy link

Hi,

I tried pbrt-v3 on Windows, and there're 2 build issues:

  1. bash command in CMake does not work well on Windows:
    COMMAND bash -c "if [[ -e ${CMAKE_BINARY_DIR}/pbrtparse.hpp ]]\; then /bin/mv ${CMAKE_BINARY_DIR}/pbrtparse.hpp ${CMAKE_BINARY_DIR}/pbrtparse.hh\; fi"
    The command below works, and it should be portable to Linux and OSX:
    COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/pbrtparse.hpp ${CMAKE_BINARY_DIR}/pbrtparse.hh
  2. The project can't build with VisualStudio2012, which does not have header file cinttypes. VisualStudio2015 works for me.
mmp added a commit that referenced this issue Apr 15, 2016
Previously, we had messy code in the cmake file to deal with the fact that different versions of bison use different suffixes for generated C++ header files (hh and hpp, depending). (This problem is made worse by the fact that OSX ships a 10 year old version of bison, which doesn't support the %defines directive, which would help with this.)

The solution is to rename pbrtparse.yy to pbrtparse.y, which should cause all versions of bison to emit a header named .h, which is what we want. We then rename the generated .c file to .cpp and now all platforms use the same logic for this.

Fixes issues #60 and #64.
@mmp
Copy link
Owner

mmp commented Apr 15, 2016

  1. Should be fixed now (with a slightly different fix, but thanks for letting me know about "cmake -E rename!"
  2. VS2012's C++11 support is almost certainly too incomplete to support pbrt-v3--we use too many C++11 features. (Even getting VS2013 to build it is still a work in progress...)

@mmp mmp closed this as completed Apr 15, 2016
LarsPh pushed a commit to LarsPh/deepscattering-pbrt that referenced this issue Apr 20, 2020
Previously, we had messy code in the cmake file to deal with the fact that different versions of bison use different suffixes for generated C++ header files (hh and hpp, depending). (This problem is made worse by the fact that OSX ships a 10 year old version of bison, which doesn't support the %defines directive, which would help with this.)

The solution is to rename pbrtparse.yy to pbrtparse.y, which should cause all versions of bison to emit a header named .h, which is what we want. We then rename the generated .c file to .cpp and now all platforms use the same logic for this.

Fixes issues mmp#60 and mmp#64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants