2022-02-27 09:27:49 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-03-19 23:36:21 -04:00
|
|
|
# Copyright (C) 2020-2022 F4PGA Authors.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2022-02-27 09:27:49 -05:00
|
|
|
|
2022-07-27 17:17:16 -04:00
|
|
|
set -e
|
|
|
|
|
2022-08-02 16:37:34 -04:00
|
|
|
|
2022-02-27 09:27:49 -05:00
|
|
|
echo '::group::Install dependencies'
|
2022-08-02 16:37:34 -04:00
|
|
|
|
2022-02-27 09:27:49 -05:00
|
|
|
sudo apt update -y
|
|
|
|
sudo apt install -y git wget xz-utils
|
2022-08-02 16:37:34 -04:00
|
|
|
|
|
|
|
echo '::endgroup::'
|
|
|
|
|
|
|
|
|
|
|
|
echo '::group::Environment variables'
|
|
|
|
|
2022-08-03 22:06:22 -04:00
|
|
|
FPGA_FAM="${FPGA_FAM:=xc7}"
|
|
|
|
F4PGA_INSTALL_DIR="${F4PGA_INSTALL_DIR:=/opt/f4pga}"
|
|
|
|
F4PGA_INSTALL_DIR_FAM="${F4PGA_INSTALL_DIR}/${FPGA_FAM}"
|
|
|
|
|
|
|
|
echo "FPGA_FAM: $FPGA_FAM"
|
|
|
|
echo "F4PGA_INSTALL_DIR: $F4PGA_INSTALL_DIR"
|
|
|
|
echo "F4PGA_INSTALL_DIR_FAM: $F4PGA_INSTALL_DIR_FAM"
|
2022-08-02 16:37:34 -04:00
|
|
|
|
2022-02-27 09:27:49 -05:00
|
|
|
echo '::endgroup::'
|
|
|
|
|
|
|
|
|
|
|
|
echo '::group::Install Miniconda3'
|
2022-08-02 16:37:34 -04:00
|
|
|
|
2022-02-27 09:27:49 -05:00
|
|
|
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
|
|
|
|
|
2022-08-03 22:02:29 -04:00
|
|
|
bash conda_installer.sh -u -b -p "${F4PGA_INSTALL_DIR_FAM}"/conda
|
|
|
|
source "${F4PGA_INSTALL_DIR_FAM}"/conda/etc/profile.d/conda.sh
|
2022-02-27 09:27:49 -05:00
|
|
|
|
|
|
|
echo '::endgroup::'
|
|
|
|
|
|
|
|
|
|
|
|
echo '::group::Install arch-defs'
|
2022-08-02 16:37:34 -04:00
|
|
|
|
2022-08-03 22:02:29 -04:00
|
|
|
mkdir -p "$F4PGA_INSTALL_DIR_FAM"
|
2022-08-02 16:37:34 -04:00
|
|
|
|
2022-08-03 21:26:01 -04:00
|
|
|
F4PGA_TIMESTAMP='20220803-160711'
|
|
|
|
F4PGA_HASH='df6d9e5'
|
2022-08-02 16:37:34 -04:00
|
|
|
|
2022-06-08 05:04:27 -04:00
|
|
|
case "$FPGA_FAM" in
|
2022-08-02 16:37:34 -04:00
|
|
|
xc7) PACKAGES='install-xc7 xc7a50t_test';;
|
|
|
|
eos-s3) PACKAGES='install-ql ql-eos-s3_wlcsp';;
|
|
|
|
*)
|
|
|
|
echo "Unknowd FPGA_FAM <${FPGA_FAM}>!"
|
|
|
|
exit 1
|
2022-02-27 09:27:49 -05:00
|
|
|
esac
|
2022-03-19 21:28:04 -04:00
|
|
|
|
2022-08-02 16:37:34 -04:00
|
|
|
for PKG in $PACKAGES; do
|
|
|
|
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/${F4PGA_TIMESTAMP}/symbiflow-arch-defs-${PKG}-${F4PGA_HASH}.tar.xz \
|
2022-08-03 22:02:29 -04:00
|
|
|
| tar -xJC $F4PGA_INSTALL_DIR_FAM
|
2022-08-02 16:37:34 -04:00
|
|
|
done
|
2022-03-19 21:28:04 -04:00
|
|
|
|
2022-08-02 15:35:36 -04:00
|
|
|
echo '::endgroup::'
|
|
|
|
|
|
|
|
|
2022-08-02 16:37:34 -04:00
|
|
|
echo '::group::Create environment'
|
2022-07-28 05:56:41 -04:00
|
|
|
|
2022-08-03 22:02:29 -04:00
|
|
|
conda env create -f $F4PGA_INSTALL_DIR_FAM/"$FPGA_FAM"_env/"$FPGA_FAM"_environment.yml
|
2022-07-28 05:56:41 -04:00
|
|
|
|
2022-03-19 21:34:36 -04:00
|
|
|
echo '::endgroup::'
|