forked from triton-lang/triton-cpu
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprepare.sh
executable file
·46 lines (40 loc) · 1.45 KB
/
prepare.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# saving path
HERE=$PWD
echo "===================================== Configuring Checkout"
git submodule init
git submodule update
echo "===================================== Setting Up Conda Env"
export CONDA_INSTALL_DIR=$HERE/../miniforge
export ENV_NAME=triton
if [ ! -d $CONDA_INSTALL_DIR ]; then
pushd ./../
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-$(uname -m).sh"
bash ./Miniforge3-Linux-$(uname -m).sh -b -p ${CONDA_INSTALL_DIR}
${CONDA_INSTALL_DIR}/bin/conda create -y -n ${ENV_NAME} python=3.9
source ${CONDA_INSTALL_DIR}/bin/activate ${ENV_NAME}
echo "===================================== Install Dependencies"
pip install ninja cmake wheel pybind11 scipy numpy torch pytest lit pandas matplotlib
if [ $? != 0 ]; then
exit 1
fi
popd
conda deactivate
else
echo "Miniconda already installed, skipping."
fi
echo "===================================== Building LLVM"
if [ ! -d $HERE/../llvm-project ]; then
pushd ./../
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout `cat ${HERE}/cmake/llvm-hash.txt`
mkdir -p build
pushd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=True -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_USE_LINKER=lld -DLLVM_ENABLE_PROJECTS="mlir;llvm" -DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU" ../llvm
ninja
popd
popd
else
echo "LLVM already built, skipping."
fi