java support linux x86 avx & sse

This commit is contained in:
yeyunpeng2020 2021-03-27 17:36:48 +08:00
parent bca8389e31
commit 4f0811668a
1 changed files with 13 additions and 5 deletions

View File

@ -706,7 +706,11 @@ build_lite_java_arm32() {
build_lite_java_x86() {
# build mindspore-lite x86
local JTARBALL=mindspore-lite-${VERSION_STR}-inference-linux-x64
if [[ "$X86_64_SIMD" == "sse" || "$X86_64_SIMD" == "avx" ]]; then
local JTARBALL=mindspore-lite-${VERSION_STR}-inference-linux-x64-${X86_64_SIMD}
else
local JTARBALL=mindspore-lite-${VERSION_STR}-inference-linux-x64
fi
if [[ "X$INC_BUILD" == "Xoff" ]] || [[ ! -f "${BASEPATH}/mindspore/lite/build/java/${JTARBALL}.tar.gz" ]]; then
build_lite "x86_64" "off" ""
fi
@ -822,6 +826,11 @@ build_java() {
zip -r mindspore-lite-maven-${VERSION_STR}.zip mindspore
# build linux x86 jar
if [[ "$X86_64_SIMD" == "sse" || "$X86_64_SIMD" == "avx" ]]; then
local LINUX_X86_PACKAGE_NAME=mindspore-lite-${VERSION_STR}-inference-linux-x64-${X86_64_SIMD}-jar
else
local LINUX_X86_PACKAGE_NAME=mindspore-lite-${VERSION_STR}-inference-linux-x64-jar
fi
check_java_home
build_lite_java_x86
build_jni_x86_64
@ -836,12 +845,11 @@ build_java() {
mkdir -p ${JAVA_PATH}/java/linux_x86/build/lib
cp ${JAVA_PATH}/java/linux_x86/libs/*.so ${JAVA_PATH}/java/linux_x86/build/lib/jar
cd ${JAVA_PATH}/java/linux_x86/build/
cp -r ${JAVA_PATH}/java/linux_x86/build/lib ${JAVA_PATH}/java/linux_x86/build/mindspore-lite-${VERSION_STR}-inference-linux-x64-jar
mkdir -p ${JAVA_PATH}/java/linux_x86/build/mindspore-lite-${VERSION_STR}-inference-linux-x64-jar
tar czvf mindspore-lite-${VERSION_STR}-inference-linux-x64-jar.tar.gz ./mindspore-lite-${VERSION_STR}-inference-linux-x64-jar
cp -r ${JAVA_PATH}/java/linux_x86/build/lib ${JAVA_PATH}/java/linux_x86/build/${LINUX_X86_PACKAGE_NAME}
tar czvf ${LINUX_X86_PACKAGE_NAME}.tar.gz ${LINUX_X86_PACKAGE_NAME}
# copy output
cp ${JAVA_PATH}/java/app/build/mindspore-lite-maven-${VERSION_STR}.zip ${BASEPATH}/output
cp mindspore-lite-${VERSION_STR}-inference-linux-x64-jar.tar.gz ${BASEPATH}/output
cp ${LINUX_X86_PACKAGE_NAME}.tar.gz ${BASEPATH}/output
cd ${BASEPATH}/output
[ -n "${VERSION_STR}" ] && rm -rf ${BASEPATH}/mindspore/lite/build/java/mindspore-lite-${VERSION_STR}-inference-linux-x64
exit 0