22
33# =========================== begin_copyright_notice ============================
44# 
5- #  Copyright (C) 2022 Intel Corporation
5+ #  Copyright (C) 2022-2025  Intel Corporation
66# 
77#  SPDX-License-Identifier: MIT
88# 
99# ============================ end_copyright_notice =============================
1010
1111set  -e
12- #  UBUNTU_VERSION   supported value [ 20, 22 ]                                                default 20
13- #  LLVM_VERSION     supported value [ 10, 11, 12, 13, 14, 15]                                 default 11
14- #  OWN_CMAKE_FLAGS  not suported but can be use as WA (each flag should be with -D prefix)    default empty
15- #  example run:     UBUNTU_VERSION=ubuntu2004 LLVM_VERSION=11 sh /home/buildSLT.sh
12+ #  UBUNTU_VERSION   supported value [ 22.04, 24.04 ]                                          default 24.04
13+ #  LLVM_VERSION     supported value [ 14, 15, 16 ]                                            default 16
14+ #  example run:     UBUNTU_VERSION=24.04 LLVM_VERSION=16 sh /home/buildSLT.sh
1615
1716echo  " ====================BUILD SPIRV-LLVM-Translator=========================" 
1817echo  " [Build Status] build script started" 
1918if  [ -z  ${UBUNTU_VERSION+x}  ];  then 
20-     echo  " [Build Status] UBUNTU_VERSION is unset, use default 20 " ; 
21-     UBUNTU_VERSION=" 20 .04" 
19+     echo  " [Build Status] UBUNTU_VERSION is unset, use default 24.04 " ; 
20+     UBUNTU_VERSION=" 24 .04" 
2221else 
2322    echo  " [Build Status] UBUNTU_VERSION = ${UBUNTU_VERSION} " 
2423fi 
2524if  [ -z  ${LLVM_VERSION+x}  ];  then 
26-     echo  " [Build Status] LLVM_VERSION is unset, use default 14 " ; 
27-     LLVM_VERSION=" 14 " 
25+     echo  " [Build Status] LLVM_VERSION is unset, use default 16 " ; 
26+     LLVM_VERSION=" 16 " 
2827else 
2928    echo  " [Build Status] LLVM_VERSION = ${LLVM_VERSION} " 
3029fi 
@@ -33,25 +32,12 @@ apt-get update
3332apt-get install -y flex bison libz-dev cmake curl wget build-essential git software-properties-common unzip lsb-release
3433echo  " [Build Status] flex bison libz-dev cmake curl wget build-essential git software-properties-common INSTALLED" 
3534
36- if  [ " $UBUNTU_VERSION " =  " 20.04" ;  then 
37-     echo  " [Build Status] Download new cmake version for Ubuntu 20.04" ; 
38-     apt-get purge -y --auto-remove cmake
39-     wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2> /dev/null |  gpg --dearmor - |  tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null
40-     apt-add-repository " deb https://apt.kitware.com/ubuntu/ $( lsb_release -cs) " 
41-     apt-get update
42-     apt-get install -y cmake
43- fi 
44- 
45- if  ([ " $UBUNTU_VERSION " =  " 20.04" &&  [ " $LLVM_VERSION " -ge  14 ]) ||  ([ " $UBUNTU_VERSION " =  " 22.04" &&  [ " $LLVM_VERSION " -ge  15 ])
35+ if  ([ " $UBUNTU_VERSION " =  " 22.04" &&  [ " $LLVM_VERSION " -ge  16 ])
4636then 
4737    echo  " [Build Status] Retrieve the LLVM archive signature for LLVM $LLVM_VERSION  on Ubuntu $UBUNTU_VERSION " ; 
4838    wget -q https://apt.llvm.org/llvm-snapshot.gpg.key
4939    apt-key add llvm-snapshot.gpg.key
50-     case  " $UBUNTU_VERSION " in 
51-         20.04) OS_HANDLE=focal;;
52-         22.04) OS_HANDLE=jammy;;
53-     esac 
54-     add-apt-repository " deb http://apt.llvm.org/$OS_HANDLE / llvm-toolchain-$OS_HANDLE -$LLVM_VERSION  main" 
40+     add-apt-repository " deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-$LLVM_VERSION  main" 
5541fi 
5642
5743apt-get install -y llvm-" $LLVM_VERSION " " $LLVM_VERSION " " $LLVM_VERSION " " $LLVM_VERSION " " $LLVM_VERSION " 
0 commit comments