run.sh 875 B

1234567891011121314151617181920212223242526
  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. dd if=/dev/urandom of=./random bs=4k count=1k
  13. if [[ $1 != "--aot" ]]; then
  14. echo "============> run cat_sync.wasm"
  15. ${IWASM_CMD} cat_sync.wasm 0 < ./random > image.ppm
  16. else
  17. echo "============> compile cat_sync.wasm to aot"
  18. [[ $2 == "--sgx" ]] && ${WAMRC_CMD} -sgx -o cat_sync.aot cat_sync.wasm \
  19. || ${WAMRC_CMD} -o cat_sync.aot cat_sync.wasm
  20. echo "============> run cat_sync.aot"
  21. ${IWASM_CMD} cat_sync.aot 0 < ./random > image.ppm
  22. fi