diff --git a/env.vortex-prebuilt.sh b/env.vortex-prebuilt.sh index 667f8db8..5ffa41ca 100644 --- a/env.vortex-prebuilt.sh +++ b/env.vortex-prebuilt.sh @@ -1,4 +1,23 @@ -BUILDDIR=$HOME/build +if [ $# -lt 1 ] +then + echo "Usage: source env.vortex-prebuilt.sh build-dir" + return +fi + +if [ -n "$VORTEX_ENV" ] +then + echo "VORTEX_ENV already set. Exiting." + return +fi + +BUILDDIR=$1 + +if ! [ -d "$BUILDDIR/vortex-toolchain-prebuilt" ] +then + echo "error: $BUILDDIR/vortex-toolchain-prebuilt does not exist." + return 1 +fi + export VORTEX_ENV="vortex-prebuilt" export LLVM_PREFIX=$BUILDDIR/vortex-toolchain-prebuilt/llvm-riscv/ export POCL_CC_PATH=$BUILDDIR/vortex-toolchain-prebuilt/pocl/compiler