Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -ex
#Every cuda container has this $CUDA_VERSION env var set.
SHORT_CUDA_VERSION=$(echo "${CUDA_VERSION}" | sed 's/\([[:digit:]]\+\.[[:digit:]]\+\)\.[[:digit:]]\+/\1/')
 
#TODO: add --update --build
BUILD_ARGS=('--config' 'Release'
              '--skip_submodule_sync'
              '--build_shared_lib'
              '--parallel' '--use_vcpkg' '--use_vcpkg_ms_internal_asset_cache' '--use_binskim_compliant_compile_flags'
              '--build_wheel'
              '--enable_onnx_tests'
              '--use_cuda'
              "--cuda_version=$SHORT_CUDA_VERSION"
              "--cuda_home=/usr/local/cuda-$SHORT_CUDA_VERSION"
              "--cudnn_home=/usr/local/cuda-$SHORT_CUDA_VERSION"
              "--use_tensorrt" "--tensorrt_home" "/usr"
              "--enable_pybind"
              "--build_java"
              "--cmake_extra_defines"
              "CMAKE_CUDA_ARCHITECTURES=75"
              "onnxruntime_BUILD_UNIT_TESTS=ON"
              "onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON")
 
# Parse external args
for arg in "$@"; do
  case $arg in
    --cuda_minimal=ON)
      # Replace onnxruntime_BUILD_UNIT_TESTS=ON with OFF
      BUILD_ARGS=("${BUILD_ARGS[@]/onnxruntime_BUILD_UNIT_TESTS=ON/onnxruntime_BUILD_UNIT_TESTS=OFF}")
      BUILD_ARGS+=("--enable_cuda_minimal_build")
      BUILD_ARGS+=("--disable_generation_ops")
      BUILD_ARGS+=("--skip_tests")
      ;;
  esac
done
 
if [ -x "$(command -v ninja)" ]; then
    BUILD_ARGS+=('--cmake_generator' 'Ninja')
fi
 
if [ -d /build ]; then
    BUILD_ARGS+=('--build_dir' '/build')
else
    BUILD_ARGS+=('--build_dir' 'build')
fi
 
if command -v ccache &> /dev/null; then
    ccache --zero-stats
    BUILD_ARGS+=("--use_cache")
fi
 
if [ -f /opt/python/cp312-cp312/bin/python3 ]; then
    PATH=/opt/python/cp312-cp312/bin:$PATH /opt/python/cp312-cp312/bin/python3 tools/ci_build/build.py "${BUILD_ARGS[@]}"
else
    python3 tools/ci_build/build.py "${BUILD_ARGS[@]}"
fi
 
if command -v ccache &> /dev/null; then
    # FIXME: can't use `-vv` for extra details b/c we're shipping with a decrepit version of ccache (3.something) that doesn't support it.
    ccache --show-stats # -vv
fi