2019-11-13 19:31:44 +08:00
|
|
|
def clang(arch):
|
|
|
|
return {
|
|
|
|
"kind": "pipeline",
|
|
|
|
"name": "%s-clang" % arch,
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"name": "test",
|
2019-11-18 18:04:54 +08:00
|
|
|
"image": "ubuntu",
|
2019-11-13 19:31:44 +08:00
|
|
|
"commands": [
|
2020-02-25 23:59:50 +08:00
|
|
|
"apt-get update && apt-get install -y clang-8 cmake ninja-build lld-8 llvm-8-dev libc++-8-dev libc++abi-8-dev libz-dev git",
|
2020-03-12 12:47:22 +08:00
|
|
|
"git clone --depth=1 -b f18 https://github.com/flang-compiler/f18-llvm-project.git llvm-project",
|
2020-02-25 23:59:50 +08:00
|
|
|
"mkdir llvm-project/build && cd llvm-project/build",
|
2020-03-12 12:47:22 +08:00
|
|
|
'env CC=clang-8 CXX=clang++-8 CXXFLAGS="-stdlib=libc++" LDFLAGS="-fuse-ld=lld" cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DLLVM_TARGETS_TO_BUILD=host -DLLVM_INSTALL_UTILS=On -DLLVM_ENABLE_PROJECTS="mlir" ../llvm',
|
|
|
|
"ninja install",
|
2020-02-25 23:59:50 +08:00
|
|
|
"cd ../..",
|
2019-11-13 19:31:44 +08:00
|
|
|
"mkdir build && cd build",
|
2020-03-28 00:23:32 +08:00
|
|
|
'env CC=clang-8 CXX=clang++-8 CXXFLAGS="-UNDEBUG -stdlib=libc++" LDFLAGS="-fuse-ld=lld" cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. -DLLVM_DIR=/drone/src/llvm-project/install/lib/cmake/llvm -DMLIR_DIR=/drone/src/llvm-project/install/lib/cmake/mlir -DLLVM_EXTERNAL_LIT=/drone/src/llvm-project/build/bin/llvm-lit',
|
2019-11-18 22:27:34 +08:00
|
|
|
"ninja -j8",
|
2019-11-13 19:31:44 +08:00
|
|
|
"ctest --output-on-failure -j24",
|
2020-02-25 23:59:50 +08:00
|
|
|
"ninja check-all",
|
2019-11-13 19:31:44 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
def gcc(arch):
|
|
|
|
return {
|
|
|
|
"kind": "pipeline",
|
|
|
|
"name": "%s-gcc" % arch,
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"name": "test",
|
2019-11-18 18:04:54 +08:00
|
|
|
"image": "gcc",
|
2019-11-13 19:31:44 +08:00
|
|
|
"commands": [
|
2020-02-25 23:59:50 +08:00
|
|
|
"apt-get update && apt-get install -y cmake ninja-build llvm-dev libz-dev git",
|
2020-03-12 12:47:22 +08:00
|
|
|
"git clone --depth=1 -b f18 https://github.com/flang-compiler/f18-llvm-project.git llvm-project",
|
2020-02-25 23:59:50 +08:00
|
|
|
"mkdir llvm-project/build && cd llvm-project/build",
|
2020-03-12 12:47:22 +08:00
|
|
|
'env CC=gcc CXX=g++ LDFLAGS="-fuse-ld=gold" cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DLLVM_TARGETS_TO_BUILD=host -DLLVM_INSTALL_UTILS=On -DLLVM_ENABLE_PROJECTS="mlir" ../llvm',
|
|
|
|
"ninja install",
|
2020-02-25 23:59:50 +08:00
|
|
|
"cd ../..",
|
2019-11-13 19:31:44 +08:00
|
|
|
"mkdir build && cd build",
|
2020-03-28 00:23:32 +08:00
|
|
|
'env CC=gcc CXX=g++ CXXFLAGS="-UNDEBUG" LDFLAGS="-fuse-ld=gold" cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. -DLLVM_DIR=/drone/src/llvm-project/install/lib/cmake/llvm -DMLIR_DIR=/drone/src/llvm-project/install/lib/cmake/mlir -DLLVM_EXTERNAL_LIT=/drone/src/llvm-project/build/bin/llvm-lit',
|
2019-11-18 22:27:34 +08:00
|
|
|
"ninja -j8",
|
2019-11-13 19:31:44 +08:00
|
|
|
"ctest --output-on-failure -j24",
|
2020-02-25 23:59:50 +08:00
|
|
|
"ninja check-all",
|
2019-11-13 19:31:44 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
def main(ctx):
|
|
|
|
return [
|
|
|
|
clang("amd64"),
|
|
|
|
clang("arm64"),
|
|
|
|
gcc("amd64"),
|
2019-11-18 18:04:54 +08:00
|
|
|
gcc("arm64"),
|
2019-11-13 19:31:44 +08:00
|
|
|
]
|
|
|
|
|