onnxruntime/tools/ci_build/github/linux/copy_strip_binary.sh
Changming Sun ff1e446d00
ONNX Runtime 1.15.1 release (#16365)
### Description
The patch release will fix the following issues:
1. A coding problem in test/shared_lib/test_inference.cc that it should
use ASSERT_NEAR to test float values instead of ASSERT_EQ. Without this
change, some DNNL/OpenVino tests would fail on some AMD CPUs.
2. A misaligned error in cublasGemmBatchedHelper function. The error
only occurs when the GPU's CUDA Compute capability >=80. (In other
words: with TensorFloat-32 support)
3. A build issue that build with onnxruntime_ENABLE_MEMORY_PROFILE was
broken in 1.15.0 release.
4. Native onnxruntime library not loading in Azure App Service. It is
because in 1.15.0 we introduced a Windows API call to
SetThreadDescription. Though the API is available in all Windows 10
versions, some sandbox environments block using the API.
5. An alignment problem for xnnpack EP on Intel/AMD CPUs on PC
platforms.
6. Some training header files were missing in the 1.15.0 training NuGet
package.
7. Some fields in OrtCUDAProviderOptionsV2 struct are not initialized.


---------
Co-authored-by: cao lei <jslhcl@gmail.com>
Co-authored-by: Lei Cao <leca@microsoft.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
Co-authored-by: Baiju Meswani <bmeswani@microsoft.com>
Co-authored-by: JiCheng <wejoncy@163.com>
Co-authored-by: Yuriy Chernyshov <thegeorg@yandex-team.com>
Co-authored-by: Artur <artur@vaadin.com>
Co-authored-by: Dale Phurrough <dale@hidale.com>
Co-authored-by: Yi Zhang <zhanyi@microsoft.com>
2023-06-15 15:45:21 -07:00

68 lines
3.3 KiB
Bash
Executable file

#!/bin/bash
set -e -o -x
while getopts r:a:l:c:s:t: parameter_Option
do case "${parameter_Option}"
in
r) BINARY_DIR=${OPTARG};;
a) ARTIFACT_NAME=${OPTARG};;
l) LIB_NAME=${OPTARG};;
c) BUILD_CONFIG=${OPTARG};;
s) SOURCE_DIR=${OPTARG};;
t) COMMIT_ID=${OPTARG};;
esac
done
EXIT_CODE=1
uname -a
mkdir $BINARY_DIR/$ARTIFACT_NAME
mkdir $BINARY_DIR/$ARTIFACT_NAME/lib
mkdir $BINARY_DIR/$ARTIFACT_NAME/include
echo "Directories created"
cp $BINARY_DIR/$BUILD_CONFIG/$LIB_NAME $BINARY_DIR/$ARTIFACT_NAME/lib
if [[ -f "$BINARY_DIR/$BUILD_CONFIG/libonnxruntime_providers_cuda.so" ]]; then
cp $BINARY_DIR/$BUILD_CONFIG/libonnxruntime_providers_shared.so $BINARY_DIR/$ARTIFACT_NAME/lib
cp $BINARY_DIR/$BUILD_CONFIG/libonnxruntime_providers_cuda.so $BINARY_DIR/$ARTIFACT_NAME/lib
fi
if [[ -f "$BINARY_DIR/$BUILD_CONFIG/libonnxruntime_providers_tensorrt.so" ]]; then
cp $BINARY_DIR/$BUILD_CONFIG/libonnxruntime_providers_tensorrt.so $BINARY_DIR/$ARTIFACT_NAME/lib
cp $SOURCE_DIR/include/onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.h $BINARY_DIR/$ARTIFACT_NAME/include
fi
echo "Copy debug symbols in a separate file and strip the original binary."
if [[ $LIB_NAME == *.dylib ]]
then
dsymutil $BINARY_DIR/$ARTIFACT_NAME/lib/$LIB_NAME -o $BINARY_DIR/$ARTIFACT_NAME/lib/$LIB_NAME.dSYM
strip -S $BINARY_DIR/$ARTIFACT_NAME/lib/$LIB_NAME
ln -s $LIB_NAME $BINARY_DIR/$ARTIFACT_NAME/lib/libonnxruntime.dylib
# copy the CoreML EP header for macOS build (libs with .dylib ext)
cp $SOURCE_DIR/include/onnxruntime/core/providers/coreml/coreml_provider_factory.h $BINARY_DIR/$ARTIFACT_NAME/include
elif [[ $LIB_NAME == *.so.* ]]
then
ln -s $LIB_NAME $BINARY_DIR/$ARTIFACT_NAME/lib/libonnxruntime.so
fi
cp $SOURCE_DIR/include/onnxruntime/core/session/onnxruntime_c_api.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/include/onnxruntime/core/session/onnxruntime_cxx_api.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/include/onnxruntime/core/session/onnxruntime_cxx_inline.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/include/onnxruntime/core/session/onnxruntime_run_options_config_keys.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/include/onnxruntime/core/framework/provider_options.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/orttraining/orttraining/training_api/include/onnxruntime_training_c_api.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/orttraining/orttraining/training_api/include/onnxruntime_training_cxx_api.h $BINARY_DIR/$ARTIFACT_NAME/include
cp $SOURCE_DIR/orttraining/orttraining/training_api/include/onnxruntime_training_cxx_inline.h $BINARY_DIR/$ARTIFACT_NAME/include
# copy the README, licence and TPN
cp $SOURCE_DIR/README.md $BINARY_DIR/$ARTIFACT_NAME/README.md
cp $SOURCE_DIR/docs/Privacy.md $BINARY_DIR/$ARTIFACT_NAME/Privacy.md
cp $SOURCE_DIR/LICENSE $BINARY_DIR/$ARTIFACT_NAME/LICENSE
cp $SOURCE_DIR/ThirdPartyNotices.txt $BINARY_DIR/$ARTIFACT_NAME/ThirdPartyNotices.txt
cp $SOURCE_DIR/VERSION_NUMBER $BINARY_DIR/$ARTIFACT_NAME/VERSION_NUMBER
echo $COMMIT_ID > $BINARY_DIR/$ARTIFACT_NAME/GIT_COMMIT_ID
EXIT_CODE=$?
set -e
exit $EXIT_CODE