Skip to content

Commit 3a3bc7a

Browse files
authored
feat: bump package version (#71)
Including: - bump nix flake - verilator 5.040 -> 5.044 - clang default (18 on ubuntu 24.04, or 14 on ubuntu 22.04) -> 19 - openjdk 11 -> 21 Also: - add llvmPackages.bolt in nix devshell for pgo - print clang version in nix devshell Close #70
1 parent b38262b commit 3a3bc7a

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
gcc # host toolchain
2828
pkgsCross.riscv64.buildPackages.gcc # riscv64-unknown-elf-xxx toolchain
2929
llvm # for pgo
30+
llvmPackages.bolt # for pgo
3031
clang
3132
gnumake # make
3233
dtc # device tree compiler
@@ -42,14 +43,17 @@
4243
};
4344
}))
4445
(verilator.overrideAttrs (finalAttrs: previousAttrs: {
45-
version = "5.040";
46+
version = "5.044";
4647
VERILATOR_SRC_VERSION = "v${finalAttrs.version}";
4748
src = fetchFromGitHub {
4849
owner = "verilator";
4950
repo = "verilator";
5051
rev = "v${finalAttrs.version}";
51-
hash = "sha256-S+cDnKOTPjLw+sNmWL3+Ay6+UM8poMadkyPSGd3hgnc=";
52+
hash = "sha256-z3jYNzhnZ+OocDAbmsRBWHNNPXLLvExKK1TLDi9JzPQ=";
5253
};
54+
# drop patch https://github.com/NixOS/nixpkgs/commit/06be23d66287c004cb8ef933a9ff6589276ab104
55+
# since it's already included in 5.044
56+
patches = [];
5357
doCheck = false;
5458
}))
5559

@@ -70,6 +74,7 @@
7074
echo "- $(mill --version | head -n 1)"
7175
echo "- $(gcc --version | head -n 1)"
7276
echo "- $(riscv64-unknown-linux-gnu-gcc --version | head -n 1)"
77+
echo "- $(clang --version | head -n 1)"
7378
echo "- $(java -version 2>&1 | head -n 1)"
7479
echo "You can press Ctrl + D to exit devshell."
7580
export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH"

install-verilator.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,25 @@
22

33
export DEBIAN_FRONTEND=noninteractive
44

5-
apt-get install -y git help2man perl python3 make autoconf g++ flex bison clang
5+
apt-get install -y git help2man perl python3 make autoconf g++ flex bison
66
apt-get install -y libgoogle-perftools-dev numactl perl-doc
77
apt-get install -y libfl2 # Ubuntu only (ignore if gives error)
88
apt-get install -y libfl-dev # Ubuntu only (ignore if gives error)
99
apt-get install -y zlibc zlib1g zlib1g-dev # Ubuntu only (ignore if gives error)
1010

11+
# we recommend using clang-19 for the moment, but it's not default behavior of ubuntu 24.04
12+
# so check if clang is installed before actually calling apt install to avoid multiple versions conflict
13+
if ! command -v clang >/dev/null 2>&1; then
14+
apt-get install -y clang
15+
fi
16+
1117
git clone https://github.com/verilator/verilator
1218

1319
# Every time you need to build:
1420
unset VERILATOR_ROOT # For bash
1521
cd verilator
1622

17-
git checkout v5.040
23+
git checkout v5.044
1824

1925
autoconf # Create ./configure script
2026
# Configure and create Makefile

setup-tools.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@ apt install -y \
1313
tmux \
1414
make \
1515
g++ \
16-
clang \
17-
llvm \
1816
time \
1917
curl \
2018
libreadline6-dev \
2119
libsdl2-dev \
2220
g++-riscv64-linux-gnu \
23-
openjdk-11-jre \
2421
zlib1g-dev \
2522
device-tree-compiler \
2623
flex \
@@ -35,8 +32,25 @@ apt install -y \
3532
python3-grpc-tools \
3633
rsync
3734

38-
# Install llvm-bolt if available
39-
apt install -y llvm-bolt || echo "Skipping llvm-bolt installation, not available in apt repos"
35+
# GSIM requires clang 19+
36+
if apt list "clang*" | grep clang-19; then
37+
apt install -y clang-19
38+
apt install -y bolt-19 || echo "Skipping bolt-19 installation, not available in apt repos"
39+
for bin in $(ls /usr/bin/*-19); do
40+
base=$(basename $bin)
41+
alt=${base%-19}
42+
update-alternatives --install /usr/bin/$alt $alt /usr/bin/$base 100
43+
update-alternatives --set $alt /usr/bin/$base
44+
done
45+
else
46+
echo "Warning: clang-19 is not available, falling back to default clang."
47+
echo "This may be because you are not using the Ubuntu version we recommend."
48+
apt install -y clang
49+
apt install -y llvm-bolt || echo "Skipping llvm-bolt installation, not available in apt repos"
50+
fi
51+
52+
# openjdk has better performance with newer versions
53+
apt install -y openjdk-21-jre || apt install -y openjdk-11-jre
4054

4155
sh -c "curl -L https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/1.0.4/mill-dist-1.0.4-mill.sh > /usr/local/bin/mill && chmod +x /usr/local/bin/mill"
4256

0 commit comments

Comments
 (0)