diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2019-09-11 12:25:56 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2019-09-13 09:28:53 +0800 |
commit | 420247ef2db5c08ade2a34d4170f8db8aa7bc439 (patch) | |
tree | d3fb665ac094d15b640a826c60d6eb4a52a7a5c9 /recipes-devtools/ngraph/ngraph | |
parent | 42eb1f0d3a1993699da21b45095b46ba3f8ee7a8 (diff) | |
download | meta-intel-420247ef2db5c08ade2a34d4170f8db8aa7bc439.tar.gz |
ngraph: add recipe
nGraph Library is an open-source C++ library and runtime/compiler suite
for Deep Learning ecosystem. For more details, see:
https://www.intel.ai/ngraph/
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'recipes-devtools/ngraph/ngraph')
-rw-r--r-- | recipes-devtools/ngraph/ngraph/0001-ngraph-compile-for-DLDT-R2.patch | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/recipes-devtools/ngraph/ngraph/0001-ngraph-compile-for-DLDT-R2.patch b/recipes-devtools/ngraph/ngraph/0001-ngraph-compile-for-DLDT-R2.patch new file mode 100644 index 00000000..fcc2a849 --- /dev/null +++ b/recipes-devtools/ngraph/ngraph/0001-ngraph-compile-for-DLDT-R2.patch | |||
@@ -0,0 +1,141 @@ | |||
1 | From 73e9f605f8ce28c3ef9461c3a85d7dfe7814b867 Mon Sep 17 00:00:00 2001 | ||
2 | From: Erin Park <erin.park@intel.com> | ||
3 | Date: Wed, 11 Sep 2019 11:15:13 +0800 | ||
4 | Subject: [PATCH] ngraph compile for DLDT R2 | ||
5 | |||
6 | Upstream-Status: Pending [Taken from Clear Linux with changes to install | ||
7 | binaries/headers to generic locations] | ||
8 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
9 | --- | ||
10 | src/CMakeLists.txt | 8 ++++-- | ||
11 | src/ngraph.cmake | 54 +++++++++++++++++++++++++++++++++++++++ | ||
12 | src/ngraph/CMakeLists.txt | 21 +++++++++++---- | ||
13 | 3 files changed, 76 insertions(+), 7 deletions(-) | ||
14 | create mode 100644 src/ngraph.cmake | ||
15 | |||
16 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
17 | index c791436d7..c18473572 100644 | ||
18 | --- a/src/CMakeLists.txt | ||
19 | +++ b/src/CMakeLists.txt | ||
20 | @@ -14,14 +14,18 @@ | ||
21 | # limitations under the License. | ||
22 | # ****************************************************************************** | ||
23 | |||
24 | +cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR) | ||
25 | + | ||
26 | +project(ngraph) | ||
27 | + | ||
28 | +include(ngraph.cmake) | ||
29 | + | ||
30 | add_definitions(-DIN_NGRAPH_LIBRARY) | ||
31 | |||
32 | include_directories(ngraph) | ||
33 | |||
34 | add_subdirectory(resource) | ||
35 | |||
36 | -add_subdirectory(ngraph) | ||
37 | - | ||
38 | if (NGRAPH_TOOLS_ENABLE) | ||
39 | add_subdirectory(tools) | ||
40 | message(STATUS "tools enabled") | ||
41 | diff --git a/src/ngraph.cmake b/src/ngraph.cmake | ||
42 | new file mode 100644 | ||
43 | index 000000000..a0060e08e | ||
44 | --- /dev/null | ||
45 | +++ b/src/ngraph.cmake | ||
46 | @@ -0,0 +1,54 @@ | ||
47 | +# ****************************************************************************** | ||
48 | +# Copyright 2017-2019 Intel Corporation | ||
49 | +# | ||
50 | +# Licensed under the Apache License, Version 2.0 (the "License"); | ||
51 | +# you may not use this file except in compliance with the License. | ||
52 | +# You may obtain a copy of the License at | ||
53 | +# | ||
54 | +# http://www.apache.org/licenses/LICENSE-2.0 | ||
55 | +# | ||
56 | +# Unless required by applicable law or agreed to in writing, software | ||
57 | +# distributed under the License is distributed on an "AS IS" BASIS, | ||
58 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
59 | +# See the License for the specific language governing permissions and | ||
60 | +# limitations under the License. | ||
61 | +# ****************************************************************************** | ||
62 | + | ||
63 | +set (CMAKE_CXX_STANDARD 11) | ||
64 | +set (CMAKE_CXX_STANDARD_REQUIRED ON) | ||
65 | +if (NOT("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) | ||
66 | + set (CMAKE_CXX_FLAGS "-std=c11 ${CMAKE_CXX_FLAGS}") | ||
67 | +endif() | ||
68 | +if (WIN32) | ||
69 | + add_definitions(-DNOMINMAX) | ||
70 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0 /EHsc /MP") | ||
71 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS") | ||
72 | + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) | ||
73 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308") | ||
74 | +endif() | ||
75 | + | ||
76 | +set(NGRAPH_TOOLS_ENABLE FALSE) | ||
77 | +set(NGRAPH_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ngraph") | ||
78 | +include_directories("${CMAKE_CURRENT_SOURCE_DIR}" | ||
79 | + "${NGRAPH_SOURCE_DIR}") | ||
80 | + | ||
81 | +add_definitions(-DPROJECT_ROOT_DIR="${NGRAPH_SOURCE_DIR}") | ||
82 | + | ||
83 | +set(NGRAPH_INSTALL_LIB "${CMAKE_INSTALL_PREFIX}") | ||
84 | + | ||
85 | +if (HAS_MAYBE_UNINITIALIZED) | ||
86 | + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||
87 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized") | ||
88 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-uninitialized") | ||
89 | + else() | ||
90 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized -Wno-return-type") | ||
91 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-maybe-uninitialized -Wno-return-type") | ||
92 | + endif() | ||
93 | +endif() | ||
94 | +# WA for GCC 7.0 | ||
95 | +if (UNIX) | ||
96 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type") | ||
97 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type") | ||
98 | +endif() | ||
99 | +add_subdirectory(${NGRAPH_SOURCE_DIR}) | ||
100 | + | ||
101 | diff --git a/src/ngraph/CMakeLists.txt b/src/ngraph/CMakeLists.txt | ||
102 | index 2a9b84549..781855941 100644 | ||
103 | --- a/src/ngraph/CMakeLists.txt | ||
104 | +++ b/src/ngraph/CMakeLists.txt | ||
105 | @@ -574,17 +574,28 @@ endif() | ||
106 | #----------------------------------------------------------------------------------------------- | ||
107 | |||
108 | # nGraph | ||
109 | -install(FILES ${CMAKE_BINARY_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
110 | -install(TARGETS ngraph DESTINATION ${NGRAPH_INSTALL_LIB}) # libngraph.so | ||
111 | +#install(FILES ${CMAKE_BINARY_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
112 | +#install(TARGETS ngraph DESTINATION ${NGRAPH_INSTALL_LIB}) # libngraph.so | ||
113 | +#install(DIRECTORY | ||
114 | +# ${CMAKE_CURRENT_SOURCE_DIR}/ | ||
115 | +# DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph" | ||
116 | +# FILES_MATCHING | ||
117 | +# PATTERN "*.hpp" | ||
118 | +# PATTERN "*.h" | ||
119 | +#) | ||
120 | +#install(FILES ${CMAKE_BINARY_DIR}/src/ngraph/version.hpp | ||
121 | +# DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph") | ||
122 | + | ||
123 | +install(TARGETS ngraph DESTINATION ${CMAKE_INSTALL_LIBDIR}) # libngraph.so | ||
124 | install(DIRECTORY | ||
125 | ${CMAKE_CURRENT_SOURCE_DIR}/ | ||
126 | - DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph" | ||
127 | + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ngraph" | ||
128 | FILES_MATCHING | ||
129 | PATTERN "*.hpp" | ||
130 | PATTERN "*.h" | ||
131 | ) | ||
132 | -install(FILES ${CMAKE_BINARY_DIR}/src/ngraph/version.hpp | ||
133 | - DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph") | ||
134 | +install(FILES ${CMAKE_BINARY_DIR}/ngraph/version.hpp | ||
135 | + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ngraph) | ||
136 | |||
137 | set(CPACK_GENERATOR "DEB") | ||
138 | set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
139 | -- | ||
140 | 2.21.0 | ||
141 | |||