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

[lapack] build failure #12888

Closed
FishHe opened this issue Aug 13, 2020 · 13 comments
Closed

[lapack] build failure #12888

FishHe opened this issue Aug 13, 2020 · 13 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@FishHe
Copy link

FishHe commented Aug 13, 2020

After #12805 , the lapack can not be built.

[1/2] cmd /c "cd ../../x64-windows-static-md-dbg && "C:/Program Files/CMake/bin/cmake.exe" "D:/vcpkg/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean" "-DUSE_OPTIMIZED_BLAS=OFF" "-DCBLAS=OFF" "-DCMAKE_GNUtoMS=ON" "-DCMAKE_Fortran_COMPILER=D:/vcpkg/downloads/tools/msys2/msys64/mingw64/bin/gfortran.exe" "-DCMAKE_C_COMPILER=D:/vcpkg/downloads/tools/msys2/msys64/mingw64/bin/gcc.exe" "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms -m64 " "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/vcpkg/scripts/toolchains/mingw.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md" "-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:/vcpkg/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_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/vcpkg" "-D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/vcpkg/packages/lapack-reference_x64-windows-static-md/debug""
FAILED: ../../x64-windows-static-md-dbg/CMakeCache.txt
cmd /c "cd ../../x64-windows-static-md-dbg && "C:/Program Files/CMake/bin/cmake.exe" "D:/vcpkg/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean" "-DUSE_OPTIMIZED_BLAS=OFF" "-DCBLAS=OFF" "-DCMAKE_GNUtoMS=ON" "-DCMAKE_Fortran_COMPILER=D:/vcpkg/downloads/tools/msys2/msys64/mingw64/bin/gfortran.exe" "-DCMAKE_C_COMPILER=D:/vcpkg/downloads/tools/msys2/msys64/mingw64/bin/gcc.exe" "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms -m64 " "-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=D:/vcpkg/scripts/toolchains/mingw.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md" "-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:/vcpkg/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_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=D:/vcpkg" "-D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/vcpkg/packages/lapack-reference_x64-windows-static-md/debug""
CMake Error at CMakeLists.txt:3 (project):
The Ninja generator does not support Fortran using Ninja version

1.8.2

due to lack of required features. Ninja 1.10 or higher is required.

@Neumann-A
Copy link
Contributor

"-DCMAKE_MAKE_PROGRAM=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" is the problem. It is not using ninja from vcpkg

@LilyWangL LilyWangL added the category:port-bug The issue is with a library, which is something the port should already support label Aug 13, 2020
@MVoz
Copy link
Contributor

MVoz commented Aug 13, 2020

@Neumann-A

add PREPEND path ?

vcpkg_add_to_path(PREPEND ${NINJA_DIR}

@Neumann-A
Copy link
Contributor

@voskrese Won't help NINJA_DIR would still point to the first found NINJA instead of the vcpkg internal one (which is not even downloaded if it finds ninja from VS.)
#12895 solves it by introducing a version check for ninja

@MVoz
Copy link
Contributor

MVoz commented Aug 13, 2020

I was talking about parameters in the configurator and installer

example

vcpkg_add_to_path("${NINJA_PATH}")

vcpkg_add_to_path(PREPEND "${NINJA_PATH}")

@Neumann-A
Copy link
Contributor

doesn't matter because of line after that being:
list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}")

vcpkg_add_to_path("${NINJA_PATH}") could be removed

@MVoz
Copy link
Contributor

MVoz commented Aug 13, 2020

why are these settings ignored then?
after all, it is clearly stated here hmm

    if(GENERATOR STREQUAL "Ninja")
        vcpkg_find_acquire_program(NINJA)
        list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}")
    endif()

@Neumann-A
Copy link
Contributor

because of how vcpkg_find_acquire_program(NINJA) works. It always uses the system ninja if it finds one unless it can find one in vcpkg search/download paths. Since there is a system one it will not download the internal one.

@MVoz
Copy link
Contributor

MVoz commented Aug 13, 2020

there is still such an option, I do not know how with the old version, but in 2019 so

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -help

-no_ext : Only scripts from [VS160COMNTOOLS]\VsDevCmd\Core
          directory are run during initialization.
-no_logo : Suppress printing of the developer command prompt banner.

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -no_ext

[DEBUG:VsDevCmd] Writing pre-initialization environment to C:\temp\dd_vsdevcmd16_preinit_env.log
[DEBUG:core\vsdevcmd_start] initializing with arguments ''
[DEBUG:core\parse_cmd.bat] initializaing with arguments ''
[DEBUG:VsDevCmd.bat] Found version "16.7.1"
[DEBUG:VsDevCmd.bat] calling "core\dotnet.bat"
[DEBUG:core\dotnet.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "core\msbuild.bat"
[DEBUG:core\msbuild.bat] initializing...
[DEBUG:core\msbuild.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "core\winsdk.bat"
[DEBUG:winsdk.bat] initializing...
[DEBUG:core\winsdk.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] Skipping vsdevcmd\ext scripts since -no_ext was specified
[DEBUG:core\vsdevcmd_end] initializing with arguments ''
[DEBUG:VsDevCmd] Writing post-execution environment to C:\temp\dd_vsdevcmd16_env.log

where ninja

C:\Program Files\CMake\bin\ninja.exe
E:\tools\bin\ninja.exe

DEFAULT

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"

[DEBUG:VsDevCmd] Writing pre-initialization environment to C:\temp\dd_vsdevcmd16_preinit_env.log
[DEBUG:core\vsdevcmd_start] initializing with arguments ''
[DEBUG:core\parse_cmd.bat] initializaing with arguments ''
[DEBUG:VsDevCmd.bat] Found version "16.7.1"
[DEBUG:VsDevCmd.bat] calling "core\dotnet.bat"
[DEBUG:core\dotnet.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "core\msbuild.bat"
[DEBUG:core\msbuild.bat] initializing...
[DEBUG:core\msbuild.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "core\winsdk.bat"
[DEBUG:winsdk.bat] initializing...
[DEBUG:core\winsdk.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\cmake.bat"
[DEBUG:ext\cmake.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\ConnectionManagerExe.bat"
[DEBUG:ext\ConnectionManagerExe.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\fsharp.bat"
[DEBUG:ext\fsharp.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\html_help.bat"
[DEBUG:ext\html_help.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\netfxsdk.bat"
[DEBUG:ext\netfxsdk.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\perf_tools.bat"
[DEBUG:ext\perf_tools.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\roslyn.bat"
[DEBUG:ext\roslyn.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\team_explorer.bat"
[DEBUG:ext\team_explorer.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\testwindow.bat"
[DEBUG:ext\testwindow.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\vcvars.bat"
[DEBUG:ext\vcvars.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\vsicvars.bat"
[DEBUG:ext\vsicvars.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\vssdk.bat"
[DEBUG:ext\vssdk.bat] init:COMPLETE
[DEBUG:core\vsdevcmd_end] initializing with arguments ''
[DEBUG:VsDevCmd] Writing post-execution environment to C:\temp\dd_vsdevcmd16_env.log

where ninja

C:\Program Files\CMake\bin\ninja.exe
E:\tools\bin\ninja.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe

@MVoz
Copy link
Contributor

MVoz commented Aug 13, 2020

[DEBUG:VsDevCmd.bat] calling "ext\cmake.bat"

:export_path

if not exist "%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin" goto :error_setting_path
if not exist "%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja" goto :error_setting_path
set "PATH=%PATH%;%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja"
goto :end

@Neumann-A
?
CMAKE_IGNORE_PATH=$ENV{VSINSTALLDIR}/Common7/IDE/CommonExtensions/Microsoft/CMake

echo %VSINSTALLDIR%
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\

or

CMAKE_IGNORE_PATH=$ENV{DEVENVDIR}/CommonExtensions/Microsoft/CMake

echo %DEVENVDIR%
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\

@MVoz
Copy link
Contributor

MVoz commented Aug 13, 2020

set VSCMD_ARG_NO_EXT=1

if "%VSCMD_ARG_NO_EXT%"=="1" (
    if "%VSCMD_DEBUG%" GEQ "1" @echo [DEBUG:%~nx0] Skipping vsdevcmd\ext scripts since -no_ext was specified
    goto :ext_end
)

hmm... does not work for calling vcvarsall.bat

https://developercommunity.visualstudio.com/idea/419081/add-option-to-vcvarsallbat-to-pick-and-choose-what.html

@LilyWangL
Copy link
Contributor

Waiting for PR #12895 merged, this issue will be fixed and closed.

@Neumann-A
Copy link
Contributor

temporary workaround until mentioned PR is merged:
use vcpkg fetch ninja before installing lapack-reference

@JackBoosY
Copy link
Contributor

Close this issue via #12895 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

5 participants