mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
### Description Before this change, copy_strip_binary.sh manually copies each file from onnx runtime's build folder to an artifact folder. It can be hard when dealing with symbolic link for shared libraries. This PR will change the packaging pipelines to run "make install" first, before packaging shared libs . ### Motivation and Context Recently because of feature request #21281 , we changed libonnxruntime.so's SONAME. Now every package that contains this shared library must also contains libonnxruntime.so.1. Therefore we need to change the packaging scripts to include this file. Instead of manually construct the symlink layout, using `make install` is much easier and will make things more consistent because it is a standard way of making packages. **Breaking change:** After this change, our **inference** tarballs that are published to our Github release pages will be not contain ORT **training** headers.
50 lines
1.5 KiB
Bash
Executable file
50 lines
1.5 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
|
|
cd "$BINARY_DIR"
|
|
mv installed/usr/local $ARTIFACT_NAME
|
|
mv $ARTIFACT_NAME/include/onnxruntime/* $ARTIFACT_NAME/include
|
|
rmdir $ARTIFACT_NAME/include/onnxruntime
|
|
# Do not ship onnx_test_runner
|
|
rm -rf $ARTIFACT_NAME/bin
|
|
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
|
|
# 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
|
|
else
|
|
# Linux
|
|
mv $ARTIFACT_NAME/lib64 $ARTIFACT_NAME/lib
|
|
fi
|
|
|
|
# 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
|