diff --git a/Dockerfile b/Dockerfile index 2b36ac5c5e5..29c3cd94c66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive # set out workspace ENV WORKSPACE=/workspace RUN mkdir -p ${WORKSPACE} WORKDIR ${WORKSPACE} COPY . ${WORKSPACE} +# Required to bypass Python's protection on system-wide package installations in Ubuntu 23.04+. +# This allows pip to install packages globally without using a virtual environment. +ENV PIP_BREAK_SYSTEM_PACKAGES=1 # Install and cleanup is done in one command to minimize the build cache size RUN apt-get update -qq \ # Extract package names from install_apt_packages.sh @@ -29,4 +32,4 @@ RUN apt-get update -qq \ # Build VTR RUN rm -rf build && make -j$(nproc) && make install # Container's default launch command -SHELL ["/bin/bash", "-c"] \ No newline at end of file +SHELL ["/bin/bash", "-c"] diff --git a/doc/src/quickstart/index.rst b/doc/src/quickstart/index.rst index 242079bef99..f69eb39b077 100644 --- a/doc/src/quickstart/index.rst +++ b/doc/src/quickstart/index.rst @@ -23,8 +23,23 @@ If you cloned the repository, you will need to set up the git submodules (if you > git submodule init > git submodule update - -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. + +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. + +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. + +.. code-block:: bash + + sudo apt install wget gnupg lsb-release + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 18 + +After that, you can install ``clang-format-18`` using: + +.. code-block:: bash + + sudo apt install clang-format-18 .. code-block:: bash diff --git a/install_apt_packages.sh b/install_apt_packages.sh index 76c705a2c34..2d0dbf399e2 100755 --- a/install_apt_packages.sh +++ b/install_apt_packages.sh @@ -40,3 +40,8 @@ sudo apt-get install -y \ # Required to build the documentation sudo apt-get install -y \ sphinx-common + +# Required for code formatting +sudo apt-get install -y \ + clang-format-18 +