macOSã®ããã±ã¼ã¸ããã¼ã¸ã£ã¼ã¨ãã¦Homebrewãå©ç¨ãã¦ãã¾ããGitHubãªã©ããå ¥æããããã°ã©ã ã½ã¼ã¹ããã«ããã¦Macã§å©ç¨ããã«ã¯ãHomebrewã¯å¿ é ã®ãã¼ã«ã§ããHomebrewããªããã°ãMacã§ã®ãªã¼ãã³ã½ã¼ã¹ãå©ç¨ããã½ããã¦ã§ã¢éçºã¯ã§ããªãã¨ãè¨ãã¾ãã
ã¨ããããç¾è¡ã®Homebrewï¼æ¬è¨äºå·çæç¹ã¯ãã¼ã¸ã§ã³3.6.1ï¼ã§ã¯macOS 10.13 High Sierra ã¯ãµãã¼ã対象å¤ã¨ãªã£ã¦ãããä½ãããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã度ã«æ¬¡ã®ãããªè¦åã表示ããã¾ãã
Warning: You are using macOS 10.13. We (and Apple) do not provide support for this old version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Twitter or any other official channels. You are responsible for resolving any issues you experience while you are running this old version.Â
Homebrewã®å¤ããã©ã¼ãã¥ã©ã¯ãã§ã«Big Sur以éç¨ã«æ´æ°ããã¦ããããã§ãä¸é¨ã®ãã©ã¼ãã¥ã©ã¯ãã®ã¾ã¾ã§ã¯High Sierraã«ã¤ã³ã¹ãã¼ã«ã§ããªããªã£ã¦ãã¾ã£ã¦ãã¾ãã
äºæ ããã£ã¦ãHigh Sierraã使ãç¶ãã¦ãã人ã¯çµæ§å¤ãã®ã§ã¯ãªãã§ãããããããããç§ã2å°ã®Macã§ã¾ã High Sierraã使ã£ã¦ãã¾ãï¼ãã«ããã¼ãã£ã·ã§ã³ã§Big Surã¨å ±åãããããã¦ãã¾ããï¼ãä¸ã¤ã®å¤§ããªçç±ã¨ãã¦ãNVIDIA GPUãã¼ããHigh Sierraã¾ã§ããå©ç¨ã§ããªããã¨ãããã¾ããNVIDIA GPUãã¼ãç¨ãã©ã¤ããHigh Sierra対å¿çã¾ã§ãããªãªã¼ã¹ããã¦ããããmacOS 10.14 Mojave以éã§ã¯CUDAãæ©æ¢°å¦ç¿ã»ãã£ã¼ãã©ã¼ãã³ã°ã®ã½ããã¦ã§ã¢éçºãã§ãã¾ããã
Homebrewã§High Sierraã«ã¤ã³ã¹ãã¼ã«ã§ããªããã©ã¼ãã¥ã©ã®ä¸ã¤ã¨ãã¦LLVMãã¨ãããã®ãããã¾ããCommand Line Toolsã«ãå ¥ã£ã¦ããclangã³ã³ãã¤ã©ãå«ãã§ããLLVMã®ææ°çã§ããããã®ææ°çLLVMã«ã¯clangãææ°çãã¼ã¸ã§ã³ãåç´ããã¦ãã¾ãããã®ææ°çLLVMãã¤ã³ã¹ãã¼ã«ã§ããªããã¨ã¯Homebrewãå©ç¨ããã½ããã¦ã§ã¢éçºã«ã¨ã£ã¦å¤§ããªé害ã¨ãªãã¾ããå¤ãã®ãã©ã¼ãã¥ã¢ããã®ææ°ãã¼ã¸ã§ã³ã®clangã§ãã«ããããã¨ãåæã¨ãã¦æ´æ°ããã¦ããããããã¯å ã«ææ°çLLVMãã¤ã³ã¹ãã¼ã«ãããããã§ããOpenCVãQtãªã©ã®ã¡ã¸ã£ã¼ãªãã©ã¼ãã¥ã©ãææ°çLLVMã«ä¾åãã¦ãããããHigh Sierraã§ã¯ç¾è¡ã®Homebrewã使ã£ã¦ããããã¤ã³ã¹ãã¼ã«ãããã¨ãã§ãã¾ããã
GitHubããå ¥æããããã¤ãã®ããã°ã©ã ããã«ããããã¨ãã¦ããã®é害ã«ä½åº¦ãééãã¾ãããã試è¡é¯èª¤ããªãã解決ãããã¨ãã§ãã¾ãããåãåé¡ã«ãã£ã¦å°ã£ã¦ãã人ã¯å¤ãã¨æãã®ã§ããã®è§£æ±ºæ¹æ³ãæ¬è¨äºã«æ¸ãã¦ããã¾ãã
LLVMã¤ã³ã¹ãã¼ã«æã®ã¨ã©ã¼é害
High Sierraä¸ã§Homebrewã使ã£ã¦ææ°çLLVMï¼æ¬è¨äºå·çæç¹ã¯ãã¼ã¸ã§ã³14.0.6ï¼ãã¤ã³ã¹ãã¼ã«ãããã¨ããã¨ã以ä¸ã®ãããªã¨ã©ã¼ãèµ·ãã¾ãã
% brew install llvm ... ... ==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-project-14.0.6.src.tar.xz /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.6.1\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.13.6\)\ curl/7.54.0 --header Accept-Language:\ en --retry 3 --location --silent --head --request GET https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-project-14.0.6.src.tar.xz Already downloaded: /Users/yuhri/Library/Caches/Homebrew/downloads/ca2953276467b5dcc28485aa2b1afc3bcf32bbf84d5e0236f6284234afca2d8d--llvm-project-14.0.6.src.tar.xz ... ... tar --extract --no-same-owner --file /Users/yuhri/Library/Caches/Homebrew/downloads/ca2953276467b5dcc28485aa2b1afc3bcf32bbf84d5e0236f6284234afca2d8d--llvm-project-14.0.6.src.tar.xz --directory /private/tmp/d20220915-7100-llrho7 cp -pR /private/tmp/d20220915-7100-llrho7/llvm-project-14.0.6.src/. /private/tmp/llvm-20220915-7100-9zovwz/llvm-project-14.0.6.src ==> cmake -G Unix Makefiles .. -DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld;lldb;mlir;polly -DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx;libcxxabi;libunwind; ==> cmake --build . ... ... [ 80%] Built target lldELF make: *** [all] Error 2
Homebrewã¯LLVMãã½ã¼ã¹ãããã«ããã¦ã¤ã³ã¹ãã¼ã«ãããã¨è©¦ã¿ã¾ããããã®ã¨ã©ã¼ã«ãã£ã¦ãã«ãå¦çãåæ¢ãããããLLVMã®ã¤ã³ã¹ãã¼ã«ã¯å¤±æãã¦ãã¾ãã¾ãã
High Sierraã«ææ°çLLVMãã¤ã³ã¹ã¼ã«ããæé
ä¸è¨ã®ã¨ã©ã¼é害ã解決ãã¦ãHigh Sierraä¸ã§Homebrewã使ã£ã¦LLVMãã¤ã³ã¹ã¼ã«ããæé ã以éã«èª¬æãã¾ãã
Xcode 10.1ãã¤ã³ã¹ãã¼ã«ãã
ã¾ãXcodeãHigh Sierraã¸ã¤ã³ã¹ãã¼ã«ãã¦ããå¿
è¦ãããã¾ããXcode 10.1ãHigh Sierraã§å©ç¨å¯è½ãªæçµãã¼ã¸ã§ã³ã§ããããããApple Developerãµã¤ããããã¦ã³ãã¼ãããä¸ã§è§£åããApplications
ãã©ã«ãã¸ã³ãã¼ãã¦ãã ããã
Homebrewãã¤ã³ã¹ãã¼ã«æ¸ã¿ãªãCommand Line Toolsã¯åç¬ã§ã¤ã³ã¹ãã¼ã«ããã¦ããã¯ãã§ããã©ã¼ãã¥ã©ã®ãã«ãã¯é常ãã¡ãã使ã£ã¦è¡ããã¾ããããããLLVMã®ã¤ã³ã¹ãã¼ã«ã§ã¯Xcodeã«å«ã¾ããä¸é¨ã®ãã¼ã«ããã«ãå¦çã§ä½¿ããã¾ãã
ãã§ã«Xcode 10.1ãã¤ã³ã¹ãã¼ã«æ¸ã¿ãªãããã®æä½ãè¡ãå¿ è¦ã¯ããã¾ããã
ãªããHombrewãXcodeã®åå¨ãèªèãã¦ãããã©ããã¯ã以ä¸ã®ã³ãã³ãã«ãã£ã¦ç¢ºèªã§ãã¾ãã
% brew config HOMEBREW_VERSION: 3.6.1 ORIGIN: https://github.com/Homebrew/brew HEAD: 6e2b162c4786e075323f038d46bfb566d91889e7 Last commit: 5 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 4d6529affa1851ffb992a33fe5641b0cd739c895 Core tap last commit: 2 hours ago Core tap branch: master HOMEBREW_PREFIX: /Users/yuhri/homebrew HOMEBREW_REPOSITORY: /Users/yuhri/homebrew HOMEBREW_CELLAR: /Users/yuhri/homebrew/Cellar HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.gBCDRKkzIz/org.xquartz:0 HOMEBREW_MAKE_JOBS: 24 Homebrew Ruby: 2.6.8 => /Users/yuhri/homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby CPU: 24-core 64-bit westmere Clang: 10.0.0 build 1000 Git: 2.17.2 => /Library/Developer/CommandLineTools/usr/bin/git Curl: 7.54.0 => /usr/bin/curl macOS: 10.13.6-x86_64 CLT: 10.1.0.0.1.1539992718 Xcode: 10.1
Xcodeãã¤ã³ã¹ãã¼ã«ããã¦ããªãã¨ã "Xcode: N/A
" ã¨è¡¨ç¤ºããã¾ãã
Command Line ToolsãXcodeå´ã¸åãæ¿ãã
xcode-select
ã³ãã³ãã使ã£ã¦ãXcodeå´ã®Command Line Toolsã使ãããããã«å¤æ´ãã¾ãã
% xcode-select -p /Library/Developer/CommandLineTools $ sudo xcode-select -s /Applications/Xcode.app Password: % xcode-select -p /Applications/Xcode.app/Contents/Developer
LLVMã®ã¤ã³ã¹ãã¼ã«ãâ--debugâãªãã·ã§ã³ä»ãã§éå§ãã
brew
ã³ãã³ãã«ã¯ --debug
ã¨ãããªãã·ã§ã³ãããã¾ããããã®ãªãã·ã§ã³ãæå®ãã¦LLVMã®ã¤ã³ã¹ãã¼ã«ãéå§ãã¾ãã
% brew install --debug llvm
--debug
ãªãã·ã§ã³ãã¤ããã¨ãã¨ã©ã¼ãèµ·ããæç¹ã§ã以ä¸ã®ãããªã¡ãã»ã¼ã¸ã表示ããã¦Homebrewã®ã¤ã³ã¹ãã¼ã«å¦çãåæ¢ãã¾ãã
... ... [ 80%] Built target lldELF make: *** [all] Error 2 /usr/local/Homebrew/Library/Homebrew/shims/shared/git --version /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --version /usr/local/Homebrew/Library/Homebrew/ignorable.rb:29:in `block in raise' BuildError: Failed executing: cmake --build . 1. raise 2. ignore 3. backtrace 4. irb 5. shell Choose an action: 5 When you exit this shell, you will return to the menu. %
ãã®âChoose an action:
â ããã³ããã«å¯¾ãã¦Â â5
â  ãé¸ã¶ã¨ãã·ã§ã«ããã³ããã«å¾©å¸°ãã¾ãã
LLVMã®ãã«ãã»ã¨ã©ã¼ã®åå ã解決ãã
ã·ã§ã«ããã³ããã«ãªã£ããã以ä¸ã®ããã«ä½æ¥ãã£ã¬ã¯ããªã移åãã¾ãã
% pwd /private/tmp/llvm-20220915-7100-9zovwz/llvm-project-14.0.6.src % cd llvm/build
ããã¦ã HostInfoMacOSX.mm
 ã¨ãããã¡ã¤ã«ã以ä¸ã®ããã«ç·¨éãã¾ãã
% vi ../../lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
--- ../../lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm.orig 2022-06-22 16:46:24.000000000 +0000 +++ ../../lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm 2022-09-15 13:18:17.000000000 +0000 @@ -228,7 +228,7 @@ len = sizeof(is_64_bit_capable); ::sysctlbyname("hw.cpu64bit_capable", &is_64_bit_capable, &len, NULL, 0); - if (cputype == CPU_TYPE_ARM64 && cpusubtype == CPU_SUBTYPE_ARM64E) { + if (cputype == CPU_TYPE_ARM64) { // The arm64e architecture is a preview. Pretend the host architecture // is arm64. cpusubtype = CPU_SUBTYPE_ARM64_ALL;
æåã§LLVMã®ãã«ãå¦çãç¶ç¶ãã
HostInfoMacOSX.mm
 ã®ä¿®æ£ãçµãã£ããã以ä¸ã®ä¸é£ã®ã³ãã³ããé 次å®è¡ãã¦ããã¾ãã
% cmake . -DLLVM_CREATE_XCODE_TOOLCHAIN=On
... ... -- Configuring done -- Generating done -- Build files have been written to: /tmp/llvm-20220915-7100-9zovwz/llvm-project-14.0.6.src/llvm/build % cmake --build .
... ... [100%] Built target lldb-vscodex /usr/local/Cellar/cmake/3.24.1/bin/cmake -E cmake_progress_start /tmp/llvm-20220915-7100-9zovwz/llvm-project-14.0.6.src/llvm/build/CMakeFiles 0 % cmake --build . --target install
... ... -- Installing: /usr/local/Cellar/llvm/14.0.6_1/lib/cmake/llvm/./FindSphinx.cmake -- Installing: /usr/local/Cellar/llvm/14.0.6_1/lib/cmake/llvm/./FindGRPC.cmake -- Installing: /usr/local/Cellar/llvm/14.0.6_1/lib/cmake/llvm/./TableGen.cmake % cmake --build . --target install-xcode-toolchain
ä¸è¨ã®æå¾ã®ã³ãã³ãã«ãããã«ãå¦çãçµããã¨ã以ä¸ã®ãããªã¡ãã»ã¼ã¸ã表示ããã¾ãã
ããã§ã®"Choose an action:
"ããã³ããã§ã¯ããã¹ã¦ "2
" ãé¸æãã¾ãã
... ... -- Installing: /usr/local/Cellar/llvm/14.0.6_1/Toolchains/LLVM14.0.6.xctoolchain//usr/lib/cmake/llvm/./FindSphinx.cmake -- Installing: /usr/local/Cellar/llvm/14.0.6_1/Toolchains/LLVM14.0.6.xctoolchain//usr/lib/cmake/llvm/./FindGRPC.cmake -- Installing: /usr/local/Cellar/llvm/14.0.6_1/Toolchains/LLVM14.0.6.xctoolchain//usr/lib/cmake/llvm/./TableGen.cmake Built target install-xcode-toolchain /usr/local/Cellar/cmake/3.24.1/bin/cmake -E cmake_progress_start /tmp/llvm-20220915-7100-9zovwz/llvm-project-14.0.6.src/llvm/build/CMakeFiles 0 % 1. raise 2. ignore 3. backtrace 4. irb 5. shell Choose an action: 2 ==> cmake --build . --target install Last 15 lines from /Users/yuhri/Library/Logs/Homebrew/llvm/03.cmake: 2022-09-15 07:06:11 +0000 cmake --build . --target install Error: could not load cache /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --version /usr/local/Homebrew/Library/Homebrew/ignorable.rb:29:in `block in raise' BuildError: Failed executing: cmake --build . --target install 1. raise 2. ignore 3. backtrace 4. irb 5. shell Choose an action: 2
ï¼å "2
" ãé¸æããã¨ãLLVMã®ãã«ãå¦çãçµäºãã以éã¯Homebrewã«ãã£ã¦ã¤ã³ã¹ãã¼ã«å¦çãç¶ç¶å®è¡ããã¾ãã
... ... ==> Fixing /usr/local/Cellar/llvm/14.0.6_1/lib/python3.9/site-packages/clang/cindex.py permissions from 644 to 444 ==> Fixing /usr/local/Cellar/llvm/14.0.6_1/lib/python3.9/site-packages/clang/enumerations.py permissions from 644 to 444 ... ... ==> Changing dylib ID of /Users/yuhri/homebrew/Cellar/llvm/14.0.6_1/lib/libomp.dylib from @rpath/libomp.dylib to /Users/yuhri/homebrew/opt/llvm/lib/libomp.dylib ==> Changing dylib ID of /Users/yuhri/homebrew/Cellar/llvm/14.0.6_1/lib/libunwind.1.0.dylib from @rpath/libunwind.1.dylib to /Users/yuhri/homebrew/opt/llvm/lib/libunwind.1.dylib /Users/yuhri/homebrew/Library/Homebrew/brew.rb (Formulary::FromPathLoader): loading /Users/yuhri/homebrew/opt/llvm/.brew/llvm.rb ==> Caveats To use the bundled libc++ please add the following LDFLAGS: LDFLAGS="-L/Users/yuhri/homebrew/opt/llvm/lib -Wl,-rpath,/Users/yuhri/homebrew/opt/llvm/lib" llvm is keg-only, which means it was not symlinked into /Users/yuhri/homebrew, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble. If you need to have llvm first in your PATH, run: echo 'export PATH="/Users/yuhri/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc For compilers to find llvm you may need to set: export LDFLAGS="-L/Users/yuhri/homebrew/opt/llvm/lib" export CPPFLAGS="-I/Users/yuhri/homebrew/opt/llvm/include" ==> Summary ðº /Users/yuhri/homebrew/Cellar/llvm/14.0.6_1: 11,663 files, 1.8GB, built in 76 minutes 6 seconds ... ...
ããã¦ãæå¾ã¯LLVMã®ã¤ã³ã¹ãã¼ã«ãæåãã¦çµããã¾ãã
ã¤ã³ã¹ãã¼ã«ãããLLVMã確èªãã
ã¤ã³ã¹ãã¼ã«ãããLLVMãå©ç¨å¯è½ãã©ãã㯠ã以ä¸ã®ã³ãã³ãã«ãã£ã¦ç¢ºèªã§ãã¾ãã
% /usr/bin/clang --version Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin % /Library/Developer/CommandLineTools/usr/bin/clang --version Apple LLVM version 10.0.0 (clang-1000.10.44.4) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin % /usr/local/opt/llvm/bin/clang --version Homebrew clang version 14.0.6 Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /usr/local/opt/llvm/bin
/usr/bin/clang
ãXcode 10.1ã®clangã³ã³ãã¤ã©ã/Library/Developer/CommandLineTools/usr/bin/clang
ãCommand Line Toolsã®clangã/usr/local/opt/llvm/bin/clang
ãã¤ã³ã¹ãã¼ã«ããLLVMã®clangã§ãã
Command Line Toolsã®é¸æãå ã«æ»ã
ä¸è¨ã¾ã§ã®æé ã§LLVMã®ã¤ã³ã¹ãã¼ã«ã¯å®äºã§ããã"brew install --debug llvm
 " ã³ãã³ããå®è¡ããåã«å¤æ´ããCommand Line Toolsã®é¸æãå
ã«æ»ãã¦ããã¾ãã
% xcode-select -p /Applications/Xcode.app/Contents/Developer % sudo xcode-select -s /Library/Developer/CommandLineTools Password: % xcode-select -p /Library/Developer/CommandLineTools
ãåèãªã³ã¯ã