fix compile bug in testcase and package

This commit is contained in:
hangq 2020-10-12 17:03:05 +08:00
parent d7b4a0d611
commit 94132b1aeb
9 changed files with 24 additions and 26 deletions

View File

@ -655,7 +655,7 @@ build_lite()
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="arm64-v8a" -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \ -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} \ -DANDROID_STL="c++_static" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
-DPLATFORM_ARM64=on -DENABLE_NEON=on -DENABLE_FP16="off" \ -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} \ -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} \ -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} \ -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_NDK="${ANDROID_NDK}" -DANDROID_ABI="armeabi-v7a" -DANDROID_TOOLCHAIN_NAME="clang" \
-DANDROID_STL="c++_static" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DANDROID_STL="c++_static" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DPLATFORM_ARM32=on -DENABLE_NEON=on -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \ -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} \ -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} \ -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} \ -DMS_VERSION_MINOR=${VERSION_MINOR} -DMS_VERSION_REVISION=${VERSION_REVISION} -DENABLE_VERBOSE=${ENABLE_VERBOSE} \
"${BASEPATH}/mindspore/lite" "${BASEPATH}/mindspore/lite"
else else
cmake -DPLATFORM_ARM64=off -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \ 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} \ -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 \ -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} \ -DMS_VERSION_MAJOR=${VERSION_MAJOR} -DMS_VERSION_MINOR=${VERSION_MINOR} -DMS_VERSION_REVISION=${VERSION_REVISION} \

View File

@ -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/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(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/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-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(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}) 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/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(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/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}) install(DIRECTORY ${flatbuffers_INC} DESTINATION ${FLATBF_DIR} COMPONENT ${COMPONENT_NAME})
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH) 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}) install(FILES ${TOP_DIR}/build/mindspore/tools/converter/libconverter_parser.a DESTINATION ${TOP_DIR}/build/mindspore/package COMPONENT ${PARSER_NAME})
else () 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/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(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(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}) install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so DESTINATION ${LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME})

View File

@ -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_C_FLAGS "${CMAKE_C_FLAGS}")
STRING(REPLACE " -fvisibility=hidden " " -fvisibility=default " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") STRING(REPLACE " -fvisibility=hidden " " -fvisibility=default " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
if(BUILD_CONVERTER) if(ENABLE_CONVERTER)
set(CCSRC_SRC set(CCSRC_SRC
## ccsrc ## ccsrc
${CCSRC_DIR}/backend/optimizer/common/pattern_engine.cc ${CCSRC_DIR}/backend/optimizer/common/pattern_engine.cc
${CCSRC_DIR}/backend/optimizer/common/visit.cc ${CCSRC_DIR}/backend/optimizer/common/visit.cc
${CCSRC_DIR}/backend/optimizer/common/optimizer.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) set(TEST_LITE_SRC ${LITE_DIR}/src/common/log_adapter.cc)
add_compile_definitions(USE_ANDROID_LOG) add_compile_definitions(USE_ANDROID_LOG)
endif() endif()
@ -150,7 +150,7 @@ if (SUPPORT_GPU)
) )
endif() endif()
### converter ### converter
if(BUILD_CONVERTER) if(ENABLE_CONVERTER)
add_definitions(-DPRIMITIVE_WRITEABLE) add_definitions(-DPRIMITIVE_WRITEABLE)
add_definitions(-DUSE_GLOG) add_definitions(-DUSE_GLOG)
file(GLOB_RECURSE TEST_CASE_TFLITE_PARSERS_SRC file(GLOB_RECURSE TEST_CASE_TFLITE_PARSERS_SRC
@ -264,20 +264,17 @@ if (PLATFORM_ARM64)
target_link_libraries(lite-test mslite_internal) target_link_libraries(lite-test mslite_internal)
endif() endif()
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
target_link_libraries(lite-test log)
endif()
if (BUILD_MINDDATA STREQUAL "lite") if (BUILD_MINDDATA STREQUAL "lite")
target_link_libraries(lite-test target_link_libraries(lite-test
minddata_eager_mid minddata_eager_mid
minddata-lite 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() endif()
if (BUILD_CONVERTER) if (ENABLE_CONVERTER)
target_link_libraries(lite-test target_link_libraries(lite-test
anf_importer_mid anf_importer_mid
anf_exporter_mid anf_exporter_mid
@ -287,13 +284,13 @@ if (BUILD_CONVERTER)
graph_pass_mid graph_pass_mid
fusion_mid fusion_mid
quantizer_mid quantizer_mid
proto_mid
pthread pthread
mindspore::protobuf mindspore::protobuf
mindspore::eigen mindspore::eigen
mindspore::json mindspore::json
mindspore_core mindspore_core
mindspore::glog mindspore::glog
${SECUREC_LIBRARY}
) )
else(BUILD_CONVERTER)
target_link_libraries(lite-test log)
endif() endif()

View File

@ -16,7 +16,7 @@
#include <cmath> #include <cmath>
#include <memory> #include <memory>
#include "mindspore/lite/schema/inner/model_generated.h" #include "schema/inner/model_generated.h"
#include "mindspore/lite/include/model.h" #include "mindspore/lite/include/model.h"
#include "common/common_test.h" #include "common/common_test.h"
#include "include/lite_session.h" #include "include/lite_session.h"

View File

@ -19,7 +19,7 @@
#include "common/common_test.h" #include "common/common_test.h"
#include "nnacl/pad_parameter.h" #include "nnacl/pad_parameter.h"
#include "mindspore/lite/src/kernel_registry.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::Format_NHWC;
using mindspore::schema::PaddingMode; using mindspore::schema::PaddingMode;

View File

@ -19,7 +19,7 @@
#include "common/common_test.h" #include "common/common_test.h"
#include "nnacl/resize_parameter.h" #include "nnacl/resize_parameter.h"
#include "mindspore/lite/src/kernel_registry.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::Format_NHWC;
namespace mindspore { namespace mindspore {

View File

@ -19,7 +19,7 @@
#include "common/common_test.h" #include "common/common_test.h"
#include "nnacl/pad_parameter.h" #include "nnacl/pad_parameter.h"
#include "mindspore/lite/src/kernel_registry.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" #include "nnacl/fp32/scale.h"
using mindspore::schema::ActivationType; using mindspore::schema::ActivationType;

View File

@ -22,7 +22,7 @@
#include <string> #include <string>
#include <functional> #include <functional>
#include "mindspore/lite/schema/inner/model_generated.h" #include "schema/inner/model_generated.h"
#include "mindspore/lite/include/train_model.h" #include "mindspore/lite/include/train_model.h"
#include "common/common_test.h" #include "common/common_test.h"
#include "include/train_session.h" #include "include/train_session.h"

View File

@ -16,7 +16,7 @@
#include <cmath> #include <cmath>
#include <memory> #include <memory>
#include "mindspore/lite/schema/inner/model_generated.h" #include "schema/inner/model_generated.h"
#include "mindspore/lite/include/model.h" #include "mindspore/lite/include/model.h"
#include "common/common_test.h" #include "common/common_test.h"
#include "include/lite_session.h" #include "include/lite_session.h"