microsoft / vcpkg

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

[lapack-reference] build failure - gfortran broken #22104

Closed milmillin closed 1 month ago

milmillin commented 2 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: ./vcpkg install lapack:x64-windows

Failure logs

Computing installation plan...
The following packages will be built and installed:
    lapack[core]:x64-windows -> 3#2
  * lapack-reference[blas-select,core,noblas]:x64-windows -> 3.8.0#6
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Restored 0 packages from C:\Users\milmi\AppData\Local\vcpkg\archives in 155.9 us. Use --debug to see more details.
Starting package 1/2: lapack-reference:x64-windows
Building package lapack-reference[blas-select,core,noblas]:x64-windows...
-- Using cached Reference-LAPACK-lapack-v3.8.0.tar.gz.
-- Cleaning sources at D:/vcpkg2/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source D:/vcpkg2/downloads/Reference-LAPACK-lapack-v3.8.0.tar.gz
-- Using source at D:/vcpkg2/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean
-- The Fortran compiler identification is unknown
-- No Fortran compiler found on the PATH. Using MinGW gfortran!
-- Using cached msys-mingw-w64-x86_64-gcc-fortran-10.2.0-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-gcc-libs-10.2.0-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz.
-- Using cached msys-mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz.
-- Using cached msys-mingw-w64-x86_64-mpfr-4.1.0-2-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-gcc-10.2.0-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-binutils-2.34-3-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-crt-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-headers-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-libiconv-1.16-2-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz.
-- Using cached msys-mingw-w64-x86_64-zlib-1.2.11-8-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-x86_64-zstd-1.4.5-1-any.pkg.tar.zst.
-- Using cached msys-gzip-1.10-1-x86_64.pkg.tar.xz.
-- Using cached msys-bash-4.4.023-2-x86_64.pkg.tar.xz.
-- Using cached msys-diffutils-3.7-1-x86_64.pkg.tar.xz.
-- Using cached msys-coreutils-8.32-1-x86_64.pkg.tar.xz.
-- Using cached msys-grep-3.0-2-x86_64.pkg.tar.xz.
-- Using cached msys-sed-4.8-1-x86_64.pkg.tar.xz.
-- Using cached msys-libpcre-8.44-1-x86_64.pkg.tar.xz.
-- Using cached msys-gawk-5.1.0-1-x86_64.pkg.tar.xz.
-- Using cached msys-mpfr-4.1.0-1-x86_64.pkg.tar.zst.
-- Using cached msys-gmp-6.2.0-1-x86_64.pkg.tar.xz.
-- Using cached msys-libreadline-8.0.004-1-x86_64.pkg.tar.xz.
-- Using cached msys-ncurses-6.2-1-x86_64.pkg.tar.xz.
-- Using cached msys-pkg-config-0.29.2-4-x86_64.pkg.tar.zst.
-- Using cached msys-make-4.3-1-x86_64.pkg.tar.xz.
-- Using cached msys-libintl-0.19.8.1-1-x86_64.pkg.tar.xz.
-- Using cached msys-libiconv-1.16-2-x86_64.pkg.tar.zst.
-- Using cached msys-gcc-libs-9.3.0-1-x86_64.pkg.tar.xz.
-- Using cached msys-msys2-runtime-3.2.0-8-x86_64.pkg.tar.zst.
-- Using msys root at D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb
-- Found external ninja('1.10.2').
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: ninja -v
    Working Directory: D:/vcpkg2/buildtrees/lapack-reference/x64-windows-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      D:\vcpkg2\buildtrees\lapack-reference\config-x64-windows-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:345 (vcpkg_execute_required_process)
  ports/lapack-reference/portfile.cmake:64 (vcpkg_configure_cmake)
  scripts/ports.cmake:142 (include)

Error: Building package lapack-reference:x64-windows failed with: BUILD_FAILED

config-x64-windows-out.log

[1/2] cmd /c "cd ../../x64-windows-dbg && "D:/vcpkg2/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/bin/cmake.exe" "D:/vcpkg2/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean" "-DUSE_OPTIMIZED_BLAS=ON" "-DCBLAS=OFF" "-DCMAKE_GNUtoMS=ON" "-DCMAKE_Fortran_COMPILER=D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb/mingw64/bin/gfortran.exe" "-DCMAKE_C_COMPILER=D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb/mingw64/bin/gcc.exe" "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms -m64 " "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/vcpkg2/scripts/toolchains/mingw.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=D:/vcpkg2/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/vcpkg2" "-DZ_VCPKG_ROOT_DIR=D:/vcpkg2" "-D_VCPKG_INSTALLED_DIR=D:/vcpkg2/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/vcpkg2/packages/lapack-reference_x64-windows/debug""
FAILED: ../../x64-windows-dbg/CMakeCache.txt 
cmd /c "cd ../../x64-windows-dbg && "D:/vcpkg2/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/bin/cmake.exe" "D:/vcpkg2/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean" "-DUSE_OPTIMIZED_BLAS=ON" "-DCBLAS=OFF" "-DCMAKE_GNUtoMS=ON" "-DCMAKE_Fortran_COMPILER=D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb/mingw64/bin/gfortran.exe" "-DCMAKE_C_COMPILER=D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb/mingw64/bin/gcc.exe" "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms -m64 " "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/vcpkg2/scripts/toolchains/mingw.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=D:/vcpkg2/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/vcpkg2" "-DZ_VCPKG_ROOT_DIR=D:/vcpkg2" "-D_VCPKG_INSTALLED_DIR=D:/vcpkg2/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/vcpkg2/packages/lapack-reference_x64-windows/debug""
-- The Fortran compiler identification is unknown
-- The C compiler identification is GNU 10.2.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - failed
-- Check for working Fortran compiler: D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb/mingw64/bin/gfortran.exe
-- Check for working Fortran compiler: D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb/mingw64/bin/gfortran.exe - broken
CMake Error at D:/vcpkg2/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/share/cmake-3.21/Modules/CMakeTestFortranCompiler.cmake:54 (message):
  The Fortran compiler

    "D:/vcpkg2/downloads/tools/msys2/456f7716e2893cfb/mingw64/bin/gfortran.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: D:/vcpkg2/buildtrees/lapack-reference/x64-windows-dbg/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_bbf2c && [1/4] Building Fortran preprocessed CMakeFiles/cmTC_bbf2c.dir/testFortranCompiler.f-pp.f
    FAILED: CMakeFiles/cmTC_bbf2c.dir/testFortranCompiler.f-pp.f CMakeFiles/cmTC_bbf2c.dir/testFortranCompiler.f.obj.ddi 
    cmd.exe /C "D:\vcpkg2\downloads\tools\msys2\456f7716e2893cfb\mingw64\bin\gfortran.exe -cpp   -mabi=ms -m64 -E D:/vcpkg2/buildtrees/lapack-reference/x64-windows-dbg/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_bbf2c.dir/testFortranCompiler.f-pp.f && D:\vcpkg2\downloads\tools\cmake-3.21.1-windows\cmake-3.21.1-windows-i386\bin\cmake.exe -E cmake_ninja_depends --tdi=CMakeFiles\cmTC_bbf2c.dir\FortranDependInfo.json --lang=Fortran --pp=CMakeFiles/cmTC_bbf2c.dir/testFortranCompiler.f-pp.f --dep=CMakeFiles\cmTC_bbf2c.dir\testFortranCompiler.f-pp.f.d --obj=CMakeFiles\cmTC_bbf2c.dir\testFortranCompiler.f.obj --ddi=CMakeFiles\cmTC_bbf2c.dir\testFortranCompiler.f.obj.ddi"
    <built-in>: internal compiler error: Segmentation fault
    libbacktrace could not find executable to open
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <https://github.com/msys2/MINGW-packages/issues> for instructions.
    ninja: build stopped: subcommand failed.

I tried bumping CMake to 3.22.1 mentioned in #21456 but that didn't help. I think it has something to do with my gfortran. Any help is appreciated.

JackBoosY commented 2 years ago

Will be fixed by #19413.

lalishansh commented 1 year ago

Hello anyone following this issue ?

any way i can build this with msvc and iFort ?

github-actions[bot] commented 1 month ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

sfhacker commented 1 month ago

This is from 2021!