Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 297 forks source link

core: Fix march for linux #1094

Closed alekseysidorov closed 8 years ago

alekseysidorov commented 8 years ago

Changes to Linuxbrew's Core:

sjackman commented 8 years ago

Fixes Linuxbrew/linuxbrew#1053

sjackman commented 8 years ago

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.

sjackman commented 8 years ago

👍 Look's great! Thanks, Aleksey.

eiennohito commented 8 years ago

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.

sjackman commented 8 years ago

If you specify --build-bottle it will target -march=core2. Will that work for you?

eiennohito commented 8 years ago

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.

sjackman commented 8 years ago

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

eiennohito commented 8 years ago

Is it possible to make Homebrew prefer value of -march in CFLAGS/CXXFLAGS to guessed ones?

sjackman commented 8 years ago

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?

eiennohito commented 8 years ago

We have Xeons from Nehalem and up. So core2.

By the way, will the --build-bottle flag work with upgrade command?

sjackman commented 8 years ago

A HOMEBREW_ARCH environment variable may be a better fit for your use case. Can you please open an feature request issue to discuss?

eiennohito commented 8 years ago

Okay. Should I do it in this repo?

sjackman commented 8 years ago

Yes, please.

alekseysidorov commented 8 years ago

When you are going to cherry-pick this fix?

sjackman commented 8 years ago

Sorry for the delay, and thanks for the bump, Aleksey. I'll do it today.

sjackman commented 8 years ago

Moved to https://github.com/Linuxbrew/brew/pull/21