Skip to content

Commit

Permalink
update install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
alifahrri committed Nov 12, 2023
1 parent 82f1cab commit 5072ce3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
16 changes: 16 additions & 0 deletions scripts/install_llvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [[ -z "${LLVM_VERSION}" ]]; then
LLVM_VERSION="15"
else
LLVM_VERSION="${LLVM_VERSION}"
echo "set LLVM_VERSION from env: ${LLVM_VERSION}"
fi

apt update && apt install -y lsb-release wget software-properties-common gnupg
if [[ -f "llvm.sh" ]]; then
rm llvm.sh
fi
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${LLVM_VERSION}
12 changes: 10 additions & 2 deletions scripts/install_pocl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ else
echo "set POCL_VERSION from env"
fi

if [[ -z "${POCL_BUILD_TYPE}" ]]; then
POCL_BUILD_TYPE=Release
else
echo "set POCL_BUILD_TYPE from env"
fi

echo "using LLVM_VERSION=${LLVM_VERSION}"

echo "using POCL_VERSION=${POCL_VERSION}"

echo "using POCL_BUILD_TYPE=${POCL_BUILD_TYPE}"

DIR=pocl
if [[ -d "$DIR" ]]; then
echo "$DIR exists. skipping cloning"
Expand All @@ -33,6 +41,6 @@ apt install -y xxd python3-dev libpython3-dev build-essential ocl-icd-libopencl1
llvm-${LLVM_VERSION}-dev --fix-missing

cd ${DIR}
git checkout ${POCL_VERSION}
mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_CUDA=OFF -DSPIRV=ON -DLLVM_SPIRV=/usr/local/bin/llvm-spirv -DCMAKE_INSTALL_PREFIX=/usr .. \
git fetch && git checkout ${POCL_VERSION}
mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=${POCL_BUILD_TYPE} -DENABLE_TESTS=OFF -DENABLE_CUDA=OFF -DSPIRV=ON -DLLVM_SPIRV=/usr/local/bin/llvm-spirv -DCMAKE_INSTALL_PREFIX=/usr .. \
&& make -j2 && make install

0 comments on commit 5072ce3

Please sign in to comment.