forked from ROCm/rocFFT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
117 lines (98 loc) · 3.28 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
#!/usr/bin/env groovy
// Generated from snippet generator 'properties; set job properties'
// Keep only the most recent XX builds
properties([buildDiscarder(logRotator(
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '',
daysToKeepStr: '',
numToKeepStr: '10')),
disableConcurrentBuilds(),
[$class: 'CopyArtifactPermissionProperty', projectNames: '*']
])
// def email_list = emailextrecipients([ [$class: 'CulpritsRecipientProvider'] ])
////////////////////////////////////////////////////////////////////////
// This encapsulates the cmake configure and build commands
def clang_build( String build_type, String clang_version, String boost_path, String src_path )
{
// create softlinks for clang
sh "sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clang_version} 50 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${clang_version}"
stage("configure clang ${build_type}") {
sh "cmake -DCMAKE_BUILD_TYPE=${build_type} -DBUILD_LIBRARY=ON -DBUILD_CLIENTS=ON -DBUILD_CLIENTS_SAMPLES=ON -DBUILD_CLIENTS_TESTS=ON -DBUILD_CLIENTS_RIDER=ON -DHIP_ROOT=/opt/rocm/hip -DBOOST_ROOT=${boost_path} -DFFTW_ROOT=/usr/lib ${src_path}"
}
stage("Build") {
sh "make -j\$(nproc)"
}
return void
}
////////////////////////////////////////////////////////////////////////
// This encapsulates running of unit tests
def run_tests( )
{
stage("unit tests") {
sh '''
cd clients-build/tests-build/staging
./rocfft-test-correctness --gtest_filter=*single* --gtest_output=xml
'''
junit 'clients-build/tests-build/staging/*.xml'
}
stage("rider") {
sh '''
cd clients-build/rider-build/staging
./rocfft-rider -x 16
./rocfft-rider -x 256
./rocfft-rider -x 1024
'''
}
// stage("samples") {
// sh '''
// cd clients-build/samples-build/fixed-16
// ./fixed-16
// '''
// }
return void
}
def rocfft_build_pipeline( String build_type, String clang_version, String boost_path )
{
String scm_dir = pwd()
String build_dir_debug = "${scm_dir}/../build/debug"
String build_dir_release = "${scm_dir}/../build/release"
try
{
dir("${scm_dir}") {
stage("Clone") {
checkout scm
}
}
dir("${build_dir_release}")
{
clang_build( "${build_type}", "${clang_version}", "${boost_path}", "${scm_dir}" )
stage("Package Debian")
{
sh 'cd library-build; make package'
archiveArtifacts artifacts: 'library-build/*.deb', fingerprint: true
archiveArtifacts artifacts: 'library-build/*.rpm', fingerprint: true
sh "sudo dpkg -c library-build/*.deb"
}
run_tests( )
}
}
catch( err )
{
currentBuild.result = 'FAILURE'
mail to: "${email_list}",
subject: "${env.JOB_NAME} finished with ${currentBuild.result}",
body: "Node: ${env.NODE_NAME}\nSee ${env.BUILD_URL}\n\n" + err.toString()
throw err
}
return void
}
node('rocm-1.6 && gfx803')
{
rocfft_build_pipeline( "Release", "3.8", "/opt/boost/clang-3.8" )
}
////////////////////////////////////////////////////////////////////////
// node('rocm-1.4 && gfx803')
// {
// rocfft_build_pipeline( "Release", "3.5", "/opt/boost" )
// }