forked from mindspore-Ecosystem/mindspore
fix compile bug in testcase and package
This commit is contained in:
parent
d7b4a0d611
commit
94132b1aeb
6
build.sh
6
build.sh
|
@ -655,7 +655,7 @@ build_lite()
|
|||
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="arm64-v8a" -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \
|
||||
-DANDROID_STL="c++_static" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
|
||||
-DPLATFORM_ARM64=on -DENABLE_NEON=on -DENABLE_FP16="off" \
|
||||
-DENABLE_TOOLS=${ENABLE_TOOLS} -DENABLE_CONVERTER=${ENABLE_CONVERTER} -DBUILD_TESTCASES=${RUN_TESTCASES} \
|
||||
-DENABLE_TOOLS=${ENABLE_TOOLS} -DENABLE_CONVERTER=${ENABLE_CONVERTER} -DBUILD_TESTCASES=on \
|
||||
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp -DMS_VERSION_MAJOR=${VERSION_MAJOR} \
|
||||
-DMS_VERSION_MINOR=${VERSION_MINOR} -DMS_VERSION_REVISION=${VERSION_REVISION} -DENABLE_VERBOSE=${ENABLE_VERBOSE} \
|
||||
|
@ -666,14 +666,14 @@ build_lite()
|
|||
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="armeabi-v7a" -DANDROID_TOOLCHAIN_NAME="clang" \
|
||||
-DANDROID_STL="c++_static" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DPLATFORM_ARM32=on -DENABLE_NEON=on -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
|
||||
-DENABLE_TOOLS=${ENABLE_TOOLS} -DENABLE_CONVERTER=${ENABLE_CONVERTER} -DBUILD_TESTCASES=${RUN_TESTCASES} \
|
||||
-DENABLE_TOOLS=${ENABLE_TOOLS} -DENABLE_CONVERTER=${ENABLE_CONVERTER} -DBUILD_TESTCASES=on \
|
||||
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp -DMS_VERSION_MAJOR=${VERSION_MAJOR} \
|
||||
-DMS_VERSION_MINOR=${VERSION_MINOR} -DMS_VERSION_REVISION=${VERSION_REVISION} -DENABLE_VERBOSE=${ENABLE_VERBOSE} \
|
||||
"${BASEPATH}/mindspore/lite"
|
||||
else
|
||||
cmake -DPLATFORM_ARM64=off -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
|
||||
-DENABLE_TOOLS=${ENABLE_TOOLS} -DENABLE_CONVERTER=${ENABLE_CONVERTER} -DBUILD_TESTCASES=${RUN_TESTCASES} \
|
||||
-DENABLE_TOOLS=${ENABLE_TOOLS} -DENABLE_CONVERTER=${ENABLE_CONVERTER} -DBUILD_TESTCASES=on \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_GPU=${ENABLE_GPU} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \
|
||||
-DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp \
|
||||
-DMS_VERSION_MAJOR=${VERSION_MAJOR} -DMS_VERSION_MINOR=${VERSION_MINOR} -DMS_VERSION_REVISION=${VERSION_REVISION} \
|
||||
|
|
|
@ -64,7 +64,7 @@ if (PLATFORM_ARM64)
|
|||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.a DESTINATION ${LIB_DIR} COMPONENT ${COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${INC_DIR}/ir/dtype COMPONENT ${COMPONENT_NAME})
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${INC_DIR} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/schema/ DESTINATION ${INC_DIR}/schema COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "inner" EXCLUDE)
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/schema/ DESTINATION ${INC_DIR}/schema COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "inner" EXCLUDE)
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite-optimize.so DESTINATION ${LIB_DIR} COMPONENT ${COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite-fp16.so DESTINATION ${LIB_DIR} COMPONENT ${COMPONENT_NAME})
|
||||
install(DIRECTORY ${flatbuffers_INC} DESTINATION ${FLATBF_DIR} COMPONENT ${COMPONENT_NAME})
|
||||
|
@ -73,7 +73,7 @@ elseif (PLATFORM_ARM32)
|
|||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.a DESTINATION ${LIB_DIR} COMPONENT ${COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${INC_DIR}/ir/dtype COMPONENT ${COMPONENT_NAME})
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${INC_DIR} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/schema/ DESTINATION ${INC_DIR}/schema COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "inner" EXCLUDE)
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/schema/ DESTINATION ${INC_DIR}/schema COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "inner" EXCLUDE)
|
||||
install(DIRECTORY ${flatbuffers_INC} DESTINATION ${FLATBF_DIR} COMPONENT ${COMPONENT_NAME})
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH)
|
||||
|
@ -83,7 +83,8 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|||
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/libconverter_parser.a DESTINATION ${TOP_DIR}/build/mindspore/package COMPONENT ${PARSER_NAME})
|
||||
else ()
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${INC_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/schema/ DESTINATION ${INC_DIR_RUN_X86}/schema COMPONENT ${RUN_X86_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "inner" EXCLUDE)
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/schema/model_generated.h DESTINATION ${INC_DIR_RUN_X86}/schema COMPONENT ${RUN_X86_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/schema/ops_generated.h DESTINATION ${INC_DIR_RUN_X86}/schema COMPONENT ${RUN_X86_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${INC_DIR_RUN_X86}/ir/dtype COMPONENT ${RUN_X86_COMPONENT_NAME})
|
||||
install(DIRECTORY ${flatbuffers_INC} DESTINATION ${FLATBF_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so DESTINATION ${LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME})
|
||||
|
|
|
@ -11,14 +11,14 @@ string(REPLACE " -Werror " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|||
STRING(REPLACE " -fvisibility=hidden " " -fvisibility=default " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
STRING(REPLACE " -fvisibility=hidden " " -fvisibility=default " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
if(BUILD_CONVERTER)
|
||||
if(ENABLE_CONVERTER)
|
||||
set(CCSRC_SRC
|
||||
## ccsrc
|
||||
${CCSRC_DIR}/backend/optimizer/common/pattern_engine.cc
|
||||
${CCSRC_DIR}/backend/optimizer/common/visit.cc
|
||||
${CCSRC_DIR}/backend/optimizer/common/optimizer.cc
|
||||
)
|
||||
else(BUILD_CONVERTER)
|
||||
else(ENABLE_CONVERTER)
|
||||
set(TEST_LITE_SRC ${LITE_DIR}/src/common/log_adapter.cc)
|
||||
add_compile_definitions(USE_ANDROID_LOG)
|
||||
endif()
|
||||
|
@ -150,7 +150,7 @@ if (SUPPORT_GPU)
|
|||
)
|
||||
endif()
|
||||
### converter
|
||||
if(BUILD_CONVERTER)
|
||||
if(ENABLE_CONVERTER)
|
||||
add_definitions(-DPRIMITIVE_WRITEABLE)
|
||||
add_definitions(-DUSE_GLOG)
|
||||
file(GLOB_RECURSE TEST_CASE_TFLITE_PARSERS_SRC
|
||||
|
@ -264,20 +264,17 @@ if (PLATFORM_ARM64)
|
|||
target_link_libraries(lite-test mslite_internal)
|
||||
endif()
|
||||
|
||||
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
|
||||
target_link_libraries(lite-test log)
|
||||
endif()
|
||||
|
||||
if (BUILD_MINDDATA STREQUAL "lite")
|
||||
target_link_libraries(lite-test
|
||||
minddata_eager_mid
|
||||
minddata_eager_mid
|
||||
minddata-lite
|
||||
)
|
||||
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
|
||||
target_link_libraries(lite-test log)
|
||||
endif()
|
||||
elseif(BUILD_MINDDATA STREQUAL "full")
|
||||
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
|
||||
target_link_libraries(lite-test log)
|
||||
endif()
|
||||
endif()
|
||||
if (BUILD_CONVERTER)
|
||||
if (ENABLE_CONVERTER)
|
||||
target_link_libraries(lite-test
|
||||
anf_importer_mid
|
||||
anf_exporter_mid
|
||||
|
@ -287,13 +284,13 @@ if (BUILD_CONVERTER)
|
|||
graph_pass_mid
|
||||
fusion_mid
|
||||
quantizer_mid
|
||||
proto_mid
|
||||
pthread
|
||||
mindspore::protobuf
|
||||
mindspore::eigen
|
||||
mindspore::json
|
||||
mindspore_core
|
||||
mindspore::glog
|
||||
${SECUREC_LIBRARY}
|
||||
)
|
||||
else(BUILD_CONVERTER)
|
||||
target_link_libraries(lite-test log)
|
||||
endif()
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
#include "mindspore/lite/schema/inner/model_generated.h"
|
||||
#include "schema/inner/model_generated.h"
|
||||
#include "mindspore/lite/include/model.h"
|
||||
#include "common/common_test.h"
|
||||
#include "include/lite_session.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "common/common_test.h"
|
||||
#include "nnacl/pad_parameter.h"
|
||||
#include "mindspore/lite/src/kernel_registry.h"
|
||||
#include "mindspore/lite/schema/ops_generated.h"
|
||||
#include "schema/ops_generated.h"
|
||||
|
||||
using mindspore::schema::Format_NHWC;
|
||||
using mindspore::schema::PaddingMode;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "common/common_test.h"
|
||||
#include "nnacl/resize_parameter.h"
|
||||
#include "mindspore/lite/src/kernel_registry.h"
|
||||
#include "mindspore/lite/schema/ops_generated.h"
|
||||
#include "schema/ops_generated.h"
|
||||
using mindspore::schema::Format_NHWC;
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "common/common_test.h"
|
||||
#include "nnacl/pad_parameter.h"
|
||||
#include "mindspore/lite/src/kernel_registry.h"
|
||||
#include "mindspore/lite/schema/ops_generated.h"
|
||||
#include "schema/ops_generated.h"
|
||||
#include "nnacl/fp32/scale.h"
|
||||
|
||||
using mindspore::schema::ActivationType;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
#include "mindspore/lite/schema/inner/model_generated.h"
|
||||
#include "schema/inner/model_generated.h"
|
||||
#include "mindspore/lite/include/train_model.h"
|
||||
#include "common/common_test.h"
|
||||
#include "include/train_session.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
#include "mindspore/lite/schema/inner/model_generated.h"
|
||||
#include "schema/inner/model_generated.h"
|
||||
#include "mindspore/lite/include/model.h"
|
||||
#include "common/common_test.h"
|
||||
#include "include/lite_session.h"
|
||||
|
|
Loading…
Reference in New Issue