summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-devtools/ngraph/ngraph/0001-ngraph-compile-for-DLDT-R2.patch141
-rw-r--r--recipes-devtools/ngraph/ngraph_0.22.1.bb23
2 files changed, 164 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 @@
1From 73e9f605f8ce28c3ef9461c3a85d7dfe7814b867 Mon Sep 17 00:00:00 2001
2From: Erin Park <erin.park@intel.com>
3Date: Wed, 11 Sep 2019 11:15:13 +0800
4Subject: [PATCH] ngraph compile for DLDT R2
5
6Upstream-Status: Pending [Taken from Clear Linux with changes to install
7binaries/headers to generic locations]
8Signed-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
16diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
17index 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")
41diff --git a/src/ngraph.cmake b/src/ngraph.cmake
42new file mode 100644
43index 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+
101diff --git a/src/ngraph/CMakeLists.txt b/src/ngraph/CMakeLists.txt
102index 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--
1402.21.0
141
diff --git a/recipes-devtools/ngraph/ngraph_0.22.1.bb b/recipes-devtools/ngraph/ngraph_0.22.1.bb
new file mode 100644
index 00000000..fa6427b3
--- /dev/null
+++ b/recipes-devtools/ngraph/ngraph_0.22.1.bb
@@ -0,0 +1,23 @@
1SUMMARY = "nGraph Compiler Stack"
2DESCRIPTION = "nGraph Compiler aims to accelerate developing AI workloads using \
3any deep learning framework and deploying to a variety of \
4hardware targets."
5HOMEPAGE = "https://www.ngraph.ai"
6
7SRC_URI = "git://github.com/NervanaSystems/ngraph.git;protocol=https;branch=r0.22 \
8 file://0001-ngraph-compile-for-DLDT-R2.patch;striplevel=2 \
9 "
10
11SRCREV = "6818cc5fae57a46d8558c9fd112e04c57a35e0fa"
12
13LICENSE = "Apache-2.0"
14LIC_FILES_CHKSUM = "file://../LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
15
16S = "${WORKDIR}/git/src"
17
18inherit cmake
19
20OECMAKE_GENERATOR = "Unix Makefiles"
21
22FILES_${PN}-dev = "${includedir}"
23FILES_${PN} += "${libdir}/libngraph.so"