run.sh 1.2 KB

12345678910111213141516171819202122232425262728293031
  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 smallpt.wasm"
  14. ${IWASM_CMD} --stack-size=2048000 smallpt.wasm > image.ppm
  15. echo "============> run smallpt_ex.wasm"
  16. ${IWASM_CMD} --stack-size=2048000 smallpt_ex.wasm > image.ppm
  17. else
  18. echo "============> compile smallpt.wasm to aot"
  19. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o smallpt.aot smallpt.wasm \
  20. || ${WAMRC_CMD} -o smallpt.aot smallpt.wasm
  21. echo "============> run smallpt.aot"
  22. ${IWASM_CMD} smallpt.aot > image.ppm
  23. echo "============> compile smallpt_ex.wasm to aot"
  24. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o smallpt_ex.aot smallpt_ex.wasm \
  25. || ${WAMRC_CMD} -o smallpt_ex.aot smallpt_ex.wasm
  26. echo "============> run smallpt_ex.aot"
  27. ${IWASM_CMD} smallpt_ex.aot > image.ppm
  28. fi