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

Windows builds with precompiled headers enabled fails on 24.08 and 24.11 #3408

Closed
foundry-markf opened this issue Nov 7, 2024 · 4 comments
Closed
Labels
build Build-related issue/PR

Comments

@foundry-markf
Copy link

Description of Issue

When building on Windows with the default settings, an error like this is seen

[316/4275] Building CXX object pxr\base\arch\CMakeFiles\arch.dir\pch.cpp.obj
FAILED: pxr/base/arch/CMakeFiles/arch.dir/pch.cpp.obj
C:\PROGRA~1\MIB055~1\2022\PROFES~1\VC\Tools\MSVC\1440~1.338\bin\Hostx64\x64\cl.exe  /nologo /TP -DARCH_EXPORTS=1 -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DBOOST_PYTHON_NO_PY_SIGNATURES -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DMFB_ALT_PACKAGE_NAME=arch -DMFB_PACKAGE_MODULE=Arch -DMFB_PACKAGE_NAME=arch -DNOMINMAX -DOPENEXR_DLL -DPXR_BUILD_LOCATION=usd -DPXR_GL_SUPPORT_ENABLED -DPXR_MATERIALX_SUPPORT_ENABLED -DPXR_OIIO_PLUGIN_ENABLED -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -DWIN32_LEAN_AND_MEAN -DYY_NO_UNISTD_H -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -Darch_EXPORTS -IT:\ecg-usd-build\v24.08\build\RelWithDebInfo\build\usd\include /EHsc /Zc:rvalueCast /Zc:strictStrings /Zc:inline- /W3 /bigobj /Zi /MP /Gm- /wd4003 /wd4244 /wd4305 /wd4267 /wd4506 /wd4091 /wd4273 /wd4180 /wd4334 /Zm150 /MD /Zi /O2 /Ob1 /DNDEBUG -std:c++17 /Yc"pxr/base/arch/pch.h" /FI"pxr/base/arch/pch.h" /Fp"T:/ecg-usd-build/v24.08/build/RelWithDebInfo/build/usd/include/pxr/base/arch/RelWithDebInfo/pch.pch" /showIncludes /Fopxr\base\arch\CMakeFiles\arch.dir\pch.cpp.obj /Fdpxr\base\arch\CMakeFiles\arch.dir\ /FS -c T:\ecg-usd-build\v24.08\build\RelWithDebInfo\build\usd\pxr\base\arch\pch.cpp
c1xx: fatal error C1083: Cannot open compiler intermediate file: 'T:/ecg-usd-build/v24.08/build/RelWithDebInfo/build/usd/include/pxr/base/arch/RelWithDebInfo/pch.pch': No such file or directory

However, I note that the CI in this repo has precompiled headers explicitly disabled. I don't have enough information in the Git history to determine if this is due to this issue

https://github.com/PixarAnimationStudios/OpenUSD/blob/release/.github/workflows/buildusd.yml#L177

python build_scripts/build_usd.py --no-materialx --generator "Visual Studio 16 2019" --build USDgen/build --src USDgen/src USDinst --build-args USD,"-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF" -v

Is the intent that precompiled headers should work in Windows builds?
Should the CI be updated to reflect that?

There's obviously a workaround at the moment.

Steps to Reproduce

  1. Build Windows with default settings

System Information (OS, Hardware)

Windows 10
VisualStudio 2022

Package Versions

N/A

Build Flags

Nothing specific, other than leave the default precompiled headers option for Windows builds.

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-10412

@sunyab
Copy link
Contributor

sunyab commented Nov 8, 2024

@foundry-markf We definitely expect precompiled headers to work on Windows. We have not run into this error in our local CI builds on Visual Studio 2019, and I've also been unable to reproduce this manually using VS2022.

That said, it looks like there've been other reports of similar problems, for example #3141 (which was closed in favor of #3204). I'm hoping to merge that one in shortly.

Side note: precompiled headers were disabled on Azure CI builds (which are migrating to GitHub Actions) because of problems with disk space on the runners. We should probably revisit this now that we don't have to deal with the extra weight of boost headers.

@foundry-markf
Copy link
Author

Thanks @sunyab.

I've tried building the dev branch this morning at commit e45ffe6 and it fails in the same way as described above.

However, I manually copy-n-pasted the changes proposed in #3204, and I'm no longer seeing the issue.

I'll retest once you've approved and merged in the changes into dev.

@jesschimein
Copy link
Collaborator

It sounds like the changes in #3204 work to resolve this and 3204 was just merged into dev, so I'm closing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build-related issue/PR
Projects
None yet
Development

No branches or pull requests

4 participants