microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.81k stars 6.3k forks source link

[gmp:x64-windows] build failure #17286

Closed daniel-zint closed 3 years ago

daniel-zint commented 3 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: ./vcpkg install yasm-tool:x86-windows ./vcpkg install gmp:x64-windows

Failure logs

Call Stack (most recent call first): scripts/cmake/vcpkg_install_msbuild.cmake:165 (vcpkg_execute_required_process) ports/gmp/portfile.cmake:53 (vcpkg_install_msbuild) scripts/ports.cmake:142 (include)

Error: Building package gmp:x64-windows failed with: BUILD_FAILED Please ensure you're using the latest portfiles with .\vcpkg update, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: gmp:x64-windows Vcpkg version: 2021-01-13-d67989bce1043b98092ac45996a8230a059a2d7e

Additionally, attach any relevant sections from the log files above.



-Please attach any additional failure logs mentioned in the console output.
[build-x64-windows-rel-out.log](https://github.com/microsoft/vcpkg/files/6313497/build-x64-windows-rel-out.log)

**Additional context**
I am aware that yasm-tool:x86-windows needs to be installed first but that did not solve this issue for me.
NancyLi1013 commented 3 years ago

Hi @DanielZint

Thanks for posting this issue.

    The system cannot find the path specified.
     2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(285,5): error MSB3073: The command "if exist "C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\..\msvc\"\include\gmp.h ( [C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(285,5): error MSB3073: del /f /q "C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\..\msvc\"\include\gmp.h [C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(285,5): error MSB3073: ) [C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(285,5): error MSB3073: if exist C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\..\msvc\\licenses\gmp.txt ( [C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(285,5): error MSB3073: del /f /q C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\..\msvc\\licenses\gmp.txt [C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(285,5): error MSB3073: ) [C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(285,5): error MSB3073: :VCEnd" exited with code 1. [C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj]
     2>Done Building Project "C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.vcxproj" (Rebuild target(s)) -- FAILED.
     1>Done Building Project "C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\libgmp.sln" (Rebuild target(s)) -- FAILED.

Could you please check the path in the command line?

O-Tom commented 3 years ago

Here is an excerpt from the buildlog that @DanielZint provided: "C:\Program Files\vcpkg\installed\x86-windows\tools\yasm-tool\yasm.exe" -Xvc -f win64 -o "C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\obj\ReleaseDLL\x64\libgmp\addlsh1_n.obj" -rraw -pgas "C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\SMP\mpn\x86_64\addlsh1_n.s"

He also wrote that to compile gmp for the x64-windows triplet he used the following commands:

./vcpkg install yasm-tool:x86-windows
./vcpkg install gmp:x64-windows

How comes an x64 target is requiring an x86 tool (yasm) to be installed ? Could the gmp port be modified to use the x64 version of yasm-tool or declare a dependency on the x86 version if it really needs it ?

daniel-zint commented 3 years ago

I think I found the issue. When installing vcpkg in a different folder, then everything works as expected: C:\Program Files\vcpkg - does not work C:\libs\vcpkg - works I guess it has something to do with admin rights. The folder C:\Program Files\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\msvc\ is empty, whereas C:\libs\vcpkg\buildtrees\gmp\x64-windows-rel\19f0b65fd0-9b395bc164.clean\msvc\ is not.

It is just confusing for me because I used the Program Files folder already before and never had an issue. I am not sure though if maybe some Windows update messed that up.

Basically my problem was solved now but I have one question remaining. When using GMP I got the error message that gmp.dll was not found. I copied it manually from C:\libs\vcpkg\installex\x64-windows\bin to my executable folder and then everything worked fine. This issue might also be caused by cgal, the library that I actually want to use. Should I open a new issue for that or am I just missing something obvious?

basselin7u commented 3 years ago

Hello, I had the same issue during the installation. It is not a problem of writing rights, but a problem of space in the folder name.

daniel-zint commented 3 years ago

Thank you for pointing that out @basselin7u !

NancyLi1013 commented 3 years ago

@DanielZint

Thanks for your further investigation. For the original issue, it seems to be clear that this is caused by space in path.

For the new issue you mentioned, you can open a new issue.