pbrt-v4 icon indicating copy to clipboard operation
pbrt-v4 copied to clipboard

Could not build pbrtv4

Open kevyuu opened this issue 8 months ago • 2 comments

I have already clone all the ext depencies yet Cmake somehow still fail to find it.

1> CMake generation started for default configuration: 'x64-Debug'.
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:\dev\pbrt-v4\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe"   -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\dev\pbrt-v4" 2>&1"
1> Working directory: D:\dev\pbrt-v4\out\build\x64-Debug
1> [CMake] -- OpenEXR at commit: f723c3940fff287c0a26b425b90a8e764823bfd4
1> [CMake] -- OpenVDB at commit: 414bed84c2fc22e188eac7b611aa85c7edd7a5a9
1> [CMake] -- Ptex at commit: 054047d02b9e06e690420b407114d2872435b953
1> [CMake] -- double-conversion at commit: cc1f75a114aca8d2af69f73a5a959aecbab0e87a
1> [CMake] -- filesystem at commit: c5f9de30142453eb3c6fe991e82dfc2583373116
1> [CMake] -- glfw at commit: 7b6aead9fb88b3623e3b3725ebb42670cbe4c579
1> [CMake] -- libdeflate at commit: 1fd0bea6ca2073c68493632dafc4b1ddda1bcbc3
1> [CMake] -- lodepng at commit: 8c6a9e30576f07bf470ad6f09458a2dcd7a6a84a
1> [CMake] -- qoi at commit: 028c75fd26e5e0758c7c711216c00404994c1ad3
1> [CMake] -- stb at commit: af1a5bc352164740c1cc1354942b1c6b72eacb8a
1> [CMake] -- utf8proc at commit: 2484e2ed5e1d9c19edcccf392a7d9920ad90dfaf
1> [CMake] -- zlib at commit: 54d591eabf9fe0e84c725638f8d5d8d202a093fa
1> [CMake] -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
1> [CMake] CMake Deprecation Warning at src/ext/zlib/CMakeLists.txt:1 (cmake_minimum_required):
1> [CMake]   Compatibility with CMake < 3.5 will be removed from a future version of
1> [CMake]   CMake.
1> [CMake] 
1> [CMake]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
1> [CMake]   CMake that the project does not need compatibility with older versions.
1> [CMake] 
1> [CMake] 
1> [CMake] -- Could NOT find Imath (missing: Imath_DIR)
1> [CMake] -- Could NOT find IlmBase (missing: IlmBase_DIR)
1> [CMake] -- Could NOT find OpenEXR (missing: OpenEXR_DIR)
1> [CMake] -- Could NOT find OpenEXR (missing: ILMBASE_INCLUDE_PATH OPENEXR_INCLUDE_PATH OPENEXR_IMATH_LIBRARY OPENEXR_ILMIMF_LIBRARY OPENEXR_IEX_LIBRARY OPENEXR_HALF_LIBRARY) (found version "1.6.1")
1> [CMake] -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
1> [CMake] CMake Deprecation Warning at src/ext/double-conversion/CMakeLists.txt:1 (cmake_minimum_required):
1> [CMake]   Compatibility with CMake < 3.5 will be removed from a future version of
1> [CMake]   CMake.
1> [CMake] 
1> [CMake]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
1> [CMake]   CMake that the project does not need compatibility with older versions.
1> [CMake] 
1> [CMake] 
1> [CMake] CMake Deprecation Warning at src/ext/utf8proc/CMakeLists.txt:1 (cmake_minimum_required):
1> [CMake]   Compatibility with CMake < 3.5 will be removed from a future version of
1> [CMake]   CMake.
1> [CMake] 
1> [CMake]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
1> [CMake]   CMake that the project does not need compatibility with older versions.
1> [CMake] 
1> [CMake] 
1> [CMake] -- Including Win32 support
1> [CMake] -- Could NOT find Imath (missing: Imath_DIR)
1> [CMake] -- Could NOT find IlmBase (missing: IlmBase_DIR)
1> [CMake] -- Could NOT find OpenEXR (missing: OpenEXR_DIR)
1> [CMake] CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
1> [CMake]   Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
1> [CMake] Call Stack (most recent call first):
1> [CMake]   C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
1> [CMake]   C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.30/Modules/FindZLIB.cmake:202 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
1> [CMake]   cmake/FindOpenEXR.cmake:113 (find_package)
1> [CMake]   CMakeLists.txt:108 (find_package)
1> [CMake] -- Configuring incomplete, errors occurred!
1> 'C:\WINDOWS\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:\dev\pbrt-v4\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe"   -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\dev\pbrt-v4" 2>&1"' execution failed with error: ''C:\WINDOWS\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:\dev\pbrt-v4\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe"   -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\dev\pbrt-v4" 2>&1"' returned with exit code: 1'.

kevyuu avatar Mar 22 '25 11:03 kevyuu

Had exactly the same issue.

As was stated in other similar issue, one of the recent (kinda) PRs broke this. Proper steps to get this repo working:

  1. Get completely new repo cloned:
$ git clone --recursive https://github.com/mmp/pbrt-v4.git
  1. Revert PR that breaks this repo (https://github.com/mmp/pbrt-v4/pull/482) and recreate submodules:
$ git revert 9fbf3f0eecce88f6ef7ffde420e448c4582b514a
$ git submodule update --init --recursive
  1. Continue as you would normally:
$ mkdir build
$ cd build
$ cmake ..
  1. Profit.

k-badz avatar Apr 08 '25 21:04 k-badz

Found alternative route. I actually followed (more or less) what is happening in GH CI for windows. So here are the steps to get this running without reverts.

(it should really be a part of the README....)

  1. Setup vcpkg and zlib
$ git clone https://github.com/microsoft/vcpkg.git
$ cd vcpkg; .\bootstrap-vcpkg.bat
$ .\vcpkg.exe install zlib:x64-windows
$ .\vcpkg.exe install zlib:x64-windows-static
  1. Get completely new repo cloned
$ git clone --recursive https://github.com/mmp/pbrt-v4.git
  1. Continue as you would normally, but with a little tweak in cmake
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=<vcpkg_repo_dir>/scripts/buildsystems/vcpkg.cmake
  1. At this point you can either open generated VS solution or do what CI does to build:
$ cd ..
$ cmake --build build --parallel --config Release
  1. Test if tests are working
$ .\build\Release\pbrt_test.exe

k-badz avatar Apr 09 '25 19:04 k-badz

This should be fixed in top-of-tree now. Sorry for the trouble.

mmp avatar Oct 22 '25 19:10 mmp