-
Notifications
You must be signed in to change notification settings - Fork 74
/
shell.nix
73 lines (70 loc) · 1.95 KB
/
shell.nix
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
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2022 Jiuyang Liu <[email protected]>
with import <nixpkgs> {
config = {
packageOverrides = pkgs: with pkgs; {
llvmPackages = llvmPackages_13;
clang = clang_13;
lld = lld_13;
jdk = if stdenv.isDarwin then jdk11_headless else graalvm11-ce;
protobuf = protobuf3_15; # required by firrtl
python = python3Full;
};
};
};
let
clang-multiple-target =
pkgs.writeScriptBin "clang" ''
#!${pkgs.bash}/bin/bash
if [[ "$*" == *--target=riscv64* || "$*" == *-target\ riscv64* ]]; then
# works partially, namely no ld
${pkgs.pkgsCross.riscv64.buildPackages.clang}/bin/riscv64-unknown-linux-gnu-clang \
--target=riscv64 \
$@
else
# works fully
${pkgs.clang}/bin/clang $@
fi
'';
clangpp-multiple-target =
pkgs.writeScriptBin "clang++" ''
#!${pkgs.bash}/bin/bash
if [[ "$*" == *--target=riscv64* || "$*" == *-target\ riscv64* ]]; then
# works partially, namely no ld
${pkgs.pkgsCross.riscv64.buildPackages.clang}/bin/riscv64-unknown-linux-gnu-clang++ \
--target=riscv64 \
$@
else
# works fully
${pkgs.clang}/bin/clang++ $@
fi
'';
cpp-multiple-target = pkgs.writeScriptBin "cpp" ''
#!${pkgs.bash}/bin/bash
${pkgs.clang}/bin/cpp $@
'';
cc = if stdenv.isDarwin then [clang] else [
clang-multiple-target
clangpp-multiple-target
cpp-multiple-target
];
in pkgs.callPackage (
{
mkShellNoCC,
jdk,
python,
gnumake, git, mill, wget, parallel, dtc, protobuf, antlr4,
llvmPackages, clang, lld, verilator, cmake, ninja, rcs,
autoconf, automake
}:
mkShellNoCC {
name = "ventus-gpgpu";
depsBuildBuild = [
jdk gnumake git mill wget parallel dtc protobuf antlr4
verilator cmake ninja rcs autoconf automake
llvmPackages.llvm lld
python
cc
];
}
) {}