`ENV.fortran` => `depends_on :fortran` #13621

Closed
adamv opened this Issue Jul 26, 2012 · 18 comments

5 participants

@adamv

When Jack's "modify ENV" change gets in for Requirements, we should convert ENV.fortran to depends_on :fortran.

@Sharpie

Sounds great to me. This has been at the top of my TODO list for a bit.

@jacknagel

Will rebase and push that change soonish.

@jacknagel

Pushed; Requirements can now define modify_build_environment, which will be called by the build script.

@samueljohn

I am still able to set FC=... and use the gfortran-4.7 from dupes/gcc.rb, right? Just asking.

@jacknagel

Yeah, from a user's perspective this is pretty much just a cosmetic change.

@MikeMcQuaid
Homebrew member

This seems good. Will it pull in gfortran by default rather than printing the message if there's no other Fortran compiler found?

@samueljohn

Can I have it to find gfortran-4.7 from the dupes/gcc.rb formula if installed and no gfortran found?
That would be great and I woudn't need to set FC and --fortran-default-flags for some formulae that use gfortran. The brew gfortran was not working for my numpy/scipy builds (tested a week ago or so).

@MikeMcQuaid
Homebrew member

If it is necessary for formula that should be in core I think.

@samueljohn

Well, the numpy and scipy formulae are in my homebrew-python fork and not in the core.

But I found the dupes/gcc formula to be the only way to get a decent gfortran (the current brew install gfortran sucks because it's just a downloader of binaries.

@Sharpie Sharpie was assigned Sep 15, 2012
@Sharpie

Working on this now. The only incompatibility is that calling ENV.fortran after something else that modifies build flags, such as ENV.m64 or ENV.Og will work out as expected. Moving to depends_on :fortran won't behave in the same way.

@Sharpie

I guess I could add FCFLAGS and FFFLAGS to the cc_flag_vars that are touched by the ENV methods, but then this creates an implicit assumption that the Fortran compiler is GCC or Clang compatible and there isn't a built-in override like the current setup has.

@adamv

Still think we need depends_on :fotran or env :fortran, but I'm not actually working on this feature.

@MikeMcQuaid
Homebrew member

We need depends_on otherwise fortran behaves differently to pretty much everything else in Homebrew.

@Sharpie

Well, even with depends_on, fortran is going to behave differently to everything else.

It installs a compiler but also needs to allow for overrides if a user has a different compiler that they prefer. It also needs to modify the build environment---but after things such as ENV.Og have been called in the install block.

With #15103, the gfortran situation is starting to merge with a discussion we had the other week on the dev list about how to bring alternate GCC installs into superenv.

@samueljohn

with the new style requirements and env do ... end blocks to change the env this should be straight forward to implement this as a Requirement. I see that ENV.fortran operates on FCFLAGS and FFLAGS but not on any of the ENV.cc_flag_vars. How does ENV.Og interfere with ENV.fortran? (No rhetorical question, bperhaps I am lost in the many indirections and jumps in the codebase).

@Sharpie you are assigned. If you don't have the time to do, assign me, and I'll make an attempt.

@adamv

@samueljohn take assignment if you want

@samueljohn

Alright, next free resources will be dedicated here.

@samueljohn samueljohn was assigned Jun 14, 2013
@adamv adamv added a commit that closed this issue Jun 24, 2013
@adamv adamv Use :fortran
Closes #20731.
Closes #13621.
3813c7c
@adamv adamv closed this in 3813c7c Jun 24, 2013
@handyman5 handyman5 pushed a commit to handyman5/homebrew that referenced this issue Oct 7, 2013
@adamv adamv Use :fortran
Closes #20731.
Closes #13621.
adcb2a9
@sjackman sjackman pushed a commit to sjackman/homebrew that referenced this issue Nov 15, 2013
@adamv adamv Use :fortran
Closes #20731.
Closes #13621.
31dd1d6
@shelhamer shelhamer added a commit that referenced this issue Apr 18, 2014
@adamv adamv Use :fortran
Closes #20731.
Closes #13621.
e97cdb0
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.