You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
935 B
26 lines
935 B
#!/bin/bash
|
|
set -e
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
mkdir build
|
|
cd build
|
|
mkdir install
|
|
CXXFLAGS="-Wnon-virtual-dtor" CFLAGS="-Werror -Wignored-qualifiers -Wunused-function -Wunused-parameter -Wunused-variable" $DIR/../configure --prefix=`pwd`/install
|
|
make -j4
|
|
make install
|
|
|
|
# check that help message prints without error
|
|
install/bin/spike -h
|
|
|
|
|
|
# run a program and check for correct output
|
|
mkdir run
|
|
cd run
|
|
wget https://github.com/riscv-software-src/riscv-isa-sim/releases/download/dummy-tag-for-ci-storage/spike-ci.tar
|
|
tar xf spike-ci.tar
|
|
time ../install/bin/spike --isa=rv64gc pk hello | grep "Hello, world! Pi is approximately 3.141588."
|
|
|
|
# check that including sim.h in an external project works
|
|
g++ -std=c++17 -I../install/include -L../install/lib $DIR/testlib.c -lriscv -o test-libriscv
|
|
LD_LIBRARY_PATH=../install/lib ./test-libriscv | grep "Hello, world! Pi is approximately 3.141588."
|
|
|