From 9d313093fb8b614398eb45ad2431fd8ef5c7aabb Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 23 Apr 2025 19:14:13 +0000 Subject: [PATCH 1/9] [packages] add clang-format --- install_apt_packages.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install_apt_packages.sh b/install_apt_packages.sh index 76c705a2c34..d79f3d14fec 100755 --- a/install_apt_packages.sh +++ b/install_apt_packages.sh @@ -40,3 +40,7 @@ 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 From b7c1f1f7fe0a928207d70b9a101154e3dfb9ceea Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 23 Apr 2025 22:56:52 +0000 Subject: [PATCH 2/9] [docker] set ubuntu version to 24.04 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2b36ac5c5e5..91de2373d7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive # set out workspace ENV WORKSPACE=/workspace From d56576e8d6736cc306e1f4c583388e032f218f82 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Thu, 24 Apr 2025 11:46:51 +0000 Subject: [PATCH 3/9] [dockerfile] enable system-wide python package installation for pip --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 91de2373d7f..7b3b94a2668 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ENV WORKSPACE=/workspace RUN mkdir -p ${WORKSPACE} WORKDIR ${WORKSPACE} COPY . ${WORKSPACE} +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 From 0afdfff63aabae0ee3165876d9727f13ae324a00 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Thu, 24 Apr 2025 10:05:43 -0700 Subject: [PATCH 4/9] [dockerfile] add comment --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7b3b94a2668..29c3cd94c66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ 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 \ @@ -30,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"] From dfc89dc47d9befa7ad3c01e05c5263a767097a51 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Thu, 24 Apr 2025 12:29:58 -0700 Subject: [PATCH 5/9] [package] check whehter clang-format-18 package exist --- install_apt_packages.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install_apt_packages.sh b/install_apt_packages.sh index d79f3d14fec..c6cc8a6200a 100755 --- a/install_apt_packages.sh +++ b/install_apt_packages.sh @@ -42,5 +42,8 @@ sudo apt-get install -y \ sphinx-common # Required for code formatting -sudo apt-get install -y \ - clang-format-18 +if apt-cache search --names-only 'clang-format-18' | grep -q 'clang-format-18'; then + sudo apt-get install -y clang-format-18 +else + echo "clang-format-18 not found in apt-cache. Skipping installation." +fi From af7c0440426e623ab3ea48a36b7a4018d88af876 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Thu, 24 Apr 2025 12:43:09 -0700 Subject: [PATCH 6/9] [package] remove deprecated names-only option --- install_apt_packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_apt_packages.sh b/install_apt_packages.sh index c6cc8a6200a..aed5e630ed8 100755 --- a/install_apt_packages.sh +++ b/install_apt_packages.sh @@ -42,7 +42,7 @@ sudo apt-get install -y \ sphinx-common # Required for code formatting -if apt-cache search --names-only 'clang-format-18' | grep -q 'clang-format-18'; then +if apt-cache search '^clang-format-18$' | grep -q 'clang-format-18'; then sudo apt-get install -y clang-format-18 else echo "clang-format-18 not found in apt-cache. Skipping installation." From f13addcfd6b531d01a82801c28743509de535fd2 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Thu, 24 Apr 2025 14:07:29 -0700 Subject: [PATCH 7/9] [package] remove if condition --- install_apt_packages.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install_apt_packages.sh b/install_apt_packages.sh index aed5e630ed8..2d0dbf399e2 100755 --- a/install_apt_packages.sh +++ b/install_apt_packages.sh @@ -42,8 +42,6 @@ sudo apt-get install -y \ sphinx-common # Required for code formatting -if apt-cache search '^clang-format-18$' | grep -q 'clang-format-18'; then - sudo apt-get install -y clang-format-18 -else - echo "clang-format-18 not found in apt-cache. Skipping installation." -fi +sudo apt-get install -y \ + clang-format-18 + From 1bd97f14527b9a8eced37ee7294f204d25376d70 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Thu, 24 Apr 2025 14:11:46 -0700 Subject: [PATCH 8/9] [doc] update quick start on installing packages --- doc/src/quickstart/index.rst | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/doc/src/quickstart/index.rst b/doc/src/quickstart/index.rst index 242079bef99..c2dd8512824 100644 --- a/doc/src/quickstart/index.rst +++ b/doc/src/quickstart/index.rst @@ -23,8 +23,29 @@ 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: + +.. 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 From 7cdf4334d799f50e8a13093e22ac0d58701a9ff1 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Fri, 25 Apr 2025 06:59:12 -0700 Subject: [PATCH 9/9] [doc] clarify that clang-format is not required to build VPR --- doc/src/quickstart/index.rst | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/src/quickstart/index.rst b/doc/src/quickstart/index.rst index c2dd8512824..f69eb39b077 100644 --- a/doc/src/quickstart/index.rst +++ b/doc/src/quickstart/index.rst @@ -24,15 +24,9 @@ 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 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: +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