-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[staging] gfortran: default to same gcc version as stdenv #148539
Conversation
The only change noted on the 9 -> 10 migration guide for fortran is that mismatched arguments cause errors now: https://gcc.gnu.org/gcc-10/porting_to.html This usage was already invalid fortran, and I haven't encountered any affected packages, but I'll keep testing to see if it's something we need to worry about. |
The |
Thanks, feel free to cherry-pick to master if you'd like to update separately. Grepping for gfortran only nets about 100 matches so I can probably make sure all the direct dependers are still working. Gonna mark this as draft until then. |
4e8cd35
to
5d5d30e
Compare
Rebased to include cc690c8 |
Note that the gcc patch for riscv 0d1750e is only included by gcc 10 and 11. Thus on riscv platforms, current |
This is a pretty big deal, this should be merged immediately. Example of an issue that can arise from this:
This means that torch when imported after scipy.spatial will get a difference libstdc++ than it was compiled with. I haven't tested everything in torch, but I can guarantee you there are bugs when this occurs. I suspect this probably happens in many places with code that is compiled with both stdenv and gfortran. |
Can this be re-evaluated and un-drafted? It seems like a smart choice. |
Ah yes, forgot about this for a minute. As I recall there are actually quite a few packages broken by this, but fixing them is usually as simple as adding |
This is a more expected default behavior, so that the unversioned gcc/gfortran toplevel attrs have the same version. It's also more robust in cases where C and Fortran objects are being linked together. With this commit, gcc.version == gfortran.version == "10.3.0" (on x86_64-linux), bumping the default gfortran version from 9 to 10.
5d5d30e
to
ee3f34d
Compare
Some good news, some of the packages I previously needed to work around such as scalapack and elmerfem have been fixed upstream in the meantime. |
ee3f34d
to
028df1a
Compare
Successfully ran:
Not an exhaustive list, but a good sample of direct dependers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. Though I'm not familiar with the issues that motivated this PR so I'm hesitated to merge my self.
@@ -22,6 +22,8 @@ stdenv.mkDerivation rec { | |||
"--enable-shared" | |||
"--enable-sharedlib" | |||
"--with-pm=${withPm}" | |||
"FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible that this is already obsolete with the next version of mpich (which has just been released in the past week).
@GrahamcOfBorg build mpich mvapich |
I ran this command on aarch64-linux, which is the packages previous, plus the ones changed by this PR, minus the ones that are tagged as unsupported:
Unfortunately, it looks like the new flags cause
Can those flags be made conditional on aarch64-linux or the |
Similar to mpich, there are difficulties preventing fixing the mismatched arguments upstream.
028df1a
to
cba2328
Compare
@tpwrules thanks for reporting, I've made mpich only build with -fallow-argument-mismatch for gfortran 10+. Latest mpich does seem to solve the issue but I'd rather keep this PR narrow in focus. |
See #168772 for |
For some reason this broke cross-compilation with gfortran. I'm building gfortran with this:
When I try to execute it, it says this:
When I look into the
I didn't expect the cross-compiler for gfortran to refer to the native/x86_64 compiler. Maybe related to #132651? |
Ah thank you for pointing that out, I see what you mean. I think it may be a simple host/target offset issue. Instead of Edit: yes that seems to fix it, would you mind confirming? |
Causes an eval error:
The gfortran I just built with
|
Oh I see. How about instead of |
Sounds fine to me. Haven't tested but assuming that'll work. The splicing stuff is kind of leaky at times. |
This is a more expected default behavior, so that the unversioned
gcc/gfortran toplevel attrs have the same version. It's also more
robust in cases where C and Fortran objects are being linked together.
With this commit, gcc.version == gfortran.version == "10.3.0"
(on x86_64-linux), bumping the default gfortran version from 9 to 10.
Motivation for this change
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes