Skip to content

Commit 444b9ac

Browse files
authored
Merge pull request #2999 from verilog-to-routing/add_formatting_package
[packages] add clang-format
2 parents 3dd2d4e + 7cdf433 commit 444b9ac

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22
ARG DEBIAN_FRONTEND=noninteractive
33
# set out workspace
44
ENV WORKSPACE=/workspace
55
RUN mkdir -p ${WORKSPACE}
66
WORKDIR ${WORKSPACE}
77
COPY . ${WORKSPACE}
8+
# Required to bypass Python's protection on system-wide package installations in Ubuntu 23.04+.
9+
# This allows pip to install packages globally without using a virtual environment.
10+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
811
# Install and cleanup is done in one command to minimize the build cache size
912
RUN apt-get update -qq \
1013
# Extract package names from install_apt_packages.sh
@@ -29,4 +32,4 @@ RUN apt-get update -qq \
2932
# Build VTR
3033
RUN rm -rf build && make -j$(nproc) && make install
3134
# Container's default launch command
32-
SHELL ["/bin/bash", "-c"]
35+
SHELL ["/bin/bash", "-c"]

doc/src/quickstart/index.rst

+17-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,23 @@ If you cloned the repository, you will need to set up the git submodules (if you
2323
2424
> git submodule init
2525
> git submodule update
26-
27-
VTR requires several system packages and Python packages to build and run the flow. Ubuntu users can install the required system packages using the following command (this works on Ubuntu 18.04, 20.04, 22.04 and 24.04, but you may require different packages on other Linux distributions). Our CI testing is on Ubuntu 24.04, so that is the best tested platform and recommended for development.
26+
27+
VTR requires several system and Python packages to build and run the flow. Ubuntu users can install the required system packages using the provided script or the command below. This setup works on Ubuntu 18.04, 20.04, 22.04, and 24.04, but note that some packages (such as ``clang-format-18``) are only available by default on Ubuntu 24.04. On older versions, this package will not be installed unless you manually add the appropriate LLVM APT repository.
28+
29+
To install ``clang-format-18`` on older Ubuntu versions (e.g., 20.04 or 22.04), you must add the LLVM repository manually. Note that this tool is only required if you want to run ``make format`` to automatically fix formatting issues in the code. It is not necessary for building or running VPR.
30+
31+
.. code-block:: bash
32+
33+
sudo apt install wget gnupg lsb-release
34+
wget https://apt.llvm.org/llvm.sh
35+
chmod +x llvm.sh
36+
sudo ./llvm.sh 18
37+
38+
After that, you can install ``clang-format-18`` using:
39+
40+
.. code-block:: bash
41+
42+
sudo apt install clang-format-18
2843
2944
.. code-block:: bash
3045

install_apt_packages.sh

+5
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ sudo apt-get install -y \
4040
# Required to build the documentation
4141
sudo apt-get install -y \
4242
sphinx-common
43+
44+
# Required for code formatting
45+
sudo apt-get install -y \
46+
clang-format-18
47+

0 commit comments

Comments
 (0)