Files
FastDeploy/scripts/fastdeploy_init.sh
yunyaoXYY d45382e3cc [Backend] Add Huawei Ascend NPU deploy using PaddleLite CANN. (#757)
* Add Huawei Ascend NPU deploy through PaddleLite CANN

* Add NNAdapter interface for paddlelite

* Modify Huawei Ascend Cmake

* Update way for compiling Huawei Ascend NPU deployment

* remove UseLiteBackend in UseCANN

* Support compile python whlee

* Change names of nnadapter API

* Add nnadapter pybind and remove useless API

* Support Python deployment on Huawei Ascend NPU

* Add models suppor for ascend

* Add PPOCR rec reszie for ascend

* fix conflict for ascend

* Rename CANN to Ascend

* Rename CANN to Ascend

* Improve ascend

* fix ascend bug

* improve ascend docs

* improve ascend docs

* improve ascend docs

* Improve Ascend

* Improve Ascend

* Move ascend python demo

* Imporve ascend

* Improve ascend

* Improve ascend

* Improve ascend

* Improve ascend

* Imporve ascend

* Imporve ascend

* Improve ascend
2022-12-26 10:18:34 +08:00

43 lines
1.3 KiB
Bash

# source this file to import libraries
PLATFORM=`uname`
FASTDEPLOY_LIBRARY_PATH=${BASH_SOURCE}
if [ "$PLATFORM" == "Linux" ];then
FASTDEPLOY_LIBRARY_PATH=`readlink -f ${FASTDEPLOY_LIBRARY_PATH}`
fi
FASTDEPLOY_LIBRARY_PATH=${FASTDEPLOY_LIBRARY_PATH%/*}
echo "=============== Information ======================"
echo "FastDeploy Library Path: $FASTDEPLOY_LIBRARY_PATH"
echo "Platform: $PLATFORM"
echo "=================================================="
# Find all the .so files' path
ALL_SO_FILES=`find $FASTDEPLOY_LIBRARY_PATH -name "*.so*"`
for SO_FILE in $ALL_SO_FILES;do
LIBS_DIRECOTRIES[${#LIBS_DIRECOTRIES[@]}]=${SO_FILE%/*}
done
# Find all the .dylib files' path
ALL_DYLIB_FILES=`find $FASTDEPLOY_LIBRARY_PATH -name "*.dylib*"`
for DYLIB_FILE in $ALL_DYLIB_FILES;do
LIBS_DIRECOTRIES[${#LIBS_DIRECOTRIES[@]}]=${DYLIB_FILE%/*}
done
# Remove the dumplicate directories
LIBS_DIRECOTRIES=($(awk -v RS=' ' '!a[$1]++' <<< ${LIBS_DIRECOTRIES[@]}))
IMPORT_PATH=""
for LIB_DIR in ${LIBS_DIRECOTRIES[@]};do
echo "Find Library Directory: $LIB_DIR"
IMPORT_PATH=${LIB_DIR}":"$IMPORT_PATH
done
if [ -f "ascend_init.sh" ]
then
source ascend_init.sh
fi
echo "[Execute] Will try to export all the library directories to environments, if not work, please try to export these path by your self."
export LD_LIBRARY_PATH=${IMPORT_PATH}:$LD_LIBRARY_PATH