Giter VIP home page Giter VIP logo

Comments (10)

xenoscopic avatar xenoscopic commented on May 25, 2024

I have this exact same issue, without the ability to update /usr/bin/gcc. I know the Mac guys are pedantic about hardcoding paths, but for linux, one really needs the ability to set CC/CXX (or at least HOMEBREW_CC/CXX or something), because there's just too much variation. I also can't seem to get linuxbrew to pick up another compiler with any amount of hacking or symlinks.

from legacy-linuxbrew.

mistydemeo avatar mistydemeo commented on May 25, 2024

Note that on the Mac side there's experimental support for non-Apple compilers which would allow you to set arbitrary GCC versions. For Mac it will be dependent on their being Homebrew-installed but that requirement could be laxed for Linuxbrew. Homebrew/legacy-homebrew#20251

from legacy-linuxbrew.

xenoscopic avatar xenoscopic commented on May 25, 2024

Wow, that seems like exactly what we'd need. To be fair, I'm using an ancient linux/gcc version, so this probably doesn't affect most users, but being able to do this would be a big help. Perhaps I will try pulling this into a linuxbrew fork...

from legacy-linuxbrew.

mistydemeo avatar mistydemeo commented on May 25, 2024

Feel free to hack on the fails_with code that's holding it up from landing in Homebrew core! Once that happens it's a simple merge and tweak to get it into mainline Linuxbrew.

from legacy-linuxbrew.

sjackman avatar sjackman commented on May 25, 2024

Linuxbrew doesn't currently use superenv, because it currently requires XCode (xcrun). We should fix that.

from legacy-linuxbrew.

chapmanb avatar chapmanb commented on May 25, 2024

I've been struggling with gcc choice on Linuxbrew installations and wondering about the current state of this issue. It looks like the arbitrary GCC version patch got accepted (Homebrew/legacy-homebrew#20251) but I'm not sure how to enable it.

The behaviour I'm seeing is that brew always seems to prefer using /usr/bin/gcc. On many of the systems I'm supporting this system version is quite old, with modules supplying the newer versions. Ideally what I'd like to do is use the gcc/g++ in the PATH by default, instead of manually setting CC/CXX to /usr/bin versions. Is this possible? If not, any pointers on ways to move in this direction? I know this is not ideal on Macs, but is the standard setup on a lot of Linux systems.

Thanks for any thoughts and pointers.

from legacy-linuxbrew.

mistydemeo avatar mistydemeo commented on May 25, 2024

@chapmanb You can select a compiler by doing --cc=foo, e.g. --cc=gcc-4.8. For non-Xcode compilers, the compiler has to have been built by Homebrew, however. Linuxbrew might want to customize that behaviour?

from legacy-linuxbrew.

sjackman avatar sjackman commented on May 25, 2024

@mistydemeo Is there a way to configure Homebrew to set the default compiler to --cc=gcc-4.8? Does HOMEBREW_CC=gcc-4.8 work?

from legacy-linuxbrew.

chapmanb avatar chapmanb commented on May 25, 2024

Misty and Shaun;
Thanks much for the clarification, and all your work on this. Unfortunately on the systems I'm working on there isn't a version specific gcc-4.8 style target to force. It's dictated by the gcc on the PATH, injected in via modules.

I know that's far from Homebrew/Mac specific problems, but I guess I was hoping for a flag on Linuxbrew that tells brew not to do any magic and only grab CC/CXX from versions on the PATH. I'm still trying to find my way through the code trying to understand the env/compilers setup. Thanks again.

from legacy-linuxbrew.

mistydemeo avatar mistydemeo commented on May 25, 2024

@sjackman There isn't a way to set it globally. (Was by design, since it's not totally tested on OS X, nor will it work with everything.) So, it does need to be specified every time brew is run. fails_with will choose Homebrew-installed GCCs though.

You may want to customize the default_compiler logic for Linuxbrew to select a newer compiler if available though - I do something similar in Tigerbrew, so that gcc-4.2 is picked over gcc-4.0 even if the OS's default is gcc-4.0 (as it was on Xcode 2.5).

from legacy-linuxbrew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.