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

[libmesh] Support Windows #11835

Open
emptyVoid opened this issue Jun 8, 2020 · 10 comments
Open

[libmesh] Support Windows #11835

emptyVoid opened this issue Jun 8, 2020 · 10 comments
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@emptyVoid
Copy link
Contributor

Host Environment

  • OS: Windows 10 64-bit
  • Compiler: VC++ 19.26.28806

To Reproduce
Steps to reproduce the behavior:
./vcpkg install libmesh

Failure logs

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: D:/Projects/GitHub/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc --debug -c " CC='D:/Projects/GitHub/vcpkg/downloads/tools/msys2/msys64/usr/share/automake-1.16/compile cl.exe -nologo' CXX='D:/Projects/GitHub/vcpkg/downloads/tools/msys2/msys64/usr/share/automake-1.16/compile cl.exe -nologo' LD='link.exe -verbose' AR='D:/Projects/GitHub/vcpkg/downloads/tools/msys2/msys64/usr/share/automake-1.16/ar-lib lib.exe -verbose' RANLIB=':' CCAS=':' NM='dumpbin.exe -symbols -headers -all' DLLTOOL='link.exe -verbose -dll' ./../src/db1935d428-7b6bc82081/configure --build=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32 --disable-qhull --disable-silent-rules --verbose --enable-shared --disable-static --prefix=/D/Projects/GitHub/vcpkg/installed/x64-windows/debug --bindir='${prefix}'/../tools/libmesh/debug/bin --sbindir='${prefix}'/../tools/libmesh/debug/sbin --includedir='${prefix}'/../include --datarootdir='${prefix}'/share/libmesh"
    Working Directory: D:/Projects/GitHub/vcpkg/buildtrees/libmesh/x64-windows-dbg
    Error code: 77
    See logs for more information:
      D:\Projects\GitHub\vcpkg\buildtrees\libmesh\config-x64-windows-dbg-out.log
      D:\Projects\GitHub\vcpkg\buildtrees\libmesh\config-x64-windows-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:461 (vcpkg_execute_required_process)
  ports/libmesh/portfile.cmake:18 (vcpkg_configure_make)
  scripts/ports.cmake:76 (include)

config-x64-windows-dbg-out.log
config-x64-windows-dbg-err.log

Additional context
Looks like a defect in vcpkg_configure_make, might be related to #11765.

@Neumann-A, could you, please, take a look at this one too?

@MVoz
Copy link
Contributor

MVoz commented Jun 8, 2020

checking whether the C++ compiler works... no

configure: error: C++ compiler cannot create executables
See `config.log' for more details

libmesh it will not be assembled under MSVC, only under GCC

triplet MinGW ?

@PhoebeHui PhoebeHui assigned JackBoosY and unassigned PhoebeHui Jun 8, 2020
@PhoebeHui PhoebeHui added category:port-bug The issue is with a library, which is something the port should already support category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) and removed category:port-bug The issue is with a library, which is something the port should already support labels Jun 8, 2020
@MVoz
Copy link
Contributor

MVoz commented Jun 8, 2020

https://libmesh.github.io/installation.html

Building on Windows

The libMesh library can be built on Microsoft Windows using the msys2 software distribution and the mingw-w64 compiler. There are, however, a few specifics that need to be taken into account.

After installing msys2 you need to install the mingw-w64 C++ compiler. To check that the installation was successfull, you can run

g++ --version

port-bug - not support msvc

@emptyVoid
Copy link
Contributor Author

It might still be buildable with MSVC, even if they advice using MinGW.

Though there's another issue with the port -- despite --disable-qhull being set in the port file the build fails with (after removing ${MSYS_ROOT}/usr/share/automake-1.16/compile similarly to #11765 (comment)):

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: D:/Projects/GitHub/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc --debug -c " CC='cl.exe -nologo' CXX='cl.exe -nologo' LD='link.exe -verbose' AR='D:/Projects/GitHub/vcpkg/downloads/tools/msys2/msys64/usr/share/automake-1.16/ar-lib lib.exe -verbose' RANLIB=':' CCAS=':' NM='dumpbin.exe -symbols -headers -all' DLLTOOL='link.exe -verbose -dll' ./../src/db1935d428-7b6bc82081/configure --build=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32 --disable-qhull --disable-silent-rules --verbose --enable-shared --disable-static --prefix=/D/Projects/GitHub/vcpkg/installed/x64-windows/debug --bindir='${prefix}'/../tools/libmesh/debug/bin --sbindir='${prefix}'/../tools/libmesh/debug/sbin --includedir='${prefix}'/../include --datarootdir='${prefix}'/share/libmesh"
    Working Directory: D:/Projects/GitHub/vcpkg/buildtrees/libmesh/x64-windows-dbg
    Error code: 1
    See logs for more information:
      D:\Projects\GitHub\vcpkg\buildtrees\libmesh\config-x64-windows-dbg-out.log
      D:\Projects\GitHub\vcpkg\buildtrees\libmesh\config-x64-windows-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:461 (vcpkg_execute_required_process)
  ports/libmesh/portfile.cmake:23 (vcpkg_configure_make)
  scripts/ports.cmake:76 (include)

config-x64-windows-dbg-out.log
config-x64-windows-dbg-err.log

Looks like this symlink ruins the build.

@MVoz
Copy link
Contributor

MVoz commented Jun 8, 2020

tried to collect it for a long time, even fixed all the broken links
problem in the code

maybe crooked hands )))

@Neumann-A
Copy link
Contributor

@JackBoosY: Not looking at this one for windows since the build scripts itself are broken on windows and there are a lot of unresolved dependencies.

The port should probably use vcpkg qhull instead of the vendored one inside.

@Neumann-A
Copy link
Contributor

And not only qhull?

configure.ac:66: installing 'build-aux/missing'
Makefile.am: error: required file './README' not found
configure.ac:552: error: required file 'contrib/qhull/qhull/Makefile.in' not found
configure.ac:552: error: required file 'contrib/eigen/eigen/Makefile.in' not found
configure.ac:552: error: required file 'contrib/exodusii/v5.09/Makefile.in' not found
configure.ac:552: error: required file 'contrib/exodusii/v5.22/exodus/Makefile.in' not found
configure.ac:552: error: required file 'contrib/nemesis/v3.09/Makefile.in' not found
configure.ac:552: error: required file 'contrib/nemesis/v5.22/nemesis/Makefile.in' not found
Makefile.am: installing 'build-aux/depcomp'
contrib/Makefile.am:30: error: required directory contrib/eigen/eigen does not exist
contrib/Makefile.am:54: error: required directory contrib/netcdf/v4 does not exist
contrib/Makefile.am:66: error: required directory contrib/exodusii/v5.09 does not exist
contrib/Makefile.am:75: error: required directory contrib/exodusii/v5.22/exodus does not exist
contrib/Makefile.am:87: error: required directory contrib/nemesis/v3.09 does not exist
contrib/Makefile.am:96: error: required directory contrib/nemesis/v5.22/nemesis does not exist
contrib/Makefile.am:145: error: required directory contrib/qhull/qhull does not exist
autoreconf: automake failed with exit status: 1

@JackBoosY
Copy link
Contributor

@BillyONeal Could you please take a look?

Thanks.

@BillyONeal
Copy link
Member

I'm seeing all pacman powered stuff on the floor right now, probably broken by upstream pacman changes:

PS D:\vcpkg> .\vcpkg.exe install libmesh
Your feedback is important to improve Vcpkg! Please take 3 minutes to complete our survey by running: vcpkg contact --survey
Computing installation plan...
A suitable version of cmake was not found (required v3.17.2). Downloading portable cmake v3.17.2...
Downloading cmake...
  https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-win32-x86.zip -> D:\vcpkg\downloads\cmake-3.17.2-win32-x86.zip
Extracting cmake...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
  https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> D:\vcpkg\downloads\7-zip.commandline.18.1.0.nupkg
Extracting 7zip...
A suitable version of nuget was not found (required v4.8.1). Downloading portable nuget v4.8.1...
Downloading nuget...
  https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe -> D:\vcpkg\downloads\nuget.exe
The following packages will be built and installed:
    libmesh[core]:x86-windows
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Downloading powershell-core...
  https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip -> D:\vcpkg\downloads\PowerShell-6.2.1-win-x86.zip
Extracting powershell-core...
Starting package 1/1: libmesh:x86-windows
Building package libmesh[core]:x86-windows...
-- Downloading https://github.com/libMesh/libmesh/archive/21f623c837b3865ed65ec9608b357bdb1935d428.tar.gz...
-- Extracting source D:/vcpkg/downloads/libMesh-libmesh-21f623c837b3865ed65ec9608b357bdb1935d428.tar.gz
-- Using source at D:/vcpkg/buildtrees/libmesh/src/db1935d428-7b6bc82081
-- Acquiring MSYS2...
-- Downloading https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20190524.tar.xz/download...
gpg: /etc/pacman.d/gnupg/trustdb.gpg: trustdb created
gpg: no ultimately trusted keys found
gpg: starting migration from earlier GnuPG versions
gpg: porting secret keys from '/etc/pacman.d/gnupg/secring.gpg' to gpg-agent
gpg: migration succeeded
gpg: Generating pacman keyring master key...
gpg: key 9FE12AB9CE176F76 marked as ultimately trusted
gpg: directory '/etc/pacman.d/gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/etc/pacman.d/gnupg/openpgp-revocs.d/E34A0BE82D9FBDB8E244CABC9FE12AB9CE176F76.rev'
gpg: Done
==> Updating trust database...
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
==> Appending keys from msys2.gpg...
==> Locally signing trusted keys in keyring...
  -> Locally signing key D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A...
  -> Locally signing key 123D4D51A1793859C2BE916BBBE514E53E0D0813...
  -> Locally signing key B91BCF3303284BF90CC043CA9F418C233E652008...
  -> Locally signing key 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C...
==> Importing owner trust values...
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
gpg: inserting ownertrust of 4
==> Updating trust database...
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   4  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1  valid:   4  signed:   3  trust: 0-, 0q, 0n, 4m, 0f, 0u
gpg: depth: 2  valid:   3  signed:   0  trust: 3-, 0q, 0n, 0m, 0f, 0u
:: Synchronizing package databases...
downloading mingw32.db...
downloading mingw32.db.sig...
downloading mingw64.db...
downloading mingw64.db.sig...
downloading msys.db...
downloading msys.db.sig...
:: Starting core system upgrade...
warning: resolving dependencies...
terminate other MSYS2 programs before proceeding
looking for conflicting packages...
error: :: installing filesystem (2020.02-3) breaks dependency 'msys2-base' required by dash
failed to prepare transaction (could not satisfy dependencies)
-- Acquiring MSYS2... OK
-- Acquiring MSYS Packages...
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: D:/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc -c "pacman -S --noconfirm --needed diffutils pkg-config binutils libtool gettext gettext-devel make"
    Working Directory: D:/vcpkg/downloads/tools/msys2
    Error code: 1
    See logs for more information:
      D:\vcpkg\buildtrees\libmesh\msys-pacman-x86-windows-out.log
      D:\vcpkg\buildtrees\libmesh\msys-pacman-x86-windows-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_acquire_msys.cmake:115 (vcpkg_execute_required_process)
  scripts/cmake/vcpkg_configure_make.cmake:161 (vcpkg_acquire_msys)
  ports/libmesh/portfile.cmake:18 (vcpkg_configure_make)
  scripts/ports.cmake:73 (include)


Error: Building package libmesh:x86-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: libmesh:x86-windows
  Vcpkg version: 2020.02.04-nohash

Additionally, attach any relevant sections from the log files above.
PS D:\vcpkg>

@BillyONeal
Copy link
Member

@JackBoosY JackBoosY added category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly and removed category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) labels Jun 24, 2020
@BillyONeal BillyONeal added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist and removed category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly labels Jun 26, 2020
@BillyONeal
Copy link
Member

OK, now that the msys bit is fixed we're back to the same error originally in this report. I observe that our ci.baseline.txt says:

# libmesh installs tons of problematic files that conflict with other ports (boost, eigen, etc)
libmesh:arm64-windows=skip
libmesh:arm-uwp=skip
libmesh:x64-uwp=skip
libmesh:x64-windows=skip
libmesh:x64-windows-static=skip
libmesh:x86-windows=skip
libmesh:x64-osx=skip
libmesh:x64-linux=skip

and that libmesh's configure script has things like:

  # --------------------------------------------------------------
  # look for a decent C++ compiler or honor --with-cxx=...
  CXX_TRY_LIST="g++ icpc icc pgCC c++"

it seems unlikely that this port ever supported Windows. Their installation instructions at http://libmesh.github.io/installation.html suggest that only mingw-w64 is acceptable as a compiler which vcpkg does not support at this time, though there are ports looking to add that.

Changing tags to indicate that this is a feature request for the port. The right place to patch the port to work with msvc is probably not here.

@BillyONeal BillyONeal changed the title [libmesh] Build failure on Windows [libmesh] Support Windows Jun 26, 2020
@JackBoosY JackBoosY self-assigned this Aug 20, 2020
@Cheney-W Cheney-W assigned Adela0814 and unassigned JackBoosY Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

No branches or pull requests

8 participants