安装cmake
包时,提示报错
doubleq@doubleq1deMac-Studio build % arch -x86_64 brew install cmake
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
cmake 3.25.1 is already installed but outdated (so it will be upgraded).
==> Fetching cmake
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/manifests/3.25.2
Already downloaded: /Users/doubleq666/Library/Caches/Homebrew/downloads/ae537c7714c23df1aa42dae762968262495b132366bcd14648ad233e050f63db--cmake-3.25.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/blobs/sha256:f502d6ccb79b82ec25b2f4222c15d29e31fb906325ea80609d0e829ead9080f2
Already downloaded: /Users/doubleq666/Library/Caches/Homebrew/downloads/fc905a18b9e0586700a6e02c58c32f4fb1d5c52ee93bf1d87cc77e58fa5f965f--cmake--3.25.2.ventura.bottle.tar.gz
==> Upgrading cmake
3.25.1 -> 3.25.2
fatal: not in a git directory
Error: Command failed with exit 128: git
出错的原因是homebrew-core
和homebrew-cask
文件夹被被存放在了一个系统认为不安全的路径,需要手动将这两个路径指定为是安全的。
执行brew -v
命令
doubleq@doubleq1deMac-Studio homebrew % brew -v
Homebrew 4.0.1-44-ga62112f
fatal: detected dubious ownership in repository at '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'
To add an exception for this directory, call:
git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: detected dubious ownership in repository at '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'
To add an exception for this directory, call:
git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)
复制运行两条建议的命令
doubleq@doubleq1deMac-Studio homebrew % git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
doubleq@doubleq1deMac-Studio homebrew % git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
就可以正常安装包了
doubleq@doubleq1deMac-Studio homebrew % arch -x86_64 brew install cmake
==> Downloading https://formulae.brew.sh/api/formula.json
##O=# #
==> Downloading https://formulae.brew.sh/api/cask.json
##O=# #
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
cmake 3.25.1 is already installed but outdated (so it will be upgraded).
==> Fetching cmake
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/manifests/3.25.2
Already downloaded: /Users/doubleq666/Library/Caches/Homebrew/downloads/ae537c7714c23df1aa42dae762968262495b132366bcd14648ad233e050f63db--cmake-3.25.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/blobs/sha256:f502d6ccb79b82ec25b2f4222c15d29e31fb906325ea80609d0e829ead9080f2
Already downloaded: /Users/doubleq666/Library/Caches/Homebrew/downloads/fc905a18b9e0586700a6e02c58c32f4fb1d5c52ee93bf1d87cc77e58fa5f965f--cmake--3.25.2.ventura.bottle.tar.gz
==> Upgrading cmake
3.25.1 -> 3.25.2
==> Pouring cmake--3.25.2.ventura.bottle.tar.gz
==> Caveats
To install the CMake documentation, run:
brew install cmake-docs
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/cmake
==> Summary
🍺 /usr/local/Cellar/cmake/3.25.2: 3,167 files, 49MB
==> Running `brew cleanup cmake`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/cmake/3.25.1... (3,167 files, 49MB)
doubleq@doubleq1deMac-Studio homebrew % arch -x86_64 brew install lightgbm
==> Fetching dependencies for lightgbm: libomp
==> Fetching libomp
==> Downloading https://ghcr.io/v2/homebrew/core/libomp/manifests/15.0.7
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:762c461db6af3cf78983b1eb58aee62699652b96237abf79469c8ac034b2156b
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:762c461db6af3cf78983b1eb58aee62699652b96237abf79469c8ac034b2156b?se=2023-02-17
######################################################################## 100.0%
==> Fetching lightgbm
==> Downloading https://ghcr.io/v2/homebrew/core/lightgbm/manifests/3.3.5
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/lightgbm/blobs/sha256:515f6e0358450ecf2b8d1980c9f95879f79a6ed4bb17f87fdc6d4603a86234fd
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:515f6e0358450ecf2b8d1980c9f95879f79a6ed4bb17f87fdc6d4603a86234fd?se=2023-02-17
######################################################################## 100.0%
==> Installing dependencies for lightgbm: libomp
==> Installing lightgbm dependency: libomp
==> Pouring libomp--15.0.7.ventura.bottle.tar.gz
🍺 /usr/local/Cellar/libomp/15.0.7: 7 files, 1.6MB
==> Installing lightgbm
==> Pouring lightgbm--3.3.5.ventura.bottle.tar.gz
🍺 /usr/local/Cellar/lightgbm/3.3.5: 98 files, 18MB
==> Running `brew cleanup lightgbm`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).