Skip to content

Instantly share code, notes, and snippets.

@NickCao
Created September 26, 2022 07:40
Show Gist options
  • Save NickCao/7c9b1a154ba751e3e27a28dc369d1cbd to your computer and use it in GitHub Desktop.
Save NickCao/7c9b1a154ba751e3e27a28dc369d1cbd to your computer and use it in GitHub Desktop.
CosmicTagger
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
flake-utils.url = "github:numtide/flake-utils";
mach-nix = {
url = "github:DavHau/mach-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, mach-nix }:
flake-utils.lib.eachSystem [ "x86_64-linux" ]
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(self: super: {
mpi = super.mpi.override { enablePrefix = true; };
})
];
};
mach = import mach-nix { inherit pkgs; };
in
{
packages = rec {
larcv3 = mach.buildPythonPackage rec {
pname = "larcv3";
version = "git";
src = pkgs.fetchgit {
url = "https://github.com/DeepLearnPhysics/larcv3";
rev = "f2d51aae319a6c1f93ce5db9ae1b539fec43ca4f";
sha256 = "sha256-kDtbdiwlXnAunUm+mJa5260Zp0djqYSI0Ir0vp54y4E=";
};
requirements = builtins.readFile "${src}/requirements.txt";
nativeBuildInputs = with pkgs; [ cmake ninja ];
buildInputs = with pkgs; [ hdf5 ];
dontUseCmakeConfigure = true;
};
cosmictagger = pkgs.fetchgit {
url = "https://github.com/coreyjadams/CosmicTagger";
rev = "0f3c4d14749fb33dc1cc95e91b897f5d7e582fde";
sha256 = "sha256-NOUcSU0XEXtQUo7Wmn0OStMD08c7EJduYV8BI5EZ1vM=";
};
cosmictagger-env = mach.mkPython rec {
requirements = ''
numpy
h5py
torch
hydra
omegaconf
antlr4-python3-runtime
pyyaml
mpi4py
tensorboardX
'';
providers = {
mpi4py = "nixpkgs";
omegaconf = "nixpkgs";
hydra = "nixpkgs";
antlr4-python3-runtime = "nixpkgs";
};
packagesExtra = [ larcv3 ];
};
};
# defaultPackage = packages.experiment-run;
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment