From cb73b927ace272df7dc8d3fc4f53b34fa5afbce5 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sun, 24 Nov 2024 15:52:22 -0800 Subject: [PATCH 1/5] Add SUSE detection --- bin/wally-distro-check.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/wally-distro-check.sh b/bin/wally-distro-check.sh index db0699fd2..c7a540c34 100755 --- a/bin/wally-distro-check.sh +++ b/bin/wally-distro-check.sh @@ -95,6 +95,17 @@ elif [[ "$ID" == debian || "$ID_LIKE" == *debian* ]]; then printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally installation script has only been tested with Debian versions 11 and 12. You have version $VERSION." exit 1 fi +elif [[ "$ID" == opensuse-leap || "$ID" == sles || "$ID_LIKE" == *suse* ]]; then + export FAMILY=suse + if [[ "$ID" != opensuse-leap && "$ID" != sles ]]; then + printf "${WARNING_COLOR}%s%s\n${ENDC}" "For SUSE family distros, the Wally installation script has only been tested on OpenSUSE Leap and SLES. Your distro " \ + "is $PRETTY_NAME. The regular SUSE install will be attempted, but there may be issues. If you are using OpenSUSE Tumbleweed, the version check will fail." + fi + export SUSE_VERSION="${VERSION_ID//.}" + if (( SUSE_VERSION < 156 )); then + printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally installation script has only been tested with SUSE version 15.6. You have version $VERSION." + exit 1 + fi else printf "${FAIL_COLOR}%s%s%s\n${ENDC}" "The Wally installation script is currently only compatible with Ubuntu, Debian, and Red Hat family " \ "(RHEL, Rocky Linux, or AlmaLinux) distros. Your detected distro is $PRETTY_NAME. You may try manually running the " \ From 9724bb64c58e3bee2048731f00621e1ccf635e9f Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sun, 24 Nov 2024 15:52:55 -0800 Subject: [PATCH 2/5] Add suse packages --- bin/wally-package-install.sh | 108 ++++++++++++++++++-------------- bin/wally-tool-chain-install.sh | 8 ++- site-setup.sh | 2 + 3 files changed, 71 insertions(+), 47 deletions(-) diff --git a/bin/wally-package-install.sh b/bin/wally-package-install.sh index 318cb51ac..836a5625f 100755 --- a/bin/wally-package-install.sh +++ b/bin/wally-package-install.sh @@ -45,61 +45,77 @@ fi # Packages are grouped by which tool requires them. If multiple tools need a package, it is included in the first tool only # Packages that are constant across distros -GENERAL_PACKAGES+=(rsync git make cmake curl wget tar unzip bzip2 dialog mutt ssmtp) -GNU_PACKAGES+=(autoconf automake gawk bison flex texinfo gperf libtool ninja-build patchutils bc gcc) +GENERAL_PACKAGES+=(rsync git make cmake curl wget tar unzip bzip2 dialog mutt) +GNU_PACKAGES+=(autoconf automake gawk bison flex texinfo gperf libtool patchutils bc gcc) VERILATOR_PACKAGES+=(help2man perl clang ccache numactl) -BUILDROOT_PACKAGES+=(ncurses-base cpio) +BUILDROOT_PACKAGES+=(cpio) # Distro specific packages and package manager -if [ "$FAMILY" == rhel ]; then - PYTHON_VERSION=python3.12 - PACKAGE_MANAGER="dnf -y" - UPDATE_COMMAND="sudo $PACKAGE_MANAGER update" - GENERAL_PACKAGES+=(which "$PYTHON_VERSION" "$PYTHON_VERSION"-pip pkgconf-pkg-config gcc-c++) - GNU_PACKAGES+=(libmpc-devel mpfr-devel gmp-devel zlib-devel expat-devel libslirp-devel) - QEMU_PACKAGES+=(glib2-devel libfdt-devel pixman-devel) - SPIKE_PACKAGES+=(dtc boost-regex boost-system) - VVERILATOR_PACKAGES+=(gperftools mold) - BUILDROOT_PACKAGES+=(ncurses ncurses-libs ncurses-devel gcc-gfortran) # gcc-gfortran is only needed for compiling spec benchmarks on buildroot linux - # Extra packages not availale in rhel8, nice for Verilator - if (( RHEL_VERSION >= 9 )); then - VERILATOR_PACKAGES+=(perl-doc) - fi - # A newer version of gcc is required for qemu - OTHER_PACKAGES=(gcc-toolset-13) -elif [[ "$FAMILY" == ubuntu || "$FAMILY" == debian ]]; then - if (( UBUNTU_VERSION >= 24 )); then +case "$FAMILY" in + rhel) PYTHON_VERSION=python3.12 - elif (( UBUNTU_VERSION >= 22 )); then - PYTHON_VERSION=python3.11 - elif (( UBUNTU_VERSION >= 20 )); then - PYTHON_VERSION=python3.9 - OTHER_PACKAGES+=(gcc-10 g++-10 cpp-10) # Newer version of gcc needed for Verilator - elif (( DEBIAN_VERSION >= 12 )); then - PYTHON_VERSION=python3.11 - elif (( DEBIAN_VERSION >= 11 )); then - PYTHON_VERSION=python3.9 - fi - # Mold not available in older distros for Verilator, will download binary instead - if (( UBUNTU_VERSION != 20 && DEBIAN_VERSION != 11 )); then - VERILATOR_PACKAGES+=(mold) - fi - PACKAGE_MANAGER="DEBIAN_FRONTEND=noninteractive apt-get -y" - UPDATE_COMMAND="sudo $PACKAGE_MANAGER update && sudo $PACKAGE_MANAGER upgrade --with-new-pkgs" - GENERAL_PACKAGES+=("$PYTHON_VERSION" python3-pip "$PYTHON_VERSION"-venv pkg-config g++) - GNU_PACKAGES+=(autotools-dev libmpc-dev libmpfr-dev libgmp-dev build-essential zlib1g-dev libexpat1-dev libglib2.0-dev libslirp-dev) - QEMU_PACKAGES+=(libfdt-dev libpixman-1-dev) - SPIKE_PACKAGES+=(device-tree-compiler libboost-regex-dev libboost-system-dev) - VERILATOR_PACKAGES+=(libunwind-dev libgoogle-perftools-dev perl-doc libfl2 libfl-dev zlib1g) - BUILDROOT_PACKAGES+=(ncurses-bin libncurses-dev gfortran) # gfortran is only needed for compiling spec benchmarks on buildroot linux - VIVADO_PACKAGES+=(libncurses*) # Vivado hangs on the third stage of installation without this -fi + PACKAGE_MANAGER="dnf -y" + UPDATE_COMMAND="sudo $PACKAGE_MANAGER update" + GENERAL_PACKAGES+=(which "$PYTHON_VERSION" "$PYTHON_VERSION"-pip pkgconf-pkg-config gcc-c++ ssmtp) + GNU_PACKAGES+=(libmpc-devel mpfr-devel gmp-devel zlib-devel expat-devel libslirp-devel ninja-build) + QEMU_PACKAGES+=(glib2-devel libfdt-devel pixman-devel) + SPIKE_PACKAGES+=(dtc boost-regex boost-system) + VERILATOR_PACKAGES+=(gperftools mold) + BUILDROOT_PACKAGES+=(ncurses ncurses-base ncurses-libs ncurses-devel gcc-gfortran) # gcc-gfortran is only needed for compiling spec benchmarks on buildroot linux + # Extra packages not availale in rhel8, nice for Verilator + if (( RHEL_VERSION >= 9 )); then + VERILATOR_PACKAGES+=(perl-doc) + fi + # A newer version of gcc is required for qemu + OTHER_PACKAGES+=(gcc-toolset-13) + ;; + ubuntu | debian) + if (( UBUNTU_VERSION >= 24 )); then + PYTHON_VERSION=python3.12 + elif (( UBUNTU_VERSION >= 22 )); then + PYTHON_VERSION=python3.11 + elif (( UBUNTU_VERSION >= 20 )); then + PYTHON_VERSION=python3.9 + OTHER_PACKAGES+=(gcc-10 g++-10 cpp-10) # Newer version of gcc needed for Verilator + elif (( DEBIAN_VERSION >= 12 )); then + PYTHON_VERSION=python3.11 + elif (( DEBIAN_VERSION >= 11 )); then + PYTHON_VERSION=python3.9 + fi + # Mold not available in older distros for Verilator, will download binary instead + if (( UBUNTU_VERSION != 20 && DEBIAN_VERSION != 11 )); then + VERILATOR_PACKAGES+=(mold) + fi + PACKAGE_MANAGER="DEBIAN_FRONTEND=noninteractive apt-get -y" + UPDATE_COMMAND="sudo $PACKAGE_MANAGER update && sudo $PACKAGE_MANAGER upgrade --with-new-pkgs" + GENERAL_PACKAGES+=("$PYTHON_VERSION" python3-pip "$PYTHON_VERSION"-venv pkg-config g++ ssmtp) + GNU_PACKAGES+=(autotools-dev libmpc-dev libmpfr-dev libgmp-dev build-essential ninja-build zlib1g-dev libexpat1-dev libglib2.0-dev libslirp-dev) + QEMU_PACKAGES+=(libfdt-dev libpixman-1-dev) + SPIKE_PACKAGES+=(device-tree-compiler libboost-regex-dev libboost-system-dev) + VERILATOR_PACKAGES+=(libunwind-dev libgoogle-perftools-dev perl-doc libfl2 libfl-dev zlib1g) + BUILDROOT_PACKAGES+=(ncurses-base ncurses-bin libncurses-dev gfortran) # gfortran is only needed for compiling spec benchmarks on buildroot linux + VIVADO_PACKAGES+=(libncurses*) # Vivado hangs on the third stage of installation without this + ;; + suse) + PYTHON_VERSION=python3.12 + PYTHON_VERSION_PACKAGE=python312 + PACKAGE_MANAGER="zypper -n" + UPDATE_COMMAND="sudo $PACKAGE_MANAGER update" + GENERAL_PACKAGES+=("$PYTHON_VERSION_PACKAGE" "$PYTHON_VERSION_PACKAGE"-pip pkg-config) + GNU_PACKAGES+=(mpc-devel mpfr-devel gmp-devel zlib-devel libexpat-devel libslirp-devel ninja) + QEMU_PACKAGES+=(glib2-devel libpixman-1-0-devel) # maybe also need qemu itself? + SPIKE_PACKAGES+=(dtc libboost_regex1_75_0-devel libboost_system1_75_0-devel) + VERILATOR_PACKAGES+=(gperftools perl-doc) + BUILDROOT_PACKAGES+=(ncurses-utils ncurses-devel ncurses5-devel gcc-fortran) # gcc-fortran is only needed for compiling spec benchmarks on buildroot linux + OTHER_PACKAGES+=(gcc14 gcc14-c++ cpp14) # Newer version of gcc needed for many tools. Default is gcc7 + ;; +esac # Check if required packages are installed or install/update them depending on passed flag. if [ "${1}" == "--check" ]; then section_header "Checking Dependencies from Package Manager" - if [ "$FAMILY" == rhel ]; then + if [[ "$FAMILY" == rhel || "$FAMILY" == suse ]]; then for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do rpm -q "$pack" > /dev/null || (echo -e "${FAIL_COLOR}Missing packages detected (${WARNING_COLOR}$pack${FAIL_COLOR}). Run as root to auto-install or run wally-package-install.sh first.${ENDC}" && exit 1) done diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 4bfa2c9a3..77895261c 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -191,6 +191,12 @@ fi # Enable newer version of gcc for older distros (required for QEMU/Verilator) if [ "$FAMILY" == rhel ]; then source /opt/rh/gcc-toolset-13/enable +elif [ "$FAMILY" == suse ]; then + mkdir -p "$RISCV"/gcc-14/bin + for f in gcc cpp g++ gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool lto-dump; do + ln -vsf /usr/bin/$f-14 "$RISCV"/gcc-14/bin/$f + done + export PATH="$RISCV"/gcc-14/bin:$PATH elif (( UBUNTU_VERSION == 20 )); then mkdir -p "$RISCV"/gcc-10/bin for f in gcc cpp g++ gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool lto-dump; do @@ -264,7 +270,7 @@ if (( RHEL_VERSION == 8 )); then fi # Mold needed for Verilator -if (( UBUNTU_VERSION == 20 || DEBIAN_VERSION == 11 )); then +if (( UBUNTU_VERSION == 20 || DEBIAN_VERSION == 11 )) || [ "$FAMILY" == suse ]; then STATUS="mold" if [ ! -e "$RISCV"/bin/mold ]; then section_header "Installing mold" diff --git a/site-setup.sh b/site-setup.sh index 34fe1eb42..8df82503a 100755 --- a/site-setup.sh +++ b/site-setup.sh @@ -77,6 +77,8 @@ fi # Use newer gcc version for older distros if [ -e /opt/rh/gcc-toolset-13/enable ]; then source /opt/rh/gcc-toolset-13/enable # Red Hat Family +elif [ -e $RISCV/gcc-14 ]; then + export PATH=$RISCV/gcc-14/bin:$PATH # SUSE Family elif [ -e $RISCV/gcc-10 ]; then export PATH=$RISCV/gcc-10/bin:$PATH # Ubuntu 20.04 LTS fi From 165c4d6ba40dbe847a58971c49637b9911458fd3 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sun, 24 Nov 2024 15:57:42 -0800 Subject: [PATCH 3/5] Add suse to installation CI --- .github/workflows/install.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index ff0e93181..0c0b398c3 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -73,6 +73,11 @@ jobs: os: ubuntu-latest image: almalinux:9 imageFamily: redhat + # SUSE Installations + - name: opensuse-15.6 + os: ubuntu-latest + image: opensuse/leap:15.6 + imageFamily: suse # User level installation - name: user-install os: ubuntu-latest @@ -107,6 +112,8 @@ jobs: elif [ ${{ matrix.imageFamily }} == "redhat" ]; then dnf install -y sudo git dnf install curl -y --allowerasing || true + elif [ ${{ matrix.imageFamily }} == "suse" ]; then + zypper install -y sudo git fi # Only clone submodules needed for standard tests/regression to save space - uses: actions/checkout@v4 From 0c338c590ad0bc4b735859a93bd6f26b3d831656 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sun, 24 Nov 2024 19:35:04 -0800 Subject: [PATCH 4/5] Buildroot fails with gcc14 --- bin/wally-package-install.sh | 2 +- bin/wally-tool-chain-install.sh | 6 +++--- site-setup.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/wally-package-install.sh b/bin/wally-package-install.sh index 836a5625f..de8c0ebc1 100755 --- a/bin/wally-package-install.sh +++ b/bin/wally-package-install.sh @@ -107,7 +107,7 @@ case "$FAMILY" in SPIKE_PACKAGES+=(dtc libboost_regex1_75_0-devel libboost_system1_75_0-devel) VERILATOR_PACKAGES+=(gperftools perl-doc) BUILDROOT_PACKAGES+=(ncurses-utils ncurses-devel ncurses5-devel gcc-fortran) # gcc-fortran is only needed for compiling spec benchmarks on buildroot linux - OTHER_PACKAGES+=(gcc14 gcc14-c++ cpp14) # Newer version of gcc needed for many tools. Default is gcc7 + OTHER_PACKAGES+=(gcc13 gcc13-c++ cpp13) # Newer version of gcc needed for many tools. Default is gcc7 ;; esac diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 77895261c..35578d008 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -192,11 +192,11 @@ fi if [ "$FAMILY" == rhel ]; then source /opt/rh/gcc-toolset-13/enable elif [ "$FAMILY" == suse ]; then - mkdir -p "$RISCV"/gcc-14/bin + mkdir -p "$RISCV"/gcc-13/bin for f in gcc cpp g++ gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool lto-dump; do - ln -vsf /usr/bin/$f-14 "$RISCV"/gcc-14/bin/$f + ln -vsf /usr/bin/$f-13 "$RISCV"/gcc-13/bin/$f done - export PATH="$RISCV"/gcc-14/bin:$PATH + export PATH="$RISCV"/gcc-13/bin:$PATH elif (( UBUNTU_VERSION == 20 )); then mkdir -p "$RISCV"/gcc-10/bin for f in gcc cpp g++ gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool lto-dump; do diff --git a/site-setup.sh b/site-setup.sh index 8df82503a..4699ff348 100755 --- a/site-setup.sh +++ b/site-setup.sh @@ -77,8 +77,8 @@ fi # Use newer gcc version for older distros if [ -e /opt/rh/gcc-toolset-13/enable ]; then source /opt/rh/gcc-toolset-13/enable # Red Hat Family -elif [ -e $RISCV/gcc-14 ]; then - export PATH=$RISCV/gcc-14/bin:$PATH # SUSE Family +elif [ -e $RISCV/gcc-13 ]; then + export PATH=$RISCV/gcc-13/bin:$PATH # SUSE Family elif [ -e $RISCV/gcc-10 ]; then export PATH=$RISCV/gcc-10/bin:$PATH # Ubuntu 20.04 LTS fi From 23364617cd2c356d824ebd1205c5fec3f197a979 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Mon, 25 Nov 2024 21:17:04 -0800 Subject: [PATCH 5/5] Add SUSE to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e26454b1a..70d74eb52 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Then fork and clone the repo, source setup, make the tests and run regression > This section describes the open source toolchain installation. ### Compatibility -The current version of the toolchain has been tested on Ubuntu (versions 20.04 LTS, 22.04 LTS, and 24.04 LTS), Debian (versions 11 and 12), and Red Hat/Rocky/AlmaLinux (versions 8 and 9). Only the latest minor release of each major version is tested. +The current version of the toolchain has been tested on Ubuntu (versions 20.04 LTS, 22.04 LTS, and 24.04 LTS), Debian (versions 11 and 12), Red Hat/Rocky/AlmaLinux (versions 8 and 9), and OpenSUSE (version 15.6). Only the latest minor release of each major version is tested. > [!WARNING] > - Ubuntu 22.04LTS is incompatible with Synopsys Design Compiler.