forked from PaddlePaddle/FastDeploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into encrypt_model
- Loading branch information
Showing
7 changed files
with
174 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,4 +122,4 @@ int main(int argc, char* argv[]) { | |
#endif | ||
} | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/bash | ||
set -e | ||
set +x | ||
|
||
FASTDEPLOY_DIR=$(pwd) | ||
BUILT_PACKAGE_DIR=build/Android | ||
CXX_PACKAGE_PREFIX=fastdeploy-android-latest-shared-dev | ||
CXX_PACKAGE_NAME=${BUILT_PACKAGE_DIR}/${CXX_PACKAGE_PREFIX} | ||
ARMV8_CXX_PACKAGE_NAME=${BUILT_PACKAGE_DIR}/arm64-v8a-api-21/install | ||
ARMV7_CXX_PACKAGE_NAME=${BUILT_PACKAGE_DIR}/armeabi-v7a-api-21/install | ||
|
||
# check package name | ||
echo "[INFO] --- FASTDEPLOY_DIR: ${FASTDEPLOY_DIR}" | ||
|
||
# check arm v7 & v8 c++ sdk | ||
if [ ! -d "${BUILT_PACKAGE_DIR}" ]; then | ||
echo "[ERROR] --- ${BUILT_PACKAGE_DIR} not exist, please build c++ sdk first!" | ||
exit 0 | ||
fi | ||
if [ ! -d "${ARMV8_CXX_PACKAGE_NAME}" ]; then | ||
echo "[ERROR] --- ${ARMV8_CXX_PACKAGE_NAME} not exist, please build c++ sdk first!" | ||
exit 0 | ||
fi | ||
if [ ! -d "${ARMV7_CXX_PACKAGE_NAME}" ]; then | ||
echo "[ERROR] --- ${ARMV7_CXX_PACKAGE_NAME} not exist, please build c++ sdk first!" | ||
exit 0 | ||
fi | ||
|
||
# remove old package | ||
echo "[INFO] --- Packing ${CXX_PACKAGE_NAME} package ..." | ||
if [ -d "${CXX_PACKAGE_NAME}" ]; then | ||
rm -rf ${CXX_PACKAGE_NAME} | ||
echo "[INFO] --- Removed old ${CXX_PACKAGE_NAME} done !" | ||
if [ -f "${CXX_PACKAGE_NAME}.tgz" ]; then | ||
rm ${CXX_PACKAGE_NAME}.tgz | ||
echo "[INFO] --- Removed old ${CXX_PACKAGE_NAME} done !" | ||
fi | ||
fi | ||
|
||
# package latest c++ sdk | ||
mkdir ${CXX_PACKAGE_NAME} | ||
echo "[INFO] --- Collecting package contents ..." | ||
cp -r ${ARMV7_CXX_PACKAGE_NAME}/* ${CXX_PACKAGE_NAME}/ | ||
cp -r ${ARMV8_CXX_PACKAGE_NAME}/* ${CXX_PACKAGE_NAME}/ | ||
if [ -d "${CXX_PACKAGE_NAME}/examples" ]; then | ||
rm -rf ${CXX_PACKAGE_NAME}/examples | ||
fi | ||
echo "[INFO] --- Removed examples files ..." | ||
echo "[INFO] --- Removing static .a files: " | ||
static_files=$(find ${CXX_PACKAGE_NAME}/third_libs/install/ -name "*.a") | ||
if [ ${#static_files[@]} -gt 10 ]; then | ||
echo "${#static_files[@]}: ${static_files}" | ||
rm $(find ${CXX_PACKAGE_NAME}/third_libs/install/ -name "*.a") | ||
fi | ||
echo "[INFO] --- Taring ${CXX_PACKAGE_NAME}.tgz package ..." | ||
tar -zcvf ${CXX_PACKAGE_NAME}.tgz ${CXX_PACKAGE_NAME}/* >> ${BUILT_PACKAGE_DIR}/pkg.log 2>&1 | ||
echo "[INFO] --- Package ${CXX_PACKAGE_NAME}.tgz done ! Package size info: " | ||
du -sh ${BUILT_PACKAGE_DIR}/* | grep ${CXX_PACKAGE_PREFIX} | ||
|
||
# Usage: | ||
# ./scripts/android/bundle_android_cpp_with_text_api_only.sh |
79 changes: 79 additions & 0 deletions
79
scripts/linux/build_linux_x86_64_cpp_xpu_with_benchmark.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
set -e | ||
set +x | ||
|
||
# ------------------------------------------------------------------------------- | ||
# readonly global variables | ||
# ------------------------------------------------------------------------------- | ||
readonly ROOT_PATH=$(pwd) | ||
readonly BUILD_ROOT=build/Linux | ||
readonly BUILD_DIR="${BUILD_ROOT}/x86_64_xpu" | ||
|
||
# ------------------------------------------------------------------------------- | ||
# tasks | ||
# ------------------------------------------------------------------------------- | ||
__make_build_dir() { | ||
if [ ! -d "${BUILD_DIR}" ]; then | ||
echo "-- [INFO] BUILD_DIR: ${BUILD_DIR} not exists, setup manually ..." | ||
if [ ! -d "${BUILD_ROOT}" ]; then | ||
mkdir -p "${BUILD_ROOT}" && echo "-- [INFO] Created ${BUILD_ROOT} !" | ||
fi | ||
mkdir -p "${BUILD_DIR}" && echo "-- [INFO] Created ${BUILD_DIR} !" | ||
else | ||
echo "-- [INFO] Found BUILD_DIR: ${BUILD_DIR}" | ||
fi | ||
} | ||
|
||
__check_cxx_envs() { | ||
if [ $LDFLAGS ]; then | ||
echo "-- [INFO] Found LDFLAGS: ${LDFLAGS}, \c" | ||
echo "unset it before crossing compiling ${BUILD_DIR}" | ||
unset LDFLAGS | ||
fi | ||
if [ $CPPFLAGS ]; then | ||
echo "-- [INFO] Found CPPFLAGS: ${CPPFLAGS}, \c" | ||
echo "unset it before crossing compiling ${BUILD_DIR}" | ||
unset CPPFLAGS | ||
fi | ||
if [ $CPLUS_INCLUDE_PATH ]; then | ||
echo "-- [INFO] Found CPLUS_INCLUDE_PATH: ${CPLUS_INCLUDE_PATH}, \c" | ||
echo "unset it before crossing compiling ${BUILD_DIR}" | ||
unset CPLUS_INCLUDE_PATH | ||
fi | ||
if [ $C_INCLUDE_PATH ]; then | ||
echo "-- [INFO] Found C_INCLUDE_PATH: ${C_INCLUDE_PATH}, \c" | ||
echo "unset it before crossing compiling ${BUILD_DIR}" | ||
unset C_INCLUDE_PATH | ||
fi | ||
} | ||
|
||
__build_fastdeploy_linux_x86_64_xpu_shared() { | ||
|
||
local FASDEPLOY_INSTALL_DIR="${ROOT_PATH}/${BUILD_DIR}/install" | ||
cd "${BUILD_DIR}" && echo "-- [INFO] Working Dir: ${PWD}" | ||
|
||
cmake -DWITH_KUNLUNXIN=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DWITH_GPU=OFF \ | ||
-DENABLE_ORT_BACKEND=ON \ | ||
-DENABLE_PADDLE_BACKEND=ON \ | ||
-DENABLE_VISION=ON \ | ||
-DENABLE_BENCHMARK=ON \ | ||
-DBUILD_EXAMPLES=OFF \ | ||
-DCMAKE_INSTALL_PREFIX=${FASDEPLOY_INSTALL_DIR} \ | ||
-Wno-dev ../../.. && make -j8 && make install | ||
|
||
echo "-- [INFO][built][x86_64_xpu}][${BUILD_DIR}/install]" | ||
} | ||
|
||
main() { | ||
__make_build_dir | ||
__check_cxx_envs | ||
__build_fastdeploy_linux_x86_64_xpu_shared | ||
exit 0 | ||
} | ||
|
||
main | ||
|
||
# Usage: | ||
# ./scripts/linux/build_linux_x86_64_cpp_gpu.sh |