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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. set -e
  16. start_dir=$(pwd)
  17. cd "$(dirname "$0")"/../../ecosystem_tools/VulkanVision
  18. if [[ ! -d "SPIRV-Tools" ]]
  19. then
  20. echo "Cloning SPIRV-Tools"
  21. git clone https://github.com/KhronosGroup/SPIRV-Tools
  22. cp st-patches/*.patch SPIRV-Tools
  23. cd SPIRV-Tools
  24. git checkout 17ffa89097b26efeb323e6963220326b5ffb2baf
  25. # These are the current stable changes and can be updated with new releases
  26. git apply 0001-spirv-opt-Add-auto-inst-passes.patch
  27. rm *.patch
  28. cd ..
  29. fi
  30. if [[ ! -d "Vulkan-ValidationLayers" ]]
  31. then
  32. echo "Cloning Vulkan-ValidationLayers"
  33. git clone https://github.com/KhronosGroup/Vulkan-ValidationLayers
  34. cp vv-patches/*.patch Vulkan-ValidationLayers
  35. cd Vulkan-ValidationLayers
  36. git checkout aa076dae88e282d7b6cada4f900b2fa7dac8ed08
  37. # These are the current stable changes and can be updated with new releases
  38. git apply 0001-layers-Added-auto-inst-layers.patch
  39. rm *.patch
  40. cd ..
  41. fi
  42. build_dir=$(pwd)
  43. echo "Building SPIRV-Tools"
  44. cd SPIRV-Tools
  45. git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
  46. cd external/spirv-headers
  47. git checkout f027d53ded7e230e008d37c8b47ede7cd308e19d
  48. cd ../..
  49. git clone https://github.com/google/effcee.git external/effcee
  50. git clone https://github.com/google/re2.git external/re2
  51. mkdir build
  52. cd build
  53. mkdir install
  54. cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=install ..
  55. cmake --build . --target install --config Release -- -j 4
  56. cd $build_dir
  57. echo "Building Vulkan-ValidationLayers"
  58. cd Vulkan-ValidationLayers
  59. mkdir build
  60. cd build
  61. mkdir install
  62. python ../scripts/update_deps.py --config release
  63. cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=install -DSPIRV_TOOLS_INSTALL_DIR=$build_dir/SPIRV-Tools/build/install -C helper.cmake ..
  64. cmake --build . --target install --config Release -- -j 4
  65. echo "Build completed at $build_dir"!
  66. cd $start_dir