microsoft / vcpkg

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

mpir build fails #3772

Closed degski closed 4 years ago

degski commented 6 years ago

With the same error log as #3771

On this machine, I never had an intel compiler installed, I do have installed tbb and mkl from intel (they are free to use, register). Solution in #3771 works here as well.

acgetchell commented 6 years ago

Also fails on MacOS:

-- Building /Users/adam/vcpkg/buildtrees/mpir/src/mpir-3.0.0-813182416b/build.vc14/lib_mpir_gc/lib_mpir_gc.vcxproj for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
    Command failed: msbuild;/Users/adam/vcpkg/buildtrees/mpir/src/mpir-3.0.0-813182416b/build.vc14/lib_mpir_gc/lib_mpir_gc.vcxproj;/p:Configuration=Release;/t:Rebuild;/p:Platform=x64;/p:PlatformToolset=external;/p:VCPkgLocalAppDataDisabled=true;/p:UseIntelMKL=No;/p:WindowsTargetPlatformVersion=;/m;/p:WholeProgramOptimization=false;/p:RuntimeLibrary=MultiThreadedDLL
    Working Directory: /Users/adam/vcpkg/buildtrees/mpir/x64-osx-rel
    See logs for more information:

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_msbuild.cmake:119 (vcpkg_execute_required_process)
  ports/mpir/portfile.cmake:40 (vcpkg_build_msbuild)
  scripts/ports.cmake:71 (include)

Error: Building package mpir:x64-osx 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: mpir:x64-osx
  Vcpkg version: 0.0.113-unknownhash

The only error log produced (patch-x64-osx-0-err.log) is:

Checking patch build.vc/mpir_debug_lib.props...
error: while searching for:
  <ItemDefinitionGroup>
    <ClCompile>
      <ObjectFileName>$(IntDir)dum\my\%(RelativeDir)</ObjectFileName>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
    </ClCompile>
    <Link>

error: patch failed: build.vc/mpir_debug_lib.props:9
error: build.vc/mpir_debug_lib.props: patch does not apply
Checking patch build.vc/mpir_release_lib.props...
error: while searching for:
  <ItemDefinitionGroup>
    <ClCompile>
      <ObjectFileName>$(IntDir)dum\my\%(RelativeDir)</ObjectFileName>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
    </ClCompile>
    <Link>

error: patch failed: build.vc/mpir_release_lib.props:9
error: build.vc/mpir_release_lib.props: patch does not apply
degski commented 6 years ago

@acgetchell There are 2 issues, the most important one is that mpir in its current form [in vcpkg] cannot compile on OSX as it uses msbuild and a vcproj-file (that's the error you see). The second problem is that if it would build, it would build a generic c library (no asm), i.e. not optimized for any architecture and is therefor useless. For vc the assembler should be vsyasm.exe, not ml64.exe and then there are different project files for different architectures, which should be created as different targets in the package list, i.e. mpir[haswell], mpir[skylake], etc. @ras0219-msft Just signalling the above.

acgetchell commented 6 years ago

@degski Thanks for your comment. CGAL typically uses mpfr which requires gmp. As I understand it, mpir is a Windows port of gmp. It’s understandable that vcpkg, being initially Windows only, used mpir. However,gmp is what really should be used on non-Windows machines.

degski commented 6 years ago

@acgetchell

It’s understandable that vcpkg, being initially Windows only, used mpir. However,gmp is what really should be used on non-Windows machines.

Yes, of course. mpir builds on nix and osx as well, though, just not with the project-files, but the nix-way.

acgetchell commented 5 years ago

Using brew, when I install yasm the package builds!

┌─[adam][hapkido][±][master ✓][~/vcpkg] └─▪ brew install yasm Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> Updated Formulae asdf atomist-cli cake dhall dhall-json embulk glib-networking hadolint juju mps-youtube taskell wget

==> Downloading https://homebrew.bintray.com/bottles/yasm-1.3.0_2.mojave.bottle.tar.gz ######################################################################## 100.0% ==> Pouring yasm-1.3.0_2.mojave.bottle.tar.gz 🍺 /usr/local/Cellar/yasm/1.3.0_2: 45 files, 3MB ┌─[adam][hapkido][±][master ✓][~/vcpkg] └─▪ ./vcpkg install mpir The following packages will be built and installed: mpir[core]:x64-osx Starting package 1/1: mpir:x64-osx Building package mpir[core]:x64-osx... -- Using cached /Users/adam/vcpkg/downloads/mpir-3.0.0.tar.bz2 -- Using source at /Users/adam/vcpkg/buildtrees/mpir/src/3.0.0-a3f571144a -- Configuring x64-osx-dbg -- Building x64-osx-dbg -- Configuring x64-osx-rel -- Building x64-osx-rel -- Performing post-build validation -- Performing post-build validation done Building package mpir[core]:x64-osx... done Installing package mpir[core]:x64-osx... Installing package mpir[core]:x64-osx... done Elapsed time for package mpir:x64-osx: 1.217 min

Total elapsed time: 1.217 min

lrineau commented 5 years ago

It seems yasm is part of the system tools that users are supposed to install by themselves, without relying on brew. On my Linux machine, if I uninstall yasm, then the compilation of mpir fails the same way:

Building package mpir[core]:x64-linux... 
-- Using cached /home/lrineau/Git/vcpkg/downloads/mpir-3.0.0.tar.bz2
-- Using source at /home/lrineau/Git/vcpkg/buildtrees/mpir/src/3.0.0-a3f571144a
CMake Error at scripts/cmake/vcpkg_find_acquire_program.cmake:254 (message):
  Could not find yasm.  Please install it via your package manager.
Call Stack (most recent call first):
  ports/mpir/portfile.cmake:27 (vcpkg_find_acquire_program)
  scripts/ports.cmake:71 (include)

Error: Building package mpir:x64-linux failed with: BUILD_FAILED

There is that message in the error log:

Could not find yasm. Please install it via your package manager.

In my opinion, that is not a bug, but a wanted behavior of brew. This issue should be closed.

acgetchell commented 5 years ago

I don't believe one should have to use a package manager with vcpkg to install libraries. Especially because you get conditions where one package manager's version is not compatible with the other. For example, brew no longer has options, so one can't use it's version of Boost with Qt. But there is now a discrepancy where one could install boost with brew or with vcpkg, but only one of them would work.

I'd prefer to live entirely within vcpkg and it's ports.

Also, yasm isn’t a typical thing to install on Windows.

lrineau commented 5 years ago

Yasm is not a library: it is a compiler, for assembler. It seems there are several "tools" dealt specially in vcpkg, with the CMake function vcpkg_find_acquire_program.

degski commented 5 years ago

Also, yasm isn’t a typical thing to install on Windows.

You're right. The only reason to have the yasm assembler (instead of ml64.exe, which does Intel syntax) is to deal with AT&T assembler syntax (which GCC/Clang support out of the box). Because, initially at least a lot of the assembler came from GMP, which targets GCC, yasm was/is used. In the meanwhile yasm is dead, and as far as I can see, MPIR is quasi-dead. Bill Hart and Brian Gladman have basically split ways, agreeing to dis-agree on the future direction of MPIR. For reasons unclear to me [I've asked him many times] Bill Hart is adamant to pursue the development of a contender to GMP on Linux and OSX, in the process stifling MPIR development in its tracks. The original objective of the project was to provide GMP on Windows. It's an example of OSS development going bad.

JackBoosY commented 4 years ago

@degski Any conclusion? I can't repro this issue now, does it solved?

lrineau commented 4 years ago

I can install mpir on Linux with vcpkg if the system package yasm is installed. On Windows system, yasm seems to be automatically installed by vcpkg, but not on MacOS and Linux.

I have created PR https://github.com/microsoft/vcpkg/pull/9191, so that hints are given about ways to install yasm on MacOS (with brew) and on Linux Debian/Ubuntu (with apt).

degski commented 4 years ago

@JackBoosY I don't understand your question.

cbezault commented 4 years ago

I think he's just trying to figure out if he can close out this issue. @JackBoosY his long comment was purely informative to the state of mpir and yasm. #9191 should fix this issue.