]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/build_tools/update_dependencies.sh
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / build_tools / update_dependencies.sh
1 #!/bin/sh
2 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3 #
4 # Update dependencies.sh file with the latest avaliable versions
5
6 BASEDIR=$(dirname $0)
7 OUTPUT=""
8
9 function log_header()
10 {
11 echo "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved." >> "$OUTPUT"
12 echo "# The file is generated using update_dependencies.sh." >> "$OUTPUT"
13 }
14
15
16 function log_variable()
17 {
18 echo "$1=${!1}" >> "$OUTPUT"
19 }
20
21
22 TP2_LATEST="/data/users/$USER/fbsource/fbcode/third-party2/"
23 ## $1 => lib name
24 ## $2 => lib version (if not provided, will try to pick latest)
25 ## $3 => platform (if not provided, will try to pick latest gcc)
26 ##
27 ## get_lib_base will set a variable named ${LIB_NAME}_BASE to the lib location
28 function get_lib_base()
29 {
30 local lib_name=$1
31 local lib_version=$2
32 local lib_platform=$3
33
34 local result="$TP2_LATEST/$lib_name/"
35
36 # Lib Version
37 if [ -z "$lib_version" ] || [ "$lib_version" = "LATEST" ]; then
38 # version is not provided, use latest
39 result=`ls -dr1v $result/*/ | head -n1`
40 else
41 result="$result/$lib_version/"
42 fi
43
44 # Lib Platform
45 if [ -z "$lib_platform" ]; then
46 # platform is not provided, use latest gcc
47 result=`ls -dr1v $result/gcc-*[^fb]/ | head -n1`
48 else
49 echo $lib_platform
50 result="$result/$lib_platform/"
51 fi
52
53 result=`ls -1d $result/*/ | head -n1`
54
55 echo Finding link $result
56
57 # lib_name => LIB_NAME_BASE
58 local __res_var=${lib_name^^}"_BASE"
59 __res_var=`echo $__res_var | tr - _`
60 # LIB_NAME_BASE=$result
61 eval $__res_var=`readlink -f $result`
62
63 log_variable $__res_var
64 }
65
66 ###########################################################
67 # platform010 dependencies #
68 ###########################################################
69
70 OUTPUT="$BASEDIR/dependencies_platform010.sh"
71
72 rm -f "$OUTPUT"
73 touch "$OUTPUT"
74
75 echo "Writing dependencies to $OUTPUT"
76
77 # Compilers locations
78 GCC_BASE=`readlink -f $TP2_LATEST/gcc/11.x/centos7-native/*/`
79 CLANG_BASE=`readlink -f $TP2_LATEST/llvm-fb/12/platform010/*/`
80
81 log_header
82 log_variable GCC_BASE
83 log_variable CLANG_BASE
84
85 # Libraries locations
86 get_lib_base libgcc 11.x platform010
87 get_lib_base glibc 2.34 platform010
88 get_lib_base snappy LATEST platform010
89 get_lib_base zlib LATEST platform010
90 get_lib_base bzip2 LATEST platform010
91 get_lib_base lz4 LATEST platform010
92 get_lib_base zstd LATEST platform010
93 get_lib_base gflags LATEST platform010
94 get_lib_base jemalloc LATEST platform010
95 get_lib_base numa LATEST platform010
96 get_lib_base libunwind LATEST platform010
97 get_lib_base tbb 2018_U5 platform010
98 get_lib_base liburing LATEST platform010
99 get_lib_base benchmark LATEST platform010
100
101 get_lib_base kernel-headers fb platform010
102 get_lib_base binutils LATEST centos7-native
103 get_lib_base valgrind LATEST platform010
104 get_lib_base lua 5.3.4 platform010
105
106 git diff $OUTPUT
107
108
109 ###########################################################
110 # platform009 dependencies #
111 ###########################################################
112
113 OUTPUT="$BASEDIR/dependencies_platform009.sh"
114
115 rm -f "$OUTPUT"
116 touch "$OUTPUT"
117
118 echo "Writing dependencies to $OUTPUT"
119
120 # Compilers locations
121 GCC_BASE=`readlink -f $TP2_LATEST/gcc/9.x/centos7-native/*/`
122 CLANG_BASE=`readlink -f $TP2_LATEST/llvm-fb/9.0.0/platform009/*/`
123
124 log_header
125 log_variable GCC_BASE
126 log_variable CLANG_BASE
127
128 # Libraries locations
129 get_lib_base libgcc 9.x platform009
130 get_lib_base glibc 2.30 platform009
131 get_lib_base snappy LATEST platform009
132 get_lib_base zlib LATEST platform009
133 get_lib_base bzip2 LATEST platform009
134 get_lib_base lz4 LATEST platform009
135 get_lib_base zstd LATEST platform009
136 get_lib_base gflags LATEST platform009
137 get_lib_base jemalloc LATEST platform009
138 get_lib_base numa LATEST platform009
139 get_lib_base libunwind LATEST platform009
140 get_lib_base tbb 2018_U5 platform009
141 get_lib_base liburing LATEST platform009
142 get_lib_base benchmark LATEST platform009
143
144 get_lib_base kernel-headers fb platform009
145 get_lib_base binutils LATEST centos7-native
146 get_lib_base valgrind LATEST platform009
147 get_lib_base lua 5.3.4 platform009
148
149 git diff $OUTPUT