run.sh 818 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  4. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  5. #
  6. if [[ $2 == "--sgx" ]];then
  7. readonly IWASM_CMD="../../../product-mini/platforms/linux-sgx/enclave-sample/iwasm"
  8. else
  9. readonly IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
  10. fi
  11. readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
  12. if [[ $1 != "--aot" ]]; then
  13. echo "============> run c_ray.wasm"
  14. cat scene | ${IWASM_CMD} c_ray.wasm -s 1024x768 > foo.ppm
  15. else
  16. echo "============> compile c_ray.wasm to aot"
  17. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o c_ray.aot c_ray.wasm \
  18. || ${WAMRC_CMD} -o c_ray.aot c_ray.wasm
  19. echo "============> run c_ray.aot"
  20. cat scene | ${IWASM_CMD} c_ray.aot -s 1024x768 > foo.ppm
  21. fi