commit
785a9a630b
@ -0,0 +1,60 @@
|
||||
if (HAVE_GTEST)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR
|
||||
(${CMAKE_INSTALL_PREFIX} STREQUAL "C:/Program Files (x86)/ascend"))
|
||||
set(CMAKE_INSTALL_PREFIX ${GE_CODE_DIR}/output CACHE STRING "path for install()" FORCE)
|
||||
message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.")
|
||||
endif()
|
||||
|
||||
if (ENABLE_GITEE)
|
||||
set(REQ_URL "https://gitee.com/mirrors/googletest/repository/archive/release-1.8.0.tar.gz")
|
||||
set(MD5 "")
|
||||
else()
|
||||
set(REQ_URL "https://github.com/google/googletest/archive/release-1.8.0.tar.gz")
|
||||
set(MD5 "")
|
||||
endif ()
|
||||
|
||||
set (gtest_CXXFLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")
|
||||
set (gtest_CFLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")
|
||||
ExternalProject_Add(gtest_build
|
||||
URL ${REQ_URL}
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_FLAGS=${gtest_CXXFLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/gtest <SOURCE_DIR>
|
||||
-DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=TRUE -Dgtest_disable_pthreads=ON
|
||||
BUILD_COMMAND $(MAKE)
|
||||
INSTALL_COMMAND $(MAKE) install
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
set(GTEST_PKG_DIR ${CMAKE_INSTALL_PREFIX}/gtest)
|
||||
|
||||
file(MAKE_DIRECTORY ${GTEST_PKG_DIR}/include)
|
||||
|
||||
add_library(gtest SHARED IMPORTED)
|
||||
|
||||
set_target_properties(gtest PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_PKG_DIR}/lib/libgtest.so
|
||||
)
|
||||
|
||||
add_library(gtest_main SHARED IMPORTED)
|
||||
|
||||
set_target_properties(gtest_main PROPERTIES
|
||||
IMPORTED_LOCATION ${GTEST_PKG_DIR}/lib/libgtest_main.so
|
||||
)
|
||||
|
||||
target_include_directories(gtest INTERFACE ${GTEST_PKG_DIR}/include)
|
||||
target_include_directories(gtest_main INTERFACE ${GTEST_PKG_DIR}/include)
|
||||
|
||||
set(INSTALL_BASE_DIR "")
|
||||
set(INSTALL_LIBRARY_DIR lib)
|
||||
|
||||
install(FILES ${GTEST_PKG_DIR}/lib/libgtest.so ${GTEST_PKG_DIR}/lib/libgtest_main.so OPTIONAL
|
||||
DESTINATION ${INSTALL_LIBRARY_DIR})
|
||||
|
||||
add_dependencies(gtest gtest_build)
|
||||
|
||||
#set(HAVE_GFLAGS TRUE CACHE BOOL "gflags build add")
|
||||
set(HAVE_GTEST TRUE)
|
@ -0,0 +1,34 @@
|
||||
# Copyright 2019-2020 Huawei Technologies Co., Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ============================================================================
|
||||
|
||||
#cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(STUB_ERROR_MANAGER)
|
||||
|
||||
file(GLOB_RECURSE SRCS RELATIVE ${CMAKE_CURRENT_LIST_DIR}
|
||||
"src/error_manager_stub.cc"
|
||||
)
|
||||
|
||||
include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc)
|
||||
include_directories(${GE_CODE_DIR}/inc)
|
||||
include_directories(${GE_CODE_DIR}/inc/external)
|
||||
include_directories(${GE_CODE_DIR}/metadef/inc)
|
||||
include_directories(${GE_CODE_DIR}/inc/framework)
|
||||
include_directories(${GE_CODE_DIR}/metadef/inc/external)
|
||||
|
||||
add_library(error_manager_stub SHARED ${SRCS})
|
||||
target_link_libraries(error_manager_stub PRIVATE
|
||||
$<BUILD_INTERFACE:intf_pub>
|
||||
)
|
@ -0,0 +1,85 @@
|
||||
/**
|
||||
* Copyright 2019-2020 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "common/util/error_manager/error_manager.h"
|
||||
|
||||
ErrorManager &ErrorManager::GetInstance() {
|
||||
static ErrorManager instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief init
|
||||
/// @param [in] path: current so path
|
||||
/// @return int 0(success) -1(fail)
|
||||
///
|
||||
int ErrorManager::Init(std::string path) { return 0; }
|
||||
|
||||
///
|
||||
/// @brief Report error message
|
||||
/// @param [in] error_code: error code
|
||||
/// @param [in] args_map: parameter map
|
||||
/// @return int 0(success) -1(fail)
|
||||
///
|
||||
int ErrorManager::ReportErrMessage(std::string error_code, const std::map<std::string, std::string> &args_map) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief output error message
|
||||
/// @param [in] handle: print handle
|
||||
/// @return int 0(success) -1(fail)
|
||||
///
|
||||
int ErrorManager::OutputErrMessage(int handle) { return 0; }
|
||||
|
||||
///
|
||||
/// @brief output message
|
||||
/// @param [in] handle: print handle
|
||||
/// @return int 0(success) -1(fail)
|
||||
///
|
||||
int ErrorManager::OutputMessage(int handle) { return 0; }
|
||||
|
||||
///
|
||||
/// @brief Report error message
|
||||
/// @param [in] key: vector parameter key
|
||||
/// @param [in] value: vector parameter value
|
||||
///
|
||||
void ErrorManager::ATCReportErrMessage(std::string error_code, const std::vector<std::string> &key,
|
||||
const std::vector<std::string> &value) {
|
||||
}
|
||||
|
||||
///
|
||||
/// @brief report graph compile failed message such as error code and op_name in mstune case
|
||||
/// @param [in] msg: failed message map, key is error code, value is op_name
|
||||
/// @return int 0(success) -1(fail)
|
||||
///
|
||||
int ErrorManager::ReportMstuneCompileFailedMsg(const std::map<std::string, std::string> &msg) { return 0; }
|
||||
|
||||
///
|
||||
/// @brief save graph compile failed message from thread local map to global map
|
||||
/// @param [in] graph_name: graph name
|
||||
///
|
||||
void ErrorManager::SaveMstuneCompileFailedMsg(const std::string &graph_name) {}
|
||||
|
||||
///
|
||||
/// @brief get graph compile failed message in mstune case
|
||||
/// @param [in] graph_name: graph name
|
||||
/// @param [out] msg_map: failed message map, key is error code, value is op_name list
|
||||
/// @return int 0(success) -1(fail)
|
||||
///
|
||||
int ErrorManager::GetMstuneCompileFailedMsg(const std::string &graph_name, std::map<std::string, std::vector<std::string>> &msg_map) { return 0; }
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue