run.sh 792 B

123456789101112131415161718192021222324
  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 fasta.wasm"
  14. ${IWASM_CMD} fasta.wasm 1000000 > image.ppm
  15. else
  16. echo "============> compile fasta.wasm to aot"
  17. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o fasta.aot fasta.wasm \
  18. || ${WAMRC_CMD} -o fasta.aot fasta.wasm
  19. echo "============> run fasta.aot"
  20. ${IWASM_CMD} fasta.aot 10000000 > image.ppm
  21. fi