update_dependencies.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. BASEDIR=$(dirname $0)
  6. OUTPUT=""
  7. function log_header()
  8. {
  9. echo "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved." >> "$OUTPUT"
  10. echo "# The file is generated using update_dependencies.sh." >> "$OUTPUT"
  11. }
  12. function log_variable()
  13. {
  14. echo "$1=${!1}" >> "$OUTPUT"
  15. }
  16. TP2_LATEST="/data/users/$USER/fbsource/fbcode/third-party2/"
  17. ## $1 => lib name
  18. ## $2 => lib version (if not provided, will try to pick latest)
  19. ## $3 => platform (if not provided, will try to pick latest gcc)
  20. ##
  21. ## get_lib_base will set a variable named ${LIB_NAME}_BASE to the lib location
  22. function get_lib_base()
  23. {
  24. local lib_name=$1
  25. local lib_version=$2
  26. local lib_platform=$3
  27. local result="$TP2_LATEST/$lib_name/"
  28. # Lib Version
  29. if [ -z "$lib_version" ] || [ "$lib_version" = "LATEST" ]; then
  30. # version is not provided, use latest
  31. result=`ls -dr1v $result/*/ | head -n1`
  32. else
  33. result="$result/$lib_version/"
  34. fi
  35. # Lib Platform
  36. if [ -z "$lib_platform" ]; then
  37. # platform is not provided, use latest gcc
  38. result=`ls -dr1v $result/gcc-*[^fb]/ | head -n1`
  39. else
  40. echo $lib_platform
  41. result="$result/$lib_platform/"
  42. fi
  43. result=`ls -1d $result/*/ | head -n1`
  44. echo Finding link $result
  45. # lib_name => LIB_NAME_BASE
  46. local __res_var=${lib_name^^}"_BASE"
  47. __res_var=`echo $__res_var | tr - _`
  48. # LIB_NAME_BASE=$result
  49. eval $__res_var=`readlink -f $result`
  50. log_variable $__res_var
  51. }
  52. ###########################################################
  53. # platform010 dependencies #
  54. ###########################################################
  55. OUTPUT="$BASEDIR/dependencies_platform010.sh"
  56. rm -f "$OUTPUT"
  57. touch "$OUTPUT"
  58. echo "Writing dependencies to $OUTPUT"
  59. # Compilers locations
  60. GCC_BASE=`readlink -f $TP2_LATEST/gcc/11.x/centos8-native/*/`
  61. CLANG_BASE=`readlink -f $TP2_LATEST/llvm-fb/15/platform010/*/`
  62. log_header
  63. log_variable GCC_BASE
  64. log_variable CLANG_BASE
  65. # Libraries locations
  66. get_lib_base libgcc 11.x platform010
  67. get_lib_base glibc 2.34 platform010
  68. get_lib_base snappy LATEST platform010
  69. get_lib_base zlib 1.2.8 platform010
  70. get_lib_base bzip2 LATEST platform010
  71. get_lib_base lz4 LATEST platform010
  72. get_lib_base zstd LATEST platform010
  73. get_lib_base gflags LATEST platform010
  74. get_lib_base jemalloc LATEST platform010
  75. get_lib_base numa LATEST platform010
  76. get_lib_base libunwind LATEST platform010
  77. get_lib_base tbb 2018_U5 platform010
  78. get_lib_base liburing LATEST platform010
  79. get_lib_base benchmark LATEST platform010
  80. get_lib_base kernel-headers fb platform010
  81. get_lib_base binutils LATEST centos8-native
  82. get_lib_base valgrind LATEST platform010
  83. get_lib_base lua 5.3.4 platform010
  84. git diff $OUTPUT