[BUG] Error in `verif/regress/install-spike.sh`
Created by: Siris-Li
Is there an existing CVA6 bug for this?
-
I have searched the existing bug issues
Bug Description
Hello! I've found two bugs in the first run of bash verif/regress/smoke-tests.sh
to install spike.
To install spike, verif/regress/smoke-tests.sh
will call verif/regress/install-spike.sh
.
- Here is the code segment of
verif/regress/install-spike.sh
in line17-28:
# Set the location of Spike source code.
# Use the in-tree vendorized Spike if SPIKE_SRC_DIR is not set
# or when a fully local installation was requested.
if [ -z "$SPIKE_SRC_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
SPIKE_SRC_DIR=$ROOT_PROJECT/verif/core-v-verif/vendor/riscv/riscv-isa-sim
fi
# Expect/perform Spike installation in directory $SPIKE_INSTALL_DIR.
# which defaults to $ROOT_PROJECT/tools/spike.
if [ -n "$SPIKE_INSTALL_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
SPIKE_INSTALL_DIR="$ROOT_PROJECT/tools/spike"
fi
When SPIKE_INSTALL_DIR is empty, `if [ -n "SPIKE_INSTALL_DIR" -o "$SPIKE_INSTALL_DIR" = "local" ]will return False, thus not setting the envirnoment variable SPIKE_INSTALL_DIR. We should change
-nto
-z` like setting SPIKE_SRC_DIR.
- Here is another code segment of
verif/regress/install-spike.sh
in line 41-50:
# Build and install Spike (including extensions).
mkdir -p build
cd build
if [[ ! -f config.log ]]; then
../configure --prefix="$SPIKE_INSTALL_DIR"
fi
make -j${NUM_JOBS}
echo "Installing Spike in '$SPIKE_INSTALL_DIR'..."
make install
cd $CALLER_DIR
Here, I think we should add sudo
before make install
, that is sudo make install
just as the README recommended in spike original repository, otherwise there may exists some permission denied
error.