You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build_vulkan_vision_linux.sh 2.5 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. # Copyright 2021 Huawei Technologies Co., Ltd.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. start_dir=$(pwd)
  16. cd "$(dirname "$0")"/../../ecosystem_tools/VulkanVision
  17. if [[ ! -d "SPIRV-Tools" ]]
  18. then
  19. echo "Cloning SPIRV-Tools"
  20. git clone https://github.com/KhronosGroup/SPIRV-Tools
  21. cp st-patches/*.patch SPIRV-Tools
  22. cd SPIRV-Tools
  23. git checkout 17ffa89097b26efeb323e6963220326b5ffb2baf
  24. # These are the current stable changes and can be updated with new releases
  25. git apply 0001-spirv-opt-Add-auto-inst-passes.patch
  26. rm *.patch
  27. cd ..
  28. fi
  29. if [[ ! -d "Vulkan-ValidationLayers" ]]
  30. then
  31. echo "Cloning Vulkan-ValidationLayers"
  32. git clone https://github.com/KhronosGroup/Vulkan-ValidationLayers
  33. cp vv-patches/*.patch Vulkan-ValidationLayers
  34. cd Vulkan-ValidationLayers
  35. git checkout aa076dae88e282d7b6cada4f900b2fa7dac8ed08
  36. # These are the current stable changes and can be updated with new releases
  37. git apply 0001-layers-Added-auto-inst-layers.patch
  38. rm *.patch
  39. cd ..
  40. fi
  41. build_dir=$(pwd)
  42. echo "Building SPIRV-Tools"
  43. cd SPIRV-Tools
  44. git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
  45. cd external/spirv-headers
  46. git checkout f027d53ded7e230e008d37c8b47ede7cd308e19d
  47. cd ../..
  48. git clone https://github.com/google/effcee.git external/effcee
  49. git clone https://github.com/google/re2.git external/re2
  50. mkdir build
  51. cd build
  52. mkdir install
  53. cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=install ..
  54. cmake --build . --target install --config Release -- -j 4
  55. cd $build_dir
  56. echo "Building Vulkan-ValidationLayers"
  57. cd Vulkan-ValidationLayers
  58. mkdir build
  59. cd build
  60. mkdir install
  61. python ../scripts/update_deps.py --config release
  62. cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=install -DSPIRV_TOOLS_INSTALL_DIR=$build_dir/SPIRV-Tools/build/install -C helper.cmake ..
  63. cmake --build . --target install --config Release -- -j 4
  64. echo "Build completed at $build_dir"!
  65. cd $start_dir