localPackages.mumax: init

This commit is contained in:
陈浩南 2024-02-27 18:51:12 +08:00
parent 82fb082006
commit 8d5a663ae0
4 changed files with 41 additions and 0 deletions

View File

@ -1125,6 +1125,22 @@
"url": "https://github.com/CHN-beta/misskey"
}
},
"mumax": {
"flake": false,
"locked": {
"lastModified": 1709298542,
"narHash": "sha256-w3VuxnEqkwwplNXwzdhC2mVMuVG7bBdzzzRcWZ4nRM8=",
"owner": "CHN-beta",
"repo": "mumax",
"rev": "3658ac4ec975a58ba3ad5e7ede61bd26bdadfe23",
"type": "github"
},
"original": {
"owner": "CHN-beta",
"repo": "mumax",
"type": "github"
}
},
"nameof": {
"flake": false,
"locked": {
@ -1950,6 +1966,7 @@
"lmod": "lmod",
"matplotplusplus": "matplotplusplus",
"misskey": "misskey",
"mumax": "mumax",
"nameof": "nameof",
"napalm": "napalm",
"nix-alien": "nix-alien",

View File

@ -67,6 +67,7 @@
linux-surface = { url = "github:linux-surface/linux-surface"; flake = false; };
lepton = { url = "github:black7375/Firefox-UI-Fix"; flake = false; };
lmod = { url = "github:TACC/Lmod"; flake = false; };
mumax = { url = "github:CHN-beta/mumax"; flake = false; };
};
outputs = inputs:

View File

@ -65,4 +65,5 @@
};
hdf5-nvhpc = callPackage ./hdf5-nvhpc { inherit lmod; inherit (hdf5) src; nvhpc = nvhpc."24.1"; };
oneapi = callPackage ./oneapi {};
mumax = callPackage ./mumax { src = topInputs.mumax; };
}

View File

@ -0,0 +1,22 @@
{ buildGoModule, cudatoolkit, src, config, cudaCapabilities ? config.cudaCapabilities, gcc, makeWrapper }:
# TODO: use addDriverRunpath
buildGoModule
{
name = "mumax";
inherit src;
vendorHash = null;
nativeBuildInputs = [ cudatoolkit gcc makeWrapper ];
CUDA_CC = builtins.concatStringsSep " " cudaCapabilities;
CPATH = "${cudatoolkit}/include";
LIBRARY_PATH = "${cudatoolkit}/lib/stubs";
doCheck = false;
postInstall =
''
rm $out/bin/{doc,test}
for i in $out/bin/*; do
if [ -f $i ]; then
wrapProgram $i --prefix LD_LIBRARY_PATH ":" "/run/opengl-driver/lib:${cudatoolkit}/lib"
fi
done
'';
}