mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
system.nix: use gccarch-exact-<march> to enforce build
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
{
|
||||
buildFHSEnv, writeScript, stdenvNoCC,
|
||||
src,
|
||||
nvhpc, lmod, cmake, gfortran,
|
||||
config, nvhpcArch ? config.nvhpcArch or "px"
|
||||
nvhpc, lmod, cmake, gfortran
|
||||
}:
|
||||
let
|
||||
buildEnv = buildFHSEnv
|
||||
@@ -36,5 +35,5 @@ in stdenvNoCC.mkDerivation
|
||||
${buildEnv}/bin/buildEnv ${buildScript}
|
||||
'';
|
||||
dontInstall = true;
|
||||
requiredSystemFeatures = [ "nvhpcarch-${nvhpcArch}" ];
|
||||
requiredSystemFeatures = [ "gccarch-exact-${stdenvNoCC.hostPlatform.gcc.arch}" ];
|
||||
}
|
||||
|
||||
@@ -43,5 +43,5 @@ in stdenvNoCC.mkDerivation
|
||||
${buildEnv}/bin/buildEnv ${buildScript}
|
||||
'';
|
||||
dontInstall = true;
|
||||
requiredSystemFeatures = [ "oneapiarch-${oneapiArch}" ];
|
||||
requiredSystemFeatures = [ "gccarch-exact-${stdenvNoCC.hostPlatform.gcc.arch}" ];
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ let
|
||||
mkdir -p $out/bin
|
||||
for i in std gam ncl; do cp bin/vasp_$i $out/bin/vasp-$i; done
|
||||
'';
|
||||
requiredSystemFeatures = [ "gccarch-exact-${stdenvNoCC.hostPlatform.gcc.arch}" ];
|
||||
};
|
||||
startScript = version: writeScript "vasp-intel-${version}"
|
||||
''
|
||||
|
||||
@@ -48,7 +48,7 @@ let
|
||||
mkdir -p $out/bin
|
||||
for i in std gam ncl; do cp bin/vasp_$i $out/bin/vasp-$i; done
|
||||
'';
|
||||
requiredSystemFeatures = [ "nvhpcarch-${nvhpcArch}" ];
|
||||
requiredSystemFeatures = [ "gccarch-exact-${stdenvNoCC.hostPlatform.gcc.arch}" ];
|
||||
};
|
||||
startScript = version: writeScript "vasp-nvidia-${version}"
|
||||
''
|
||||
|
||||
@@ -79,7 +79,7 @@ inputs:
|
||||
(with inputs.config.nixos.system.nixpkgs; if march == null then [] else [ march ])
|
||||
else nix.marches
|
||||
))
|
||||
++ (with inputs.config.nixos.system.nixpkgs; if march == null then [] else [ "nvhpcarch-${march}" ]);
|
||||
++ (with inputs.config.nixos.system.nixpkgs; if march == null then [] else [ "gccarch-exact-${march}" ]);
|
||||
}
|
||||
# includeBuildDependencies
|
||||
(inputs.lib.mkIf nix.includeBuildDependencies
|
||||
|
||||
@@ -33,7 +33,6 @@ inputs:
|
||||
{ cudaCapabilities = nixpkgs.cuda.capabilities; })
|
||||
// (inputs.lib.optionalAttrs (nixpkgs.cuda.forwardCompat != null)
|
||||
{ cudaForwardCompat = nixpkgs.cuda.forwardCompat; })
|
||||
// (inputs.lib.optionalAttrs (nixpkgs.march != null) { nvhpcArch = nixpkgs.march; })
|
||||
);
|
||||
in
|
||||
{
|
||||
@@ -49,6 +48,7 @@ inputs:
|
||||
// (if nixpkgs.march == null then {} else
|
||||
{
|
||||
oneapiArch = let match.znver4 = "COMMON-AVX512"; in match.${nixpkgs.march} or nixpkgs.march;
|
||||
nvhpcArch = nixpkgs.march;
|
||||
});
|
||||
overlays =
|
||||
[(final: prev:
|
||||
|
||||
Reference in New Issue
Block a user