#!/bin/bash # ---------------------------------------------------------------------------- # Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ---------------------------------------------------------------------------- real_path=$(realpath "$0") LOCAL_PATH=$(cd $(dirname "${real_path}"); pwd) PKG_PATH=$(cd ${LOCAL_PATH}/../..; pwd) PYTHON_P="/python/site-packages" OPC_PATH="opc_tool" PYTHON_PATH="${PKG_PATH}${PYTHON_P}" export PYTHONPATH="${PYTHON_PATH}:${PYTHON_PATH}/${OPC_PATH}:${PYTHONPATH}" OP_COMPILER_PATH="/op_compile_tool" python_args="${HI_PYTHON}" if [ "x${python_args}" = "x" ]; then python_args="python3.7" fi export PYTHONWARNINGS='ignore:semaphore_tracker:UserWarning' cmd="${python_args} ${PYTHON_PATH}${OP_COMPILER_PATH}/op_compiler_tool.py" ${cmd} "$@"