-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathshell.nix
More file actions
81 lines (68 loc) · 2.18 KB
/
shell.nix
File metadata and controls
81 lines (68 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
with import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/219951b495fc2eac67b1456824cc1ec1fd2ee659.tar.gz") {
config.allowUnfree = true;
};
let
pythonPackages = pkgs.python3Packages;
MACHOP_DIR = builtins.toString ./machop;
in pkgs.mkShell {
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.clangStdenv.cc.cc pkgs.libGL pkgs.glib cudaPackages.cuda_cudart cudaPackages.cudatoolkit cudaPackages.cudnn ];
name = "impureMaseEnv";
venvDir = "./.venv";
buildInputs = [
# A Python interpreter including the 'venv' module is required to bootstrap
# the environment.
pythonPackages.python
# This executes some shell code to initialize a venv in $venvDir before
# dropping into the shell
pythonPackages.venvShellHook
# For MASE, in order to compile some binary extensions they may
# require, the Python modules listed in the requirements.txt need
# the following packages to be installed locally:
taglib
openssl
git
libxml2
libxslt
libzip
zlib
libGL
glib
libglvnd
mesa
python311Packages.cocotb-bus
python311Packages.cocotb
python311Packages.pyopengl
wget
python311Packages.tensorboard
# python311Packages.tensorflowWithCuda
python311Packages.tensorflow-bin
python311Packages.torch-bin
python311Packages.torchvision-bin
python311Packages.torchaudio-bin
cudaPackages.cuda_cudart
cudaPackages.cudatoolkit
cudaPackages.cudnn
# python311Packages.pytorch-lightning
python311Packages.keras
python311Packages.python-lsp-server
verible
verilator
svls
];
# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
TMPDIR=./tmp/ pip install -r ./machop/requirements.txt
'';
# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
# Add macho to the users PYTHONPATH
export PYTHONPATH="$PYTHONPATH:${MACHOP_DIR}"
export CUDA_PATH=${pkgs.cudatoolkit}
# Enter terminal shell of your choice e.g. fish or bash
# fish
'';
}