Skip to content

Commit

Permalink
intial build directory for ubuntu24
Browse files Browse the repository at this point in the history
  • Loading branch information
gadfort committed Apr 17, 2024
1 parent d23716a commit 9bfb554
Show file tree
Hide file tree
Showing 25 changed files with 692 additions and 0 deletions.
64 changes: 64 additions & 0 deletions setup/ubuntu24/Docker.testbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (C) 2023 Zero ASIC

FROM ubuntu:24.04

LABEL org.opencontainers.image.source "https://github.com/siliconcompiler/siliconcompiler"
LABEL org.opencontainers.image.description "Base tool builder image for SiliconCompiler tools"

ARG DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

# Ensure we only install the required tools to keep images small
RUN echo "APT::Install-Recommends \"false\";" >> /etc/apt/apt.conf
RUN echo "APT::Install-Suggests \"false\";" >> /etc/apt/apt.conf

# Since scripts are written to run locally,
# we need to install sudo
RUN apt-get update
RUN TZ=Etc/UTC apt-get install -y tzdata && \
apt-get clean
RUN apt-get install -y sudo \
curl wget \
build-essential \
software-properties-common \
git \
python3 python3-pip python3-dev python3-venv && \
apt-get clean

# Ensure PREFIX is captured by sudo for "sudo make install"
RUN echo "Defaults env_keep += \"PREFIX\"" >> /etc/sudoers

# Setup build environment
ARG SC_PREFIX=/sc_tools
ARG SC_BUILD=/sc_build

RUN mkdir -p $SC_PREFIX
RUN mkdir -p $SC_BUILD

# Setup build environment
ENV SC_PREFIX=$SC_PREFIX
ENV SC_BUILD=$SC_BUILD
ENV PREFIX=$SC_PREFIX
ENV PATH="$SC_PREFIX/bin:$PATH"
ENV LD_LIBRARY_PATH="$SC_PREFIX/lib:$SC_PREFIX/lib64"
ENV C_INCLUDE_PATH="$SC_PREFIX/include"
ENV CPLUS_INCLUDE_PATH="$SC_PREFIX/include"

# Copy in support files
COPY _tools.py $SC_BUILD
COPY _tools.json $SC_BUILD

ARG SC_INSTALL_SCRIPT
# Copy and run install script
# The final remove in the same RUN command
# is important to keep the docker image size low
COPY ubuntu24/${SC_INSTALL_SCRIPT} $SC_BUILD
WORKDIR $SC_BUILD
RUN apt-get update && \
chmod +x ./${SC_INSTALL_SCRIPT} && \
./${SC_INSTALL_SCRIPT} && \
rm -rf $SC_BUILD/deps && \
apt-get clean

# Generate list of installed programs
RUN apt list --installed | grep "\[installed\]" | sed 's/\/.*//' > $SC_PREFIX/apt.txt
1 change: 1 addition & 0 deletions setup/ubuntu24/_tools.json
1 change: 1 addition & 0 deletions setup/ubuntu24/_tools.py
26 changes: 26 additions & 0 deletions setup/ubuntu24/all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

set -e
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-openfpga.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-bambu.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-sv2v.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-yosys.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-netgen.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-chisel.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-montage.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-klayout.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-vpr.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-bluespec.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-magic.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-verible.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-xyce.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-slurm.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-verilator.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-ghdl.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-surelog.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-icepack.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-icarus.sh"
docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-openroad.sh"

# Skip due to yosys dependency
#docker build .. --file Docker.testbuild --build-arg="SC_INSTALL_SCRIPT=install-nextpnr.sh"
48 changes: 48 additions & 0 deletions setup/ubuntu24/install-bambu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

sudo apt-get install -y autoconf autoconf-archive automake libtool \
libbdd-dev libboost-all-dev libmpc-dev libmpfr-dev \
libxml2-dev liblzma-dev libmpfi-dev zlib1g-dev libicu-dev bison doxygen flex \
graphviz iverilog verilator make libsuitesparse-dev libglpk-dev libgmp-dev \
libfl-dev
sudo apt-get install -y \
gcc-11 gcc-11-multilib g++-11 g++-11-multilib \
llvm-11 llvm-11-dev libllvm11 \
gfortran-10 gfortran-10-multilib \
clang-11 libclang-11-dev

mkdir -p deps
cd deps

git clone $(python3 ${src_path}/_tools.py --tool bambu --field git-url) bambu
cd bambu
git checkout $(python3 ${src_path}/_tools.py --tool bambu --field git-commit)

if [ ! -z ${PREFIX} ]; then
args=--prefix="$PREFIX"
else
args=--prefix=/opt/panda

sudo mkdir -p /opt/panda
sudo chown $USER:$USER /opt/panda
fi

make -f Makefile.init

mkdir obj
cd obj

../configure --enable-release --disable-flopoco --with-opt-level=2 $args
make -j$(nproc)
make install

cd -

if [ -z ${PREFIX} ]; then
echo "Please add \"export PATH="/opt/panda/bin:\$PATH"\" to your .bashrc"
fi
35 changes: 35 additions & 0 deletions setup/ubuntu24/install-bluespec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

sudo apt-get install -y ghc libghc-regex-compat-dev libghc-syb-dev \
libghc-old-time-dev libghc-split-dev tcl-dev build-essential pkg-config \
autoconf gperf flex bison

mkdir -p deps
cd deps

git clone $(python3 ${src_path}/_tools.py --tool bluespec --field git-url) bluespec
cd bluespec
git checkout $(python3 ${src_path}/_tools.py --tool bluespec --field git-commit)
git submodule update --init --recursive

make -j$(nproc) install-src

if [ -z ${PREFIX} ]; then
# install
sudo mkdir -p /opt/tools/bsc
sudo chown $USER:$USER /opt/tools/bsc

BSC_VERSION=$(echo 'puts [lindex [Bluetcl::version] 0]' | inst/bin/bluetcl)
mv inst /opt/tools/bsc/bsc-${BSC_VERSION}
ln -s /opt/tools/bsc/bsc-${BSC_VERSION} /opt/tools/bsc/latest

echo "Please add \"export PATH=/opt/tools/bsc/latest/bin:\$PATH to your .bashrc"
fi

cd -

26 changes: 26 additions & 0 deletions setup/ubuntu24/install-chisel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

mkdir -p deps
cd deps

version=$(python3 ${src_path}/_tools.py --tool chisel --field version)

wget -O sbt.tgz https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz

args=
if [ ! -z ${PREFIX} ]; then
args="-C $PREFIX --strip-components 1"
fi

tar xvf sbt.tgz $args

cd -

if [ -z ${PREFIX} ]; then
echo "Please add \"export PATH="${src_path}/deps/sbt/bin:\$PATH"\" to your .bashrc"
fi
25 changes: 25 additions & 0 deletions setup/ubuntu24/install-ghdl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

sudo apt-get install -y gnat libgnat-9 libz-dev

mkdir -p deps
cd deps

git clone $(python3 ${src_path}/_tools.py --tool ghdl --field git-url) ghdl
cd ghdl
git checkout $(python3 ${src_path}/_tools.py --tool ghdl --field git-commit)

args=
if [ ! -z ${PREFIX} ]; then
args=--prefix="$PREFIX"
fi

./configure $args
make -j$(nproc)
sudo make install
cd -
25 changes: 25 additions & 0 deletions setup/ubuntu24/install-icarus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

sudo apt-get install -y build-essential bison flex gperf libreadline-dev libncurses-dev

mkdir -p deps
cd deps

git clone $(python3 ${src_path}/_tools.py --tool icarus --field git-url) icarus
cd icarus
git checkout $(python3 ${src_path}/_tools.py --tool icarus --field git-commit)

args=
if [ ! -z ${PREFIX} ]; then
args=--prefix="$PREFIX"
fi

sh autoconf.sh
./configure $args
make -j$(nproc)
sudo make install
22 changes: 22 additions & 0 deletions setup/ubuntu24/install-icepack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

sudo apt-get install -y build-essential clang bison flex libreadline-dev \
gawk tcl-dev libffi-dev git mercurial graphviz \
xdot pkg-config python3 libftdi-dev \
qtbase5-dev python3-dev libboost-all-dev cmake libeigen3-dev

mkdir -p deps
cd deps

git clone $(python3 ${src_path}/_tools.py --tool icepack --field git-url) icepack
cd icepack
git checkout $(python3 ${src_path}/_tools.py --tool icepack --field git-commit)

make -j$(nproc)
sudo make install
cd -
29 changes: 29 additions & 0 deletions setup/ubuntu24/install-klayout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

mkdir -p deps
cd deps

pkg_version=$(python3 ${src_path}/_tools.py --tool klayout --field version)
version=$(lsb_release -sr)

if [ "$version" = "18.04" ]; then
url="https://www.klayout.org/downloads/Ubuntu-18/klayout_${pkg_version}-1_amd64.deb"
elif [ "$version" = "20.04" ]; then
url="https://www.klayout.org/downloads/Ubuntu-20/klayout_${pkg_version}-1_amd64.deb"
elif [ "$version" = "22.04" ]; then
url="https://www.klayout.org/downloads/Ubuntu-22/klayout_${pkg_version}-1_amd64.deb"
else
echo "Script doesn't support Ubuntu version $version."
fi

# Fetch package
wget -O klayout.deb $url
# Install package
sudo apt-get install -y ./klayout.deb

cd -
24 changes: 24 additions & 0 deletions setup/ubuntu24/install-magic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

sudo apt-get install -y build-essential m4 tcsh csh libx11-dev tcl-dev tk-dev

mkdir -p deps
cd deps

git clone $(python3 ${src_path}/_tools.py --tool magic --field git-url) magic
cd magic
git checkout $(python3 ${src_path}/_tools.py --tool magic --field git-commit)

args=
if [ ! -z ${PREFIX} ]; then
args=--prefix="$PREFIX"
fi

LD_FLAGS=-shared ./configure $args
make -j$(nproc)
sudo make install
5 changes: 5 additions & 0 deletions setup/ubuntu24/install-montage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

sudo apt-get install -y imagemagick
24 changes: 24 additions & 0 deletions setup/ubuntu24/install-netgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -e

# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)

sudo apt-get install -y build-essential tcl-dev tk-dev

mkdir -p deps
cd deps

git clone $(python3 ${src_path}/_tools.py --tool netgen --field git-url) netgen
cd netgen
git checkout $(python3 ${src_path}/_tools.py --tool netgen --field git-commit)

args=
if [ ! -z ${PREFIX} ]; then
args=--prefix="$PREFIX"
fi

./configure $args
make -j$(nproc)
sudo make install
Loading

0 comments on commit 9bfb554

Please sign in to comment.