Browse Source

!95 update cmakelists

Merge pull request !95 from taoxiangdong/master
tags/v1.1.0
lujiale Gitee 4 years ago
parent
commit
8d7dbd961d
10 changed files with 62 additions and 12 deletions
  1. +1
    -1
      CMakeLists.txt
  2. +1
    -1
      build.sh
  3. +1
    -1
      cmake/external_libs/protobuf_shared.cmake
  4. +38
    -1
      ge/CMakeLists.txt
  5. +1
    -0
      ge/executor/CMakeLists.txt
  6. +5
    -0
      ge/ge_local_engine/CMakeLists.txt
  7. +1
    -0
      ge/graph/build/memory/CMakeLists.txt
  8. +5
    -0
      ge/host_cpu_engine/CMakeLists.txt
  9. +1
    -0
      ge/plugin/engine/CMakeLists.txt
  10. +8
    -8
      third_party/patch/securec/0001-add-securec-cmake-script.patch

+ 1
- 1
CMakeLists.txt View File

@@ -22,7 +22,7 @@ if (ENABLE_OPEN_SRC)

# for CPU/GPU mode, find c_sec and slog from local prebuild
if(NOT ENABLE_D AND NOT GE_ONLY)
set(GE_PREBUILD_PATH ${GE_SOURCE_DIR}/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR})
set(GE_PREBUILD_PATH ${GE_CODE_DIR}/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR})
find_module(slog libslog.so ${GE_PREBUILD_PATH})
# if D_LINK_PATH is set in environment variables, search libraries in given path
elseif(DEFINED ENV{D_LINK_PATH})


+ 1
- 1
build.sh View File

@@ -117,7 +117,7 @@ build_graphengine()
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GE_ST=ON"
fi

CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_OPEN_SRC=True
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_OPEN_SRC=True"
echo "${CMAKE_ARGS}"
cmake ${CMAKE_ARGS} ../..
make ${VERBOSE} -j${THREAD_NUM}


+ 1
- 1
cmake/external_libs/protobuf_shared.cmake View File

@@ -16,7 +16,7 @@ set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
ExternalProject_Add(protobuf_build
URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
#URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz
#SOURCE_DIR ${GE_CODE_DIR}/third_party/protobuf/src/protobuf-3.8.0
#SOURCE_DIR ${GE_CODE_DIR}/../third_party/protobuf/src/protobuf-3.8.0
DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${GE_CODE_DIR}/../third_party/protobuf/src/protobuf-3.8.0 <SOURCE_DIR>
#CONFIGURE_COMMAND ${CMAKE_COMMAND}
#-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}


+ 38
- 1
ge/CMakeLists.txt View File

@@ -4,7 +4,7 @@ add_subdirectory(graph/build/memory)
add_subdirectory(ge_local_engine)
add_subdirectory(host_cpu_engine)
add_subdirectory(executor)
#add_subdirectory(offline)
add_subdirectory(offline)

set(PROTO_LIST
"${METADEF_DIR}/proto/fusion_model.proto"
@@ -704,6 +704,42 @@ target_link_libraries(ge_compiler
-ldl
)

############ libascendcl.so ############
add_library(opensrc_ascendc SHARED ${DUMMY_OBJ})

target_link_libraries(opensrc_ascendcl PRIVATE
-Wl, --whole-archive
ge_executor
ascendcl_static
ge_common_static
graph_static
protobuf_static
register_static
error_manager_static
adump_server
msprofiler
-Wl, --no-whole-archive
-Wl, --no-as-needed
c_sec
runtime
mmpa
slog
msprof
ascend_hal_stub
-Wl, --as-needed
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME}, Android>>:-lrt>
-ldl
$<$<STREQUAL:${TARGET_SYSTEM_NAME}, Android>:-llog>
json
)

set_target_properties(opensrc_ascendc PROPERTIES
OUTPUT_NAME ascendcl
)

file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/dummy.c CONTENT "")
add_library(dummy_obj OBJECT ${CMAKE_BINARY_DIR}/dummy.c)
set(DUMMY_OBJ $<TARGET_OBJECTS:dummy_obj>)

##################################################################
add_custom_command(
@@ -786,6 +822,7 @@ target_include_directories(fwk_stub_ge_runner PRIVATE
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/inc/framework/common
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/graph
#### yellow zone ####


+ 1
- 0
ge/executor/CMakeLists.txt View File

@@ -90,6 +90,7 @@ target_include_directories(ge_executor PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph


+ 5
- 0
ge/ge_local_engine/CMakeLists.txt View File

@@ -34,6 +34,7 @@ target_include_directories(ge_local_engine PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -73,6 +74,7 @@ target_include_directories(atc_ge_local_engine PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -113,6 +115,7 @@ target_include_directories(ge_local_opskernel_builder PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -147,6 +150,7 @@ target_include_directories(atc_ge_local_opskernel_builder PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -186,6 +190,7 @@ target_include_directories(ge_local_opskernel_builder_static PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph


+ 1
- 0
ge/graph/build/memory/CMakeLists.txt View File

@@ -31,6 +31,7 @@ target_include_directories(ge_memory PRIVATE
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
#### yellow zone ####
${GE_CODE_DIR}/../inc
)

+ 5
- 0
ge/host_cpu_engine/CMakeLists.txt View File

@@ -28,6 +28,7 @@ target_include_directories(host_cpu_engine PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -66,6 +67,7 @@ target_include_directories(atc_host_cpu_engine PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -105,6 +107,7 @@ target_include_directories(host_cpu_opskernel_builder PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -138,6 +141,7 @@ target_include_directories(atc_host_cpu_opskernel_builder PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
@@ -176,6 +180,7 @@ target_include_directories(host_cpu_opskernel_builder_static PRIVATE
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph


+ 1
- 0
ge/plugin/engine/CMakeLists.txt View File

@@ -21,6 +21,7 @@ target_include_directories(engine PRIVATE
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/inc/framework/common
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/third_party/fwkacllib/inc
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${CMAKE_BINARY_DIR}


+ 8
- 8
third_party/patch/securec/0001-add-securec-cmake-script.patch View File

@@ -1,4 +1,4 @@
From f568b2731ac5356673e43361d718bb12704e05a9 Mon Sep 17 00:00:00 2001
From 455c9812d70646fe725896d597d6c953bf5a09ac Mon Sep 17 00:00:00 2001
From: taoxiangdong <taoxiangdong1@huawei.com>
Date: Wed, 14 Oct 2020 22:14:01 +0800
Subject: [PATCH] add securec cmake script
@@ -10,15 +10,15 @@ Subject: [PATCH] add securec cmake script

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755
index 0000000..7d59953
index 0000000..9b91fb2
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,86 @@
+cmake_minimum_required(VERSION 3.14)
+project (Securec)
+project(Securec)
+file(GLOB SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
+ "src/vsprintf_s.c"
+ "src/wmemmove_s"
+ "src/wmemmove_s.c"
+ "src/strncat_s.c"
+ "src/vsnprintf_s.c"
+ "src/fwscanf_s.c"
@@ -59,7 +59,7 @@ index 0000000..7d59953
+ )
+
+include_directories(./include)
+include_directories(../src)
+include_directories(./src)
+add_library(shared_c_sec SHARED ${SRC_LIST})
+
+target_compile_options(shared_c_sec PRIVATE
@@ -71,7 +71,7 @@ index 0000000..7d59953
+target_compile_definitions(shared_c_sec PRIVATE
+ NDEBUG
+ SECUREC_SUPPORT_STRTOLD=1
+)
+ )
+
+add_library(static_c_sec STATIC ${SRC_LIST})
+
@@ -82,10 +82,10 @@ index 0000000..7d59953
+ -O1
+)
+
+target_compile_options(static_c_sec PRIVATE
+target_compile_definitions(static_c_sec PRIVATE
+ NDEBUG
+ SECUREC_SUPPORT_STRTOLD=1
+)
+ )
+
+set_target_properties(static_c_sec
+ PROPERTIES


Loading…
Cancel
Save