Skip to content

Commit

Permalink
Merge pull request #1009 from jordancarlin/pip_fix
Browse files Browse the repository at this point in the history
Fix Installation
  • Loading branch information
rosethompson authored Oct 14, 2024
2 parents e7b9369 + b8d50fd commit edd7e73
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
6 changes: 3 additions & 3 deletions bin/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ lief>=0.14.1
Markdown>=3.6
matplotlib>=3.9.0
PyYAML>=5.2
riscv-isac @ git+https://github.com/riscv-non-isa/riscv-arch-test/#subdirectory=riscv-isac
riscof @ git+https://github.com/riscv/riscof.git
riscv-config>=3.18.3
riscv-isac>=0.18.0
riscv-isac @ git+https://github.com/riscv-non-isa/riscv-arch-test/#subdirectory=riscv-isac
scikit-learn>=1.5.0
scipy>=1.13.0
Sphinx>=7.3.7
setuptools
Sphinx~=7.3.7 # QEMU fails to build with Sphinx 8
sphinx-rtd-theme>=2.0.0
testresources>=2.0.1
47 changes: 28 additions & 19 deletions bin/wally-tool-chain-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ trap error ERR # run error handler on error
STATUS="setup" # keep track of what part of the installation is running for error messages

# Check for clean flag
if [ "$1" == "--clean" ]; then
if [ "$1" == "--clean" ] || [ "$2" == "--clean" ]; then
clean=true
shift
fi

# Check for clean flag
if [ "$1" == "--no-buildroot" ] || [ "$2" == "--no-buildroot" ]; then
no_buidroot=true
shift
fi

# Determine script directory to locate related scripts
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

Expand Down Expand Up @@ -171,12 +177,11 @@ source "$RISCV"/riscv-python/bin/activate # activate python virtual environment
# Install python packages, including RISCOF (https://github.com/riscv-software-src/riscof.git)
# RISCOF is a RISC-V compliance test framework that is used to run the RISC-V Arch Tests.
STATUS="python packages"
pip install --upgrade pip && pip install -r "$dir"/requirements.txt
pip install --upgrade pip && pip install --upgrade -r "$dir"/requirements.txt

source "$RISCV"/riscv-python/bin/activate # reload python virtual environment
echo -e "${SUCCESS_COLOR}Python environment successfully configured!${ENDC}"


# Extra dependecies needed for older distros that don't have new enough versions available from package manager
if (( RHEL_VERSION == 8 )) || (( UBUNTU_VERSION == 20 )); then
# Newer versin of glib required for QEMU.
Expand Down Expand Up @@ -392,23 +397,27 @@ fi
# Buildroot and Linux testvectors
# Buildroot is used to boot a minimal versio of Linux on Wally.
# Testvectors are generated using QEMU.
section_header "Installing Buildroot and Creating Linux testvectors"
STATUS="buildroot"
if [ -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH=$RISCV/lib:$RISCV/lib64:$RISCV/riscv64-unknown-elf/lib:$RISCV/lib/x86_64-linux-gnu/
else
export LD_LIBRARY_PATH=$RISCV/lib:$RISCV/lib64:$LD_LIBRARY_PATH:$RISCV/riscv64-unknown-elf/lib:$RISCV/lib/x86_64-linux-gnu/
fi
cd "$dir"/../linux
if [ ! -e "$RISCV"/buildroot ]; then
make 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]
echo -e "${SUCCESS_COLOR}Buildroot successfully installed and Linux testvectors created!${ENDC}"
elif [ ! -e "$RISCV"/linux-testvectors ]; then
echo -e "${OK_COLOR}Buildroot already exists, but Linux testvectors are missing. Generating them now.${ENDC}"
make dumptvs 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]
echo -e "${SUCCESS_COLOR}Linux testvectors successfully generated!${ENDC}"
if [ ! "$no_buidroot" ]; then
section_header "Installing Buildroot and Creating Linux testvectors"
STATUS="buildroot"
if [ -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH=$RISCV/lib:$RISCV/lib64:$RISCV/riscv64-unknown-elf/lib:$RISCV/lib/x86_64-linux-gnu/
else
export LD_LIBRARY_PATH=$RISCV/lib:$RISCV/lib64:$LD_LIBRARY_PATH:$RISCV/riscv64-unknown-elf/lib:$RISCV/lib/x86_64-linux-gnu/
fi
cd "$dir"/../linux
if [ ! -e "$RISCV"/buildroot ]; then
make 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]
echo -e "${SUCCESS_COLOR}Buildroot successfully installed and Linux testvectors created!${ENDC}"
elif [ ! -e "$RISCV"/linux-testvectors ]; then
echo -e "${OK_COLOR}Buildroot already exists, but Linux testvectors are missing. Generating them now.${ENDC}"
make dumptvs 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]
echo -e "${SUCCESS_COLOR}Linux testvectors successfully generated!${ENDC}"
else
echo -e "${OK_COLOR}Buildroot and Linux testvectors already exist.${ENDC}"
fi
else
echo -e "${OK_COLOR}Buildroot and Linux testvectors already exist.${ENDC}"
echo -e "${OK_COLOR}Skipping Buildroot and Linux testvectors.${ENDC}"
fi


Expand Down

0 comments on commit edd7e73

Please sign in to comment.