Closed alekseysidorov closed 8 years ago
Fixes Linuxbrew/linuxbrew#1053
I'm currently splitting Linuxbrew/linuxbrew
into Linuxbrew/brew
and Linuxbrew/homebrew-core
, as Homebrew did last week (two weeks ago?), so I'm not merging any pull requests right now. I'll cherry-pick this PR after the split is complete, probably next week. Sorry for the delay.
👍 Look's great! Thanks, Aleksey.
What should I do if I have a grid of machines with different CPU and want to specify the oldest march, native won't work for me.
Linuxbrew sits on a nfs and is shared between all machines.
If you specify --build-bottle
it will target -march=core2
. Will that work for you?
The ability to override target architecture using an environment variable would be better and less error prone. I definitely will forget about bottles myself some time in future and I would need to teach other people to use that.
brew install --build-bottle foo
installs a formula as normal but sets -march=core2
and disables postinstall. There's also the --bottle-arch
option, but the value has to be from one of the values found in
https://github.com/Linuxbrew/linuxbrew/blob/master/Library/Homebrew/os/linux/hardware.rb#L3-L5
Is it possible to make Homebrew prefer value of -march
in CFLAGS
/CXXFLAGS
to guessed ones?
No, CFLAGS
and CXXFLAGS
and other environment variables are intentionally removed from the environment before building for reproducibility. What architecture are you targeting? That is, what value of -march
do you want to use?
We have Xeons from Nehalem and up. So core2.
By the way, will the --build-bottle flag work with upgrade command?
A HOMEBREW_ARCH
environment variable may be a better fit for your use case. Can you please open an feature request issue to discuss?
Okay. Should I do it in this repo?
Yes, please.
When you are going to cherry-pick this fix?
Sorry for the delay, and thanks for the bump, Aleksey. I'll do it today.
Changes to Linuxbrew's Core:
brew tests
with your changes locally?