gpt4 book ai didi

macos - 构建和安装 x86_64 而不是 i386 的 Brew 应用程序?

转载 作者:行者123 更新时间:2023-12-04 12:42:32 25 4
gpt4 key购买 nike

在我这样做之后:

brew install git



我这样做:

which git



返回:

/usr/local/bin/git



然后我这样做:

file /usr/local/bin/git



返回:

/usr/local/bin/git: Mach-O executable i386



我需要 brew 安装为 x86_64。

如何强制 brew 构建和安装我的应用程序为 x86_64?

brew --config



返回这个:
HOMEBREW_VERSION: 0.9
HEAD: 1c64a6624ed83ef17af6e98638b8165400e9e908
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-357
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /Users/tdewell/.rvm/rubies/ruby-1.9.3-p194/bin/ruby

更新:添加 brew --env
$ brew --env
CC: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2

CXX: /usr/bin/xcrun g++-4.2 => /Developer/usr/bin/g++-4.2

LD: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2

CFLAGS: -Os -w -pipe -march=core2 -msse4
CXXFLAGS: -Os -w -pipe -march=core2 -msse4
MAKEFLAGS: -j4

最佳答案

这已经解决了。

我通过 App Store 安装了 Xcode 4.3.2 并安装了命令行工具,但我已经安装了多年前的现有 Xcode 3.1。我搜索了一下,找到了这些命令:

sudo /Developer/Library/uninstall-devtools –mode=all

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

这解决了我的问题,在我这样做之后,编译器更改为 brew:
$ brew --env
CC: /usr/bin/clang
CXX: /usr/bin/clang++ => /usr/bin/clang
LD: /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments
MAKEFLAGS: -j4

brew 安装现在好多了:
$ which git
/usr/local/bin/git

$ file /usr/local/bin/git
/usr/local/bin/git: Mach-O 64-bit executable x86_64

关于macos - 构建和安装 x86_64 而不是 i386 的 Brew 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10921133/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com