2016-01-22 20:56:32 +01:00
|
|
|
#!/bin/sh
|
2019-04-18 19:51:19 +02:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
2016-01-22 20:56:32 +01:00
|
|
|
#
|
|
|
|
# Update dependencies.sh file with the latest avaliable versions
|
|
|
|
|
|
|
|
BASEDIR=$(dirname $0)
|
2016-01-25 23:35:04 +01:00
|
|
|
OUTPUT=""
|
2016-01-22 20:56:32 +01:00
|
|
|
|
2019-09-17 05:41:16 +02:00
|
|
|
function log_header()
|
|
|
|
{
|
|
|
|
echo "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved." >> "$OUTPUT"
|
2022-04-16 01:05:38 +02:00
|
|
|
echo "# The file is generated using update_dependencies.sh." >> "$OUTPUT"
|
2019-09-17 05:41:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-01-22 20:56:32 +01:00
|
|
|
function log_variable()
|
|
|
|
{
|
|
|
|
echo "$1=${!1}" >> "$OUTPUT"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-04-16 01:05:38 +02:00
|
|
|
TP2_LATEST="/data/users/$USER/fbsource/fbcode/third-party2/"
|
2016-01-22 20:56:32 +01:00
|
|
|
## $1 => lib name
|
|
|
|
## $2 => lib version (if not provided, will try to pick latest)
|
|
|
|
## $3 => platform (if not provided, will try to pick latest gcc)
|
|
|
|
##
|
|
|
|
## get_lib_base will set a variable named ${LIB_NAME}_BASE to the lib location
|
|
|
|
function get_lib_base()
|
|
|
|
{
|
|
|
|
local lib_name=$1
|
|
|
|
local lib_version=$2
|
|
|
|
local lib_platform=$3
|
|
|
|
|
|
|
|
local result="$TP2_LATEST/$lib_name/"
|
|
|
|
|
|
|
|
# Lib Version
|
2016-01-25 23:35:04 +01:00
|
|
|
if [ -z "$lib_version" ] || [ "$lib_version" = "LATEST" ]; then
|
2016-01-22 20:56:32 +01:00
|
|
|
# version is not provided, use latest
|
|
|
|
result=`ls -dr1v $result/*/ | head -n1`
|
|
|
|
else
|
|
|
|
result="$result/$lib_version/"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Lib Platform
|
|
|
|
if [ -z "$lib_platform" ]; then
|
|
|
|
# platform is not provided, use latest gcc
|
|
|
|
result=`ls -dr1v $result/gcc-*[^fb]/ | head -n1`
|
|
|
|
else
|
2017-09-01 00:19:20 +02:00
|
|
|
echo $lib_platform
|
2016-01-22 20:56:32 +01:00
|
|
|
result="$result/$lib_platform/"
|
|
|
|
fi
|
|
|
|
|
2016-01-25 23:35:04 +01:00
|
|
|
result=`ls -1d $result/*/ | head -n1`
|
2022-04-16 01:05:38 +02:00
|
|
|
|
|
|
|
echo Finding link $result
|
2016-01-22 20:56:32 +01:00
|
|
|
|
|
|
|
# lib_name => LIB_NAME_BASE
|
|
|
|
local __res_var=${lib_name^^}"_BASE"
|
2016-01-25 23:35:04 +01:00
|
|
|
__res_var=`echo $__res_var | tr - _`
|
2016-01-22 20:56:32 +01:00
|
|
|
# LIB_NAME_BASE=$result
|
|
|
|
eval $__res_var=`readlink -f $result`
|
|
|
|
|
|
|
|
log_variable $__res_var
|
|
|
|
}
|
|
|
|
|
2019-01-28 19:57:57 +01:00
|
|
|
###########################################################
|
2022-04-16 01:05:38 +02:00
|
|
|
# platform010 dependencies #
|
2019-01-28 19:57:57 +01:00
|
|
|
###########################################################
|
|
|
|
|
2022-04-16 01:05:38 +02:00
|
|
|
OUTPUT="$BASEDIR/dependencies_platform010.sh"
|
2019-01-28 19:57:57 +01:00
|
|
|
|
|
|
|
rm -f "$OUTPUT"
|
|
|
|
touch "$OUTPUT"
|
|
|
|
|
|
|
|
echo "Writing dependencies to $OUTPUT"
|
|
|
|
|
|
|
|
# Compilers locations
|
2022-04-16 01:05:38 +02:00
|
|
|
GCC_BASE=`readlink -f $TP2_LATEST/gcc/11.x/centos7-native/*/`
|
|
|
|
CLANG_BASE=`readlink -f $TP2_LATEST/llvm-fb/12/platform010/*/`
|
2019-01-28 19:57:57 +01:00
|
|
|
|
2019-09-17 05:41:16 +02:00
|
|
|
log_header
|
2019-01-28 19:57:57 +01:00
|
|
|
log_variable GCC_BASE
|
|
|
|
log_variable CLANG_BASE
|
|
|
|
|
|
|
|
# Libraries locations
|
2022-04-16 01:05:38 +02:00
|
|
|
get_lib_base libgcc 11.x platform010
|
|
|
|
get_lib_base glibc 2.34 platform010
|
|
|
|
get_lib_base snappy LATEST platform010
|
|
|
|
get_lib_base zlib LATEST platform010
|
|
|
|
get_lib_base bzip2 LATEST platform010
|
|
|
|
get_lib_base lz4 LATEST platform010
|
|
|
|
get_lib_base zstd LATEST platform010
|
|
|
|
get_lib_base gflags LATEST platform010
|
|
|
|
get_lib_base jemalloc LATEST platform010
|
|
|
|
get_lib_base numa LATEST platform010
|
|
|
|
get_lib_base libunwind LATEST platform010
|
|
|
|
get_lib_base tbb 2018_U5 platform010
|
|
|
|
get_lib_base liburing LATEST platform010
|
|
|
|
get_lib_base benchmark LATEST platform010
|
|
|
|
|
|
|
|
get_lib_base kernel-headers fb platform010
|
2019-01-28 19:57:57 +01:00
|
|
|
get_lib_base binutils LATEST centos7-native
|
2022-04-16 01:05:38 +02:00
|
|
|
get_lib_base valgrind LATEST platform010
|
|
|
|
get_lib_base lua 5.3.4 platform010
|
2019-01-28 19:57:57 +01:00
|
|
|
|
|
|
|
git diff $OUTPUT
|
|
|
|
|
2022-04-16 01:05:38 +02:00
|
|
|
|
2016-01-26 21:13:27 +01:00
|
|
|
###########################################################
|
2022-04-16 01:05:38 +02:00
|
|
|
# platform009 dependencies #
|
2016-01-26 21:13:27 +01:00
|
|
|
###########################################################
|
|
|
|
|
2022-04-16 01:05:38 +02:00
|
|
|
OUTPUT="$BASEDIR/dependencies_platform009.sh"
|
2016-01-25 23:35:04 +01:00
|
|
|
|
|
|
|
rm -f "$OUTPUT"
|
|
|
|
touch "$OUTPUT"
|
|
|
|
|
2016-01-22 20:56:32 +01:00
|
|
|
echo "Writing dependencies to $OUTPUT"
|
|
|
|
|
|
|
|
# Compilers locations
|
2022-04-16 01:05:38 +02:00
|
|
|
GCC_BASE=`readlink -f $TP2_LATEST/gcc/9.x/centos7-native/*/`
|
|
|
|
CLANG_BASE=`readlink -f $TP2_LATEST/llvm-fb/9.0.0/platform009/*/`
|
2016-01-22 20:56:32 +01:00
|
|
|
|
2019-09-17 05:41:16 +02:00
|
|
|
log_header
|
2016-01-22 20:56:32 +01:00
|
|
|
log_variable GCC_BASE
|
|
|
|
log_variable CLANG_BASE
|
|
|
|
|
|
|
|
# Libraries locations
|
2022-04-16 01:05:38 +02:00
|
|
|
get_lib_base libgcc 9.x platform009
|
|
|
|
get_lib_base glibc 2.30 platform009
|
|
|
|
get_lib_base snappy LATEST platform009
|
|
|
|
get_lib_base zlib LATEST platform009
|
|
|
|
get_lib_base bzip2 LATEST platform009
|
|
|
|
get_lib_base lz4 LATEST platform009
|
|
|
|
get_lib_base zstd LATEST platform009
|
|
|
|
get_lib_base gflags LATEST platform009
|
|
|
|
get_lib_base jemalloc LATEST platform009
|
|
|
|
get_lib_base numa LATEST platform009
|
|
|
|
get_lib_base libunwind LATEST platform009
|
|
|
|
get_lib_base tbb 2018_U5 platform009
|
|
|
|
get_lib_base liburing LATEST platform009
|
|
|
|
get_lib_base benchmark LATEST platform009
|
|
|
|
|
|
|
|
get_lib_base kernel-headers fb platform009
|
2018-08-10 01:45:11 +02:00
|
|
|
get_lib_base binutils LATEST centos7-native
|
2022-04-16 01:05:38 +02:00
|
|
|
get_lib_base valgrind LATEST platform009
|
|
|
|
get_lib_base lua 5.3.4 platform009
|
2016-01-26 21:13:27 +01:00
|
|
|
|
|
|
|
git diff $OUTPUT
|