From ec5c324ae8f1e7b3da574267d4533c758a3ecfcf Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Tue, 7 Apr 2020 22:26:00 +0800 Subject: ngraph: upgrade 0.22.1 -> 2.29.0-rc0 Signed-off-by: Anuj Mittal --- .../0001-install-cmake-modules-correctly.patch | 54 ++++++++ .../ngraph/0001-ngraph-compile-for-DLDT-R2.patch | 141 --------------------- recipes-devtools/ngraph/ngraph_0.22.1.bb | 23 ---- recipes-devtools/ngraph/ngraph_0.29.0-rc0.bb | 34 +++++ 4 files changed, 88 insertions(+), 164 deletions(-) create mode 100644 recipes-devtools/ngraph/ngraph/0001-install-cmake-modules-correctly.patch delete mode 100644 recipes-devtools/ngraph/ngraph/0001-ngraph-compile-for-DLDT-R2.patch delete mode 100644 recipes-devtools/ngraph/ngraph_0.22.1.bb create mode 100644 recipes-devtools/ngraph/ngraph_0.29.0-rc0.bb diff --git a/recipes-devtools/ngraph/ngraph/0001-install-cmake-modules-correctly.patch b/recipes-devtools/ngraph/ngraph/0001-install-cmake-modules-correctly.patch new file mode 100644 index 00000000..c8e5095f --- /dev/null +++ b/recipes-devtools/ngraph/ngraph/0001-install-cmake-modules-correctly.patch @@ -0,0 +1,54 @@ +From a03058ed605345cce9d7f0cd98f7c3696c3d7c51 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Tue, 7 Apr 2020 13:44:37 +0800 +Subject: [PATCH] fix installation of cmake modules + +Make sure that cmake files are installed correctly and don't install +license files. + +Upstream-Status: Pending + +Signed-off-by: Anuj Mittal +--- + CMakeLists.txt | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 604daa0e45..b60a013b86 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -667,12 +667,12 @@ if (NGRAPH_EXPORT_TARGETS_ENABLE) + install(EXPORT ngraphTargets + FILE ngraphTargets.cmake + NAMESPACE ngraph:: +- DESTINATION cmake ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph + COMPONENT ngraph) + + configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/share/ngraphConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfig.cmake +- INSTALL_DESTINATION cmake) ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph) + + write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ngraphConfigVersion.cmake + VERSION ${NGRAPH_VERSION} +@@ -680,14 +680,8 @@ if (NGRAPH_EXPORT_TARGETS_ENABLE) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfigVersion.cmake +- DESTINATION cmake ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph + COMPONENT ngraph) + endif() + +-install(DIRECTORY +- ${CMAKE_CURRENT_SOURCE_DIR}/licenses +- DESTINATION "." +- COMPONENT ngraph +-) +-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION "." COMPONENT ngraph) +-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION "." COMPONENT ngraph) ++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ngraph COMPONENT ngraph) +-- +2.25.2 + 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 deleted file mode 100644 index fcc2a849..00000000 --- a/recipes-devtools/ngraph/ngraph/0001-ngraph-compile-for-DLDT-R2.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 73e9f605f8ce28c3ef9461c3a85d7dfe7814b867 Mon Sep 17 00:00:00 2001 -From: Erin Park -Date: Wed, 11 Sep 2019 11:15:13 +0800 -Subject: [PATCH] ngraph compile for DLDT R2 - -Upstream-Status: Pending [Taken from Clear Linux with changes to install -binaries/headers to generic locations] -Signed-off-by: Anuj Mittal ---- - src/CMakeLists.txt | 8 ++++-- - src/ngraph.cmake | 54 +++++++++++++++++++++++++++++++++++++++ - src/ngraph/CMakeLists.txt | 21 +++++++++++---- - 3 files changed, 76 insertions(+), 7 deletions(-) - create mode 100644 src/ngraph.cmake - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index c791436d7..c18473572 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -14,14 +14,18 @@ - # limitations under the License. - # ****************************************************************************** - -+cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR) -+ -+project(ngraph) -+ -+include(ngraph.cmake) -+ - add_definitions(-DIN_NGRAPH_LIBRARY) - - include_directories(ngraph) - - add_subdirectory(resource) - --add_subdirectory(ngraph) -- - if (NGRAPH_TOOLS_ENABLE) - add_subdirectory(tools) - message(STATUS "tools enabled") -diff --git a/src/ngraph.cmake b/src/ngraph.cmake -new file mode 100644 -index 000000000..a0060e08e ---- /dev/null -+++ b/src/ngraph.cmake -@@ -0,0 +1,54 @@ -+# ****************************************************************************** -+# Copyright 2017-2019 Intel Corporation -+# -+# 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. -+# ****************************************************************************** -+ -+set (CMAKE_CXX_STANDARD 11) -+set (CMAKE_CXX_STANDARD_REQUIRED ON) -+if (NOT("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) -+ set (CMAKE_CXX_FLAGS "-std=c11 ${CMAKE_CXX_FLAGS}") -+endif() -+if (WIN32) -+ add_definitions(-DNOMINMAX) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0 /EHsc /MP") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS") -+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308") -+endif() -+ -+set(NGRAPH_TOOLS_ENABLE FALSE) -+set(NGRAPH_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ngraph") -+include_directories("${CMAKE_CURRENT_SOURCE_DIR}" -+ "${NGRAPH_SOURCE_DIR}") -+ -+add_definitions(-DPROJECT_ROOT_DIR="${NGRAPH_SOURCE_DIR}") -+ -+set(NGRAPH_INSTALL_LIB "${CMAKE_INSTALL_PREFIX}") -+ -+if (HAS_MAYBE_UNINITIALIZED) -+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-uninitialized") -+ else() -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized -Wno-return-type") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-maybe-uninitialized -Wno-return-type") -+ endif() -+endif() -+# WA for GCC 7.0 -+if (UNIX) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type") -+endif() -+add_subdirectory(${NGRAPH_SOURCE_DIR}) -+ -diff --git a/src/ngraph/CMakeLists.txt b/src/ngraph/CMakeLists.txt -index 2a9b84549..781855941 100644 ---- a/src/ngraph/CMakeLists.txt -+++ b/src/ngraph/CMakeLists.txt -@@ -574,17 +574,28 @@ endif() - #----------------------------------------------------------------------------------------------- - - # nGraph --install(FILES ${CMAKE_BINARY_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}) --install(TARGETS ngraph DESTINATION ${NGRAPH_INSTALL_LIB}) # libngraph.so -+#install(FILES ${CMAKE_BINARY_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}) -+#install(TARGETS ngraph DESTINATION ${NGRAPH_INSTALL_LIB}) # libngraph.so -+#install(DIRECTORY -+# ${CMAKE_CURRENT_SOURCE_DIR}/ -+# DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph" -+# FILES_MATCHING -+# PATTERN "*.hpp" -+# PATTERN "*.h" -+#) -+#install(FILES ${CMAKE_BINARY_DIR}/src/ngraph/version.hpp -+# DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph") -+ -+install(TARGETS ngraph DESTINATION ${CMAKE_INSTALL_LIBDIR}) # libngraph.so - install(DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/ -- DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph" -+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ngraph" - FILES_MATCHING - PATTERN "*.hpp" - PATTERN "*.h" - ) --install(FILES ${CMAKE_BINARY_DIR}/src/ngraph/version.hpp -- DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph") -+install(FILES ${CMAKE_BINARY_DIR}/ngraph/version.hpp -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ngraph) - - set(CPACK_GENERATOR "DEB") - set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) --- -2.21.0 - diff --git a/recipes-devtools/ngraph/ngraph_0.22.1.bb b/recipes-devtools/ngraph/ngraph_0.22.1.bb deleted file mode 100644 index fa6427b3..00000000 --- a/recipes-devtools/ngraph/ngraph_0.22.1.bb +++ /dev/null @@ -1,23 +0,0 @@ -SUMMARY = "nGraph Compiler Stack" -DESCRIPTION = "nGraph Compiler aims to accelerate developing AI workloads using \ -any deep learning framework and deploying to a variety of \ -hardware targets." -HOMEPAGE = "https://www.ngraph.ai" - -SRC_URI = "git://github.com/NervanaSystems/ngraph.git;protocol=https;branch=r0.22 \ - file://0001-ngraph-compile-for-DLDT-R2.patch;striplevel=2 \ - " - -SRCREV = "6818cc5fae57a46d8558c9fd112e04c57a35e0fa" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://../LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" - -S = "${WORKDIR}/git/src" - -inherit cmake - -OECMAKE_GENERATOR = "Unix Makefiles" - -FILES_${PN}-dev = "${includedir}" -FILES_${PN} += "${libdir}/libngraph.so" diff --git a/recipes-devtools/ngraph/ngraph_0.29.0-rc0.bb b/recipes-devtools/ngraph/ngraph_0.29.0-rc0.bb new file mode 100644 index 00000000..e0170681 --- /dev/null +++ b/recipes-devtools/ngraph/ngraph_0.29.0-rc0.bb @@ -0,0 +1,34 @@ +SUMMARY = "nGraph Compiler Stack" +DESCRIPTION = "nGraph Compiler aims to accelerate developing AI workloads using \ +any deep learning framework and deploying to a variety of \ +hardware targets." +HOMEPAGE = "https://www.ngraph.ai" + +SRC_URI = "git://github.com/NervanaSystems/ngraph.git;protocol=https \ + file://0001-install-cmake-modules-correctly.patch \ + " + +SRCREV = "b8419c354e5fc70805f1501d7dfff533ac790bec" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +S = "${WORKDIR}/git" + +inherit cmake + +OECMAKE_GENERATOR = "Unix Makefiles" + +EXTRA_OECMAKE += " \ + -DNGRAPH_CPU_ENABLE=FALSE \ + -DNGRAPH_UNIT_TEST_ENABLE=FALSE \ + -DNGRAPH_TEST_UTIL_ENABLE=FALSE \ + -DNGRAPH_INTERPRETER_ENABLE=FALSE \ + -DNGRAPH_JSON_ENABLE=FALSE \ + -DNGRAPH_NATIVE_ARCH_ENABLE=FALSE \ + -DNGRAPH_TOOLS_ENABLE=FALSE \ + -DNGRAPH_NOP_ENABLE=FALSE \ + -DNGRAPH_GENERIC_CPU_ENABLE=FALSE \ + -DNGRAPH_LIB_VERSIONING_ENABLE=TRUE \ + -DNGRAPH_CURRENT_RELEASE_TAG=0.29.0-rc0 \ + " -- cgit v1.2.3-54-g00ecf