-
Notifications
You must be signed in to change notification settings - Fork 0
/
13.0.miopen.deps.sh
executable file
·134 lines (115 loc) · 3.9 KB
/
13.0.miopen.deps.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/common.sh
source $HOME/softwares/init/bash
module load rocm/$ROCM_VERSION
# Sqlite3
git clone https://github.com/sqlite/sqlite -b release --depth 1 $MIOPEN_TMP_DIR/sqlite
pushd $MIOPEN_TMP_DIR/sqlite
rm -rf build
mkdir build && cd build
../configure --prefix=$ROCM_INSTALL_PREFIX
make -j64
make install
popd
# Conda
if [ ! -d $CONDA_PATH ]; then
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/tmp/miniconda.sh
chmod +x $HOME/tmp/miniconda.sh
$HOME/tmp/miniconda.sh -b
fi
eval "$($CONDA_PATH/bin/conda shell.bash hook)"
if ! conda env list | grep -q $CONDA_ENV; then
conda create -y -n $CONDA_ENV python=$CONDA_PYTHON_VERSION
fi
# Boost
wget https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz -O $MIOPEN_TMP_DIR/boost.tar.gz
tar -zxvf $MIOPEN_TMP_DIR/boost.tar.gz -C $MIOPEN_TMP_DIR
pushd $MIOPEN_TMP_DIR/boost_*
rm -rf build stage
./bootstrap.sh --without-libraries="mpi" \
--with-python=$CONDA_PATH/envs/$CONDA_ENV/bin/python3
./b2 install cxxflags=-fPIC cflags=-fPIC --prefix=$ROCM_INSTALL_PREFIX --build-dir=./build -q --without-mpi --link=shared
popd
# Half
git clone --depth 1 -b rocm-$ROCM_VERSION https://github.com/ROCm/half $MIOPEN_TMP_DIR/half
pushd $MIOPEN_TMP_DIR/half
pwd
rm -rf build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$ROCM_INSTALL_PREFIX
cmake --build build
cmake --build build -t install
popd
# rocMLIR
git clone --depth 1 -b rocm-$ROCM_VERSION https://github.com/ROCm/rocMLIR $MIOPEN_TMP_DIR/rocmlir
pushd $MIOPEN_TMP_DIR/rocmlir
rm -rf build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_FAT_LIBROCKCOMPILER=1 \
-DCMAKE_C_COMPILER=$ROCM_INSTALL_PREFIX/bin/clang \
-DCMAKE_CXX_COMPILER=$ROCM_INSTALL_PREFIX/bin/clang++ \
-DCMAKE_INSTALL_PREFIX=$ROCM_INSTALL_PREFIX
cmake --build build
cmake --build build -t install
popd
# Json
git clone --depth 1 -b v3.9.1 https://github.com/nlohmann/json $MIOPEN_TMP_DIR/json
pushd $MIOPEN_TMP_DIR/json
rm -rf build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DJSON_MultipleHeaders=ON \
-DJSON_BuildTests=OFF \
-DCMAKE_INSTALL_PREFIX=$ROCM_INSTALL_PREFIX
cmake --build build
cmake --build build -t install
popd
git clone --depth 1 -b v0.2.18-p0 https://github.com/ROCm/FunctionalPlus $MIOPEN_TMP_DIR/FunctionalPlus
pushd $MIOPEN_TMP_DIR/FunctionalPlus
rm -rf build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$ROCM_INSTALL_PREFIX
cmake --build build
cmake --build build -t install
popd
# Eigen
git clone --depth 1 -b 3.4.0 https://github.com/ROCm/eigen $MIOPEN_TMP_DIR/eigen
pushd $MIOPEN_TMP_DIR/eigen
rm -rf build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$ROCM_INSTALL_PREFIX
cmake --build build
cmake --build build -t install
popd
git clone --depth 1 -b master https://github.com/ROCm/frugally-deep $MIOPEN_TMP_DIR/frugally-deep
pushd $MIOPEN_TMP_DIR/frugally-deep
rm -rf build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$ROCM_INSTALL_PREFIX
cmake --build build
cmake --build build -t install
popd
# CK, JIT option: https://github.com/ROCm/composable_kernel/issues/782, on branch migx_merge
git clone --depth 1 -b rocm-$ROCM_VERSION https://github.com/ROCm/composable_kernel $MIOPEN_TMP_DIR/ck
pushd $MIOPEN_TMP_DIR/ck
# git fetch remote migx_merge:migx_merge --depth 1
# git merge migx_merge --allow-unrelated-histories -Xtheirs --no-edit
rm -rf build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$ROCM_INSTALL_PREFIX \
-DCMAKE_CXX_COMPILER=$ROCM_INSTALL_PREFIX/bin/hipcc \
-DINSTANCES_ONLY=ON \
-DGPU_TARGETS=$ROCM_GPU_ARCH \
-DCMAKE_INSTALL_PREFIX=$ROCM_INSTALL_PREFIX
# -DCK_BUILD_JIT_LIB=ON
cmake --build build
cmake --build build -t install
popd
module purge