run.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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 tsf.wasm"
  14. if [[ $1 != "--multi-tier-jit" ]]; then
  15. ${IWASM_CMD} --stack-size=1048576 --dir=. tsf.wasm
  16. else
  17. echo "============> run tsf.wasm with fast-jit"
  18. ${IWASM_CMD} --fast-jit --stack-size=1048576 --dir=. tsf.wasm
  19. echo "============> run tsf.wasm with llvm-jit"
  20. ${IWASM_CMD} --llvm-jit --stack-size=1048576 --dir=. tsf.wasm
  21. echo "============> run tsf.wasm with multi-tier-jit"
  22. ${IWASM_CMD} --multi-tier-jit --stack-size=1048576 --dir=. tsf.wasm
  23. fi
  24. else
  25. echo "============> compile tsf.wasm to aot"
  26. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o tsf.aot tsf.wasm \
  27. || ${WAMRC_CMD} -o tsf.aot tsf.wasm
  28. echo "============> run tsf.aot"
  29. ${IWASM_CMD} --stack-size=1048576 --dir=. tsf.aot
  30. fi