Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build and install Brew apps that are x86_64 instead of i386?

After I have done this:

brew install git

I do this:

which git

which returns:

/usr/local/bin/git

I then do this:

file /usr/local/bin/git

which returns:

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

I need brew to install as x86_64.

How can I force brew to build and install my apps as x86_64?

brew --config

Returns this:

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

Update: adding 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
like image 698
tdewell Avatar asked Jun 06 '12 19:06

tdewell


People also ask

Where does Homebrew install on M1 Mac?

But if you install Homebrew on an M1 Mac running Apple Silicon, then Homebrew gets installed in /opt/homebrew/bin . Since /opt/homebrew/bin is not included in your PATH by default, there is some extra configuration needed to allow you to use packages installed with Homebrew.

How do I find my brew architecture?

The alternative is to do a manual lookup of the package on the https://formulae.brew.sh/ website to check if it supports a particular architecture.

What is a Homebrew cask?

Homebrew-Cask extends Homebrew and allows you to install large binary files via a command-line tool. You can for example install applications like Google Chrome, Dropbox, VLC and Spectacle. No more downloading .


1 Answers

This has been solved.

I installed Xcode 4.3.2 via the App Store and installed the Command Line Tools, but I had an existing Xcode 3.1 installed from years ago. I Googled around and found these commands:

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

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

That cured my problem and after I did that the compilers changed for 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 installs are much better now:

$ which git
/usr/local/bin/git

$ file /usr/local/bin/git
/usr/local/bin/git: Mach-O 64-bit executable x86_64
like image 111
tdewell Avatar answered Sep 18 '22 13:09

tdewell