forked from taichi-dev/taichi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
119 lines (118 loc) · 3.82 KB
/
Jenkinsfile
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
pipeline {
agent any
environment {
PYPI_PWD = credentials("${PYPI_PWD}")
PATH = "/opt/taichi-llvm-10.0.0/bin:/usr/local/cuda/bin/:$PATH"
CC = "clang-10"
CXX = "clang++-10"
PYTHON_EXECUTABLE = "python3"
// Local machine uses version 11.2. However, we need to define
// TI_CUDAVERSION, which eventually translates to the version number
// of the slimmed CUDA libdevice bytecode. Currently this slimmed
// version only covers 10. See:
// https://github.com/taichi-dev/taichi/tree/master/external/cuda_libdevice
// so we pass hack version to avoid build errors.
HACK_CUDA_VERSION = "10.0"
}
stages{
stage('Build and Test') {
parallel {
stage('python3.6') {
agent {
node {
label "python36"
customWorkspace "taichi_py36"
}
}
environment {
CONDA_ENV = "py36"
}
steps{
build_taichi()
}
}
stage('python3.7') {
agent {
node {
label "python37"
customWorkspace "taichi_py37"
}
}
environment {
CONDA_ENV = "py37"
}
steps{
build_taichi()
}
}
stage('python3.8') {
agent {
node {
label "python38"
customWorkspace "taichi_py38"
}
}
environment {
CONDA_ENV = "py38"
}
steps{
build_taichi()
}
}
stage('python3.9') {
agent {
node {
label "python39"
customWorkspace "taichi_py39"
}
}
environment {
CONDA_ENV = "py39"
}
steps{
build_taichi()
}
}
}
}
}
}
void build_taichi() {
sh "echo building"
sh "echo $PATH"
git 'https://github.com/taichi-dev/taichi.git'
sh label: '', script: '''
echo $PATH
echo $CC
echo $CXX
$CC --version
$CXX --version
echo $WORKSPACE
. "/home/buildbot/miniconda3/etc/profile.d/conda.sh"
conda activate $CONDA_ENV
$PYTHON_EXECUTABLE -m pip install --user setuptools astor pybind11 pylint sourceinspect
$PYTHON_EXECUTABLE -m pip install --user pytest pytest-rerunfailures pytest-xdist yapf
$PYTHON_EXECUTABLE -m pip install --user numpy GitPython coverage colorama autograd
export TAICHI_REPO_DIR=$WORKSPACE
echo $TAICHI_REPO_DIR
export PYTHONPATH=$TAICHI_REPO_DIR/python
export PATH=$WORKSPACE/bin/:$PATH
nvidia-smi
cd $TAICHI_REPO_DIR
git submodule update --init --recursive
[ -e build ] && rm -rf build
mkdir build
cd build
cmake .. -DLLVM_DIR=/opt/taichi-llvm-10.0.0/lib/cmake/llvm \
-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
-DCUDA_VERSION=$HACK_CUDA_VERSION \
-DTI_WITH_OPENGL=ON \
-DLLVM_ENABLE_TERMINFO=OFF
make -j 8
ldd libtaichi_core.so
objdump -T libtaichi_core.so| grep GLIBC
cd ../python
ti test -t 2
$PYTHON_EXECUTABLE build.py upload ${TEST_OPTION}
'''
}