google / usd_from_gltf

Apache License 2.0
547 stars 85 forks source link

Error during build when installing ZLIB #81

Open MATTJ0NES opened 3 years ago

MATTJ0NES commented 3 years ago

I'm attempting to build with NVIDIA's prebuilt binaries. However, am getting an error in my build when it attempts to install ZLIB. My output is below showing the exact error message.

Any help is much appreciated, thanks!

(ufg) D:\Development\Python>python C:\UFG_SRC\tools\ufginstall\ufginstall.py C:\UFG_BUILD C:\USD-NVIDIA Install Settings: Source Directory: C:\UFG_SRC Install Directory: C:\UFG_BUILD USD Directory: C:\USD-NVIDIA Download Directory: C:\UFG_BUILD\src Build Directory: C:\UFG_BUILD\build Build Config: Release CMake Generator: Default Already Installed: Installing: DRACO, GIF, JPG, JSON, ZLIB, PNG, STB_IMAGE, TCLAP, USD_FROM_GLTF

-------- Installing DRACO -------- DRACO: Downloading https://github.com/google/draco/archive/1.3.5.zip to C:\UFG_BUILD\src\draco.zip DRACO: Unpacking to: C:\UFG_BUILD\src\draco-1.3.5 DRACO: CWD: C:\UFG_BUILD\build\draco-1.3.5 DRACO: Run: cmake C:\UFG_BUILD\src\draco-1.3.5 -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_GENERATOR_PLATFORM=x64 DRACO: CWD: C:\UFG_BUILD\build\draco-1.3.5 DRACO: Run: cmake --build . --config Release --target install -- /m

-------- Installing GIF -------- GIF: Downloading https://sourceforge.net/projects/giflib/files/giflib-5.1.9.tar.gz/download to C:\UFG_BUILD\src\giflib.tar.gz GIF: Unpacking to: C:\UFG_BUILD\src\giflib-5.1.9 GIF: CWD: C:\UFG_BUILD\build\giflib-5.1.9 GIF: Run: cmake C:\UFG_BUILD\src\giflib-5.1.9 -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_GENERATOR_PLATFORM=x64 GIF: CWD: C:\UFG_BUILD\build\giflib-5.1.9 GIF: Run: cmake --build . --config Release --target install -- /m

-------- Installing JPG -------- JPG: Downloading https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.2.zip to C:\UFG_BUILD\src\jpg.zip JPG: Unpacking to: C:\UFG_BUILD\src\libjpeg-turbo-2.0.2 JPG: CWD: C:\UFG_BUILD\build\libjpeg-turbo-2.0.2 JPG: Run: cmake C:\UFG_BUILD\src\libjpeg-turbo-2.0.2 -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_GENERATOR_PLATFORM=x64 JPG: CWD: C:\UFG_BUILD\build\libjpeg-turbo-2.0.2 JPG: Run: cmake --build . --config Release --target install -- /m

-------- Installing JSON -------- JSON: Downloading https://github.com/nlohmann/json/releases/download/v3.6.1/json.hpp to C:\UFG_BUILD\src\json/json.hpp JSON: CWD: C:\UFG_BUILD\build\json JSON: Run: cmake C:\UFG_BUILD\src\json -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_GENERATOR_PLATFORM=x64 JSON: CWD: C:\UFG_BUILD\build\json JSON: Run: cmake --build . --config Release --target install -- /m

-------- Installing ZLIB -------- ZLIB: Downloading https://github.com/madler/zlib/archive/v1.2.11.zip to C:\UFG_BUILD\src\zlib.zip ZLIB: Unpacking to: C:\UFG_BUILD\src\zlib-1.2.11 ZLIB: CWD: C:\UFG_BUILD\src\zlib-1.2.11 ZLIB: Run: cmake -DCMAKE_GENERATOR_PLATFORM=x64 . ZLIB: CWD: C:\UFG_BUILD\src\zlib-1.2.11 ZLIB: Run: cmake ZLIB: CWD: C:\UFG_BUILD\src\zlib-1.2.11 ZLIB: Run: msbuild /P:Configuration=Release zlib.sln ZLIB: ERROR: [WinError 2] The system cannot find the file specified

Rijkstarhn commented 3 years ago

Exactly same issue.

Rijkstarhn commented 3 years ago

I tried to rerun the command:python ufginstall.py "D:\gltftousdz\UFG_BUILD" "D:\USD" --testdata

The error message changed but still related to zlib:

-------- Installing PNG -------- PNG: File already exists, skipping download: D:\gltftousdz\UFG_BUILD\src\png.zip PNG: Unpacking to: D:\gltftousdz\UFG_BUILD\src\libpng-1.6.37 PNG: CWD: D:\gltftousdz\UFG_BUILD\build\libpng-1.6.37 PNG: Run: cmake D:\gltftousdz\UFG_BUILD\src\libpng-1.6.37 -DCMAKE_INSTALL_PREFIX=D:\gltftousdz\UFG_BUILD -DCMAKE_PREFIX_PATH=D:\gltftousdz\UFG_BUILD -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DPNG_BUILD_ZLIB=yesplease -DZLIB_INCLUDE_DIR=D:\gltftousdz\UFG_BUILD\src\zlib-1.2.11 -DCMAKE_PREFIX_PATH=D:\gltftousdz\UFG_BUILD\src\zlib-1.2.11\Release -DZLIB_LIBRARY=D:\gltftousdz\UFG_BUILD\src\zlib-1.2.11\Release\zlib.lib -DCMAKE_GENERATOR_PLATFORM=x64 PNG: CWD: D:\gltftousdz\UFG_BUILD\build\libpng-1.6.37 PNG: Run: cmake --build . --config Release --target install -- /m Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

LINK : fatal error LNK1181: cannot open input file 'D:\gltftousdz\UFG_BUILD\src\zlib-1.2.11\Release\zlib.lib' [D:\gltftousdz\UFG_BUILD\build\libpng-1.6.37\png-fix-itxt.vcxproj] png_static.vcxproj -> D:\gltftousdz\UFG_BUILD\build\libpng-1.6.37\Release\libpng16_static.lib LINK : fatal error LNK1181: cannot open input file 'D:\gltftousdz\UFG_BUILD\src\zlib-1.2.11\Release\zlib.lib' [D:\gltftousdz\UFG_BUILD\build\libpng-1.6.37\png.vcxproj]

PNG: ERROR: Command failed: cmake --build . --config Release --target install -- /m PNG: See log at: D:\gltftousdz\UFG_BUILD\build\libpng-1.6.37\log.txt -------------------------------end---------------------------------------- I don't have Release folder in the location, but I don't know why. The log contents are same to the error msg I paste here so I won't paste them again. BTW my device is Windows10 if this provide any clue.

ElGuardianDelJardin commented 3 years ago

What worked for me was, running the installer in "x64 Native Tools Command Prompt for VS 2019" As zlib tries to access Visual Studio at the end.

Rijkstarhn commented 3 years ago

What worked for me was, running the installer in "x64 Native Tools Command Prompt for VS 2019" As zlib tries to access Visual Studio at the end.

Thanks for your reply! I just retried to run the command again after restarting my device and it just worked.

methot-ilya-3ds commented 3 years ago

In addition, I've noticed that after a failed build the install will complain. I had to completely remove the ZLIB folder, then reopen the terminal in x64 Visual Studio console for it to work.