Skip to content

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

@foundry-markf

Description

@foundry-markf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildBuild-related issue/PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions