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

Macos cmake fails to install dependencies with ninja: error: build.ninja:200: multiple rules generate #746

Open
viatsyshyn opened this issue May 20, 2024 · 0 comments

Comments

@viatsyshyn
Copy link

  • I've read Brief overview section and do understand basic concepts. [Yes]
  • I've read F.A.Q. section and there is no solution to my problem there. [Yes]
  • I've read Code of Conduct, I promise to be polite and will do my best at being constructive. [Yes]
  • I've read Reporting bugs section carefully. [Yes]
  • I've checked that all the hunter_add_package/find_package API used by me in the example is the same as in documentation. [Yes]
  • I'm using latest Hunter URL/SHA1. [Yes]
  • I've created SSCCE reproducing the issue:
# CMakeLists.txt

cmake_minimum_required(VERSION 3.28)

include("cmake/HunterGate.cmake")

HunterGate(
        URL "https://github.com/cpp-pm/hunter/archive/v0.25.5.tar.gz"
        SHA1 "a20151e4c0740ee7d0f9994476856d813cdead29"
)

project(kalmanfilter)

set(HUNTER_STATUS_DEBUG ON)

hunter_add_package(Eigen)

set(CMAKE_CXX_STANDARD 26)

# ----------------------------------------
# Eigen
# ----------------------------------------
find_package(Eigen3 REQUIRED CONFIG)

set(SOURCE_FILES src/kalman-filter.cpp kalman-test.cpp)

add_executable(kalman-test ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen)

Here is the log until first error reported by Hunter, option HUNTER_STATUS_DEBUG is ON:

I've checked that the first error in logs IS NOT external.build.failed. [Yes]

  • I'm building on [OSX].
  • [I'm using system CMake|CLion bundled]
  • CMake version: 3.29.3
  • Cmake version: 3.28.1 (CMake; JetBrains IDE bundle; build 19)
  • I'm not using toolchain

When cmake
I'm using the next command line on generate step:

"/Users/viatsyshyn/Applications/CLion Nova.app/Contents/bin/cmake/mac/aarch64/bin/cmake" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=/Users/viatsyshyn/Applications/CLion Nova.app/Contents/bin/ninja/mac/aarch64/ninja" -G Ninja -S ~/Projects/kalmanfilter-cpp -B ~/Projects/kalmanfilter-cpp/cmake-build-debug


I get following log with error ninja: error: build.ninja:200: multiple rules generate

-- [hunter *** DEBUG *** 2024-05-20T12:45:44] Single-configuration generator
-- [hunter *** DEBUG *** 2024-05-20T12:45:44] Using default cache server
-- [hunter *** DEBUG *** 2024-05-20T12:45:44] List of cache servers:
-- [hunter *** DEBUG *** 2024-05-20T12:45:44]   * https://github.com/cpp-pm/hunter-cache
-- [hunter *** DEBUG *** 2024-05-20T12:45:44] Settings (finalize):
-- [hunter *** DEBUG *** 2024-05-20T12:45:44]   HunterGate done (NO)
-- [hunter *** DEBUG *** 2024-05-20T12:45:44]   Cache init (YES)
-- [hunter *** DEBUG *** 2024-05-20T12:45:44] Variables from HunterGate:
-- [hunter *** DEBUG *** 2024-05-20T12:45:44]   HUNTER_GATE_ROOT: /Users/viatsyshyn/.hunter
-- [hunter *** DEBUG *** 2024-05-20T12:45:44]   HUNTER_GATE_VERSION: 0.25.5
-- [hunter *** DEBUG *** 2024-05-20T12:45:44]   HUNTER_GATE_SHA1: a20151e4c0740ee7d0f9994476856d813cdead29
-- [hunter] Calculating Toolchain-SHA1
-- [hunter *** DEBUG *** 2024-05-20T12:45:44] [/Users/viatsyshyn/Projects/nulp/kalmanfilter-cpp/cmake-build-debug/_3rdParty/Hunter/toolchain] > "/Users/viatsyshyn/Applications/CLion Nova.app/Contents/bin/cmake/mac/aarch64/bin/cmake" "-DTOOLCHAIN_INFO_FILE=/Users/viatsyshyn/Projects/nulp/kalmanfilter-cpp/cmake-build-debug/_3rdParty/Hunter/toolchain/toolchain.info.NOLF" "-DHUNTER_SELF=/Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked" "-GNinja" "-H/Users/viatsyshyn/Projects/nulp/kalmanfilter-cpp/cmake-build-debug/_3rdParty/Hunter/toolchain" "-B/Users/viatsyshyn/Projects/nulp/kalmanfilter-cpp/cmake-build-debug/_3rdParty/Hunter/toolchain/_builds" "-DCMAKE_MAKE_PROGRAM=/Users/viatsyshyn/Applications/CLion Nova.app/Contents/bin/ninja/mac/aarch64/ninja" "-DCMAKE_RELEASE_POSTFIX=" "-DCMAKE_DEBUG_POSTFIX=d"
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (6.3s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/viatsyshyn/Projects/nulp/kalmanfilter-cpp/cmake-build-debug/_3rdParty/Hunter/toolchain/_builds
-- [hunter *** DEBUG *** 2024-05-20T12:45:50] Already exists: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/toolchain.info
-- [hunter] Calculating Config-SHA1
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Cache data is up-to-date
-- [hunter] HUNTER_ROOT: /Users/viatsyshyn/.hunter
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] HUNTER_TOOLCHAIN_ID_PATH: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] HUNTER_CONFIGURATION_TYPES: Release;Debug
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] HUNTER_BUILD_SHARED_LIBS: 
-- [hunter] [ Hunter-ID: a20151e | Toolchain-ID: eff55a7 | Config-ID: 049ff24 ]
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] load: /Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/projects/Eigen/hunter.cmake
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Eigen versions available: [3.4.0;3.3.9;3.3.8;3.3.8-b11f817;3.3.7;3.3.6;3.3.5;3.3.4-p1;3.3.4-p0;3.3.3-p0;3.3.2-p0;3.3.1-p3;3.3.1-p2;3.3.1-p4;v0.0.0-429aa5254200-p1;v0.0.0-429aa5254200-p0]
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Package 'Eigen' CONFIGURATION_TYPES: Release;Debug
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Package 'Eigen' is cacheable: YES
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Install to: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Install
-- [hunter] EIGEN_ROOT: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Install (ver.: 3.4.0)
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Locking directory: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Lock done
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Already locked: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Locking directory: /Users/viatsyshyn/.hunter/_Base/Download/Eigen/3.4.0/d222db6
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Lock done
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Package 'Eigen' default arguments: 'CMAKE_Fortran_COMPILER=NOTFOUND;BUILD_TESTING=OFF;EIGEN_BUILD_DOC=OFF;HUNTER_INSTALL_LICENSE_FILES=COPYING.MPL2'
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Add extra CMake args: 'CMAKE_Fortran_COMPILER' = 'NOTFOUND'
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Add extra CMake args: 'BUILD_TESTING' = 'OFF'
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Add extra CMake args: 'EIGEN_BUILD_DOC' = 'OFF'
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Add extra CMake args: 'HUNTER_INSTALL_LICENSE_FILES' = 'COPYING.MPL2'
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Locking directory: /Users/viatsyshyn/.hunter/_Base/Cache
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Lock done
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Using environment variable HOME
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Downloading DONE metafile (try #0 of 10):
-- [hunter *** DEBUG *** 2024-05-20T12:45:51]   https://raw.githubusercontent.com/cpp-pm/hunter-cache/master/eff55a7/Eigen/3.4.0/d222db6/758859e/4830b34/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2024-05-20T12:45:51]   -> /Users/viatsyshyn/.hunter/_Base/Cache/meta/eff55a7/Eigen/3.4.0/d222db6/758859e/4830b34/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] File not found
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Downloading DONE metafile (try #1 of 10):
-- [hunter *** DEBUG *** 2024-05-20T12:45:51]   https://raw.githubusercontent.com/cpp-pm/hunter-cache/master/eff55a7/Eigen/3.4.0/d222db6/758859e/4830b34/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2024-05-20T12:45:51]   -> /Users/viatsyshyn/.hunter/_Base/Cache/meta/eff55a7/Eigen/3.4.0/d222db6/758859e/4830b34/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] File not found
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Cache miss (no basic dependencies info found: /Users/viatsyshyn/.hunter/_Base/Cache/meta/eff55a7/Eigen/3.4.0/d222db6/758859e/4830b34/da39a3e/basic-deps.DONE)
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Keep sources for package 'Eigen': NO
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Number of physical cores: 14
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Number of logical cores: 14
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Number of jobs: 14
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] HUNTER_JOBS_NUMBER: 
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] HUNTER_JOBS_NUMBER (env): 
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] HUNTER_JOBS_OPTION: 14
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Add package: Eigen
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Download scheme: url_sha1_cmake
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Url: https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] SHA1: d222db69a9e87d9006608e029d1039039f360b52
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] HUNTER_TLS_VERIFY: ON
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] Scheme file used: /Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/schemes/url_sha1_cmake.cmake.in
-- [hunter] Building Eigen
-- [hunter *** DEBUG *** 2024-05-20T12:45:51] [/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen] > "/Users/viatsyshyn/Applications/CLion Nova.app/Contents/bin/cmake/mac/aarch64/bin/cmake" "-C/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/cache.cmake" "-C/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen/args.cmake" "-H/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen" "-B/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen/Build" "-DCMAKE_TOOLCHAIN_FILE=/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen/toolchain.cmake" "-GNinja" "-DCMAKE_MAKE_PROGRAM=/Users/viatsyshyn/Applications/CLion Nova.app/Contents/bin/ninja/mac/aarch64/ninja"
loading initial cache file /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/cache.cmake
loading initial cache file /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen/args.cmake
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen/Build
-- [hunter *** DEBUG *** 2024-05-20T12:45:52] Configure step successful (dir: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen)
-- [hunter *** DEBUG *** 2024-05-20T12:45:52] [/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen] > "/Users/viatsyshyn/Applications/CLion Nova.app/Contents/bin/cmake/mac/aarch64/bin/cmake" "--build" "/Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen/Build"
ninja: error: build.ninja:200: multiple rules generate /Users/viatsyshyn/.hunter/_Base/Download/Eigen/3.4.0/d222db6/eigen-3.4.0.tar.gz


[hunter ** FATAL ERROR **] Build step failed (dir: /Users/viatsyshyn/.hunter/_Base/a20151e/eff55a7/049ff24/Build/Eigen
[hunter ** FATAL ERROR **] [Directory:/Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/projects/Eigen]

------------------------------ ERROR -----------------------------
    https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at /Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  /Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  /Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/modules/hunter_download.cmake:623 (hunter_fatal_error)
  /Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/projects/Eigen/hunter.cmake:217 (hunter_download)
  /Users/viatsyshyn/.hunter/_Base/Download/Hunter/0.25.5/a20151e/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  CMakeLists.txt:14 (hunter_add_package)


-- Configuring incomplete, errors occurred!

This happens for multiple dependencies across different projects in my system.

I tried Eigen, proj.4 and poly2tri. Only dependency that works for me is boost

I get same output if I perform cmake --build ./Build in dep folder.

@viatsyshyn viatsyshyn changed the title Macos deps fail with ninja: error: build.ninja:200: multiple rules generate Macos cmake fails to install dependencies with ninja: error: build.ninja:200: multiple rules generate May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant