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
openmpi: make build reproducible and fix compiler wrappers #58964
Conversation
# default compilers should be indentical to the | ||
# compilers at build time | ||
|
||
sed -i 's:compiler=.*:compiler=${stdenv.cc}/bin/cc:' $out/share/openmpi/mpicc-wrapper-data.txt |
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.
Is this correct in the case of cross-compilation?
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.
Cross compilation is still a mystery to me but this probably only works if hostPlatform == buildPlatform
. How would I get the compilers of the target platform? cc @Mic92
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.
@markuskowa I think this would be ${targetPackages.stdenv.cc}
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.
But actually there was this one recently introduced: #57611
So instead this would be:
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
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.
@Ericson2314 could maybe also provide the right expression for gfortran
.
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.
Thanks for the insight! Just extrapolating from the expression for gcc:
${pkgsTargetTarget.gfortran}/bin/${pkgsTargetTarget.gfortran.targetPrefix}gfortran
Does that make sense? EDIT: it yields the right result when I build locally.
fix: * build and configure time stamps * build and configure user
0c6a01b
to
f8e84f7
Compare
The MPI compiler wrappers should point to the compilers used at build time per default.
f8e84f7
to
e23e116
Compare
Thanks! |
This semi-breaks |
@abbradar is it not common to set |
@abbradar setting |
@Mic92 @markuskowa Yep, that's the answer I needed. Thanks! |
Motivation for this change
The build system integrates various time stamps (+user, hostname) into the output thus creating an irreducible build.
The MPI compiler wrappers should point to the compilers used at build time per default. For MPICH this feature is already in the derivation (#44555)
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)