Commit 77fb5b4e authored by Artur Wojcik's avatar Artur Wojcik Committed by Scott Cyphers

[ONNX] CentOS disable unit tests (#1469)

* add detection of Linux distribution
Signed-off-by: 's avatarArtur Wojcik <artur.wojcik@intel.com>

* onnx: disable ONNX unit-tests if CentOS detected (temporar solution)
Signed-off-by: 's avatarArtur Wojcik <artur.wojcik@intel.com>

* onnx: correct DISTRIB_ID name for CentOS
Signed-off-by: 's avatarArtur Wojcik <artur.wojcik@intel.com>
parent 52043f64
...@@ -102,6 +102,10 @@ endif() ...@@ -102,6 +102,10 @@ endif()
# Installation logic... # Installation logic...
#----------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------
if (NOT APPLE AND NOT WIN32)
include(cmake/platform.cmake)
endif()
if (DEFINED NGRAPH_INSTALL_PREFIX) if (DEFINED NGRAPH_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX ${NGRAPH_INSTALL_PREFIX}) set(CMAKE_INSTALL_PREFIX ${NGRAPH_INSTALL_PREFIX})
endif() endif()
......
# ******************************************************************************
# Copyright 2017-2018 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.
# ******************************************************************************
if (EXISTS "/etc/lsb-release")
file(STRINGS "/etc/lsb-release" __lsb_release_file_content)
foreach(__line ${__lsb_release_file_content})
string(STRIP "${__line}" __line)
string(REGEX MATCH "^(.+)=(.*)$" __lsb_release_values_check ${__line})
set(${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
endforeach()
elseif (EXISTS "/etc/os-release")
file(STRINGS "/etc/os-release" __os_release_file_content)
foreach(__line ${__os_release_file_content})
string(STRIP "${__line}" __line)
string(REGEX MATCH "^(.+)=(.*)$" __os_release_values_check ${__line})
string(REPLACE "\"" "" __variable_value ${CMAKE_MATCH_2})
set(__${CMAKE_MATCH_1} ${__variable_value})
endforeach()
set(DISTRIB_ID ${__NAME})
set(DISTRIB_CODENAME ${__VERSION_CODENAME})
set(DISTRIB_RELEASE ${__VERSION_ID})
set(DISTRIB_DESCRIPTION ${__PRETTY_NAME})
else()
unset(DISTRIB_ID "?unknown?")
unset(DISTRIB_CODENAME)
unset(DISTRIB_RELEASE)
unset(DISTRIB_DESCRIPTION)
endif()
...@@ -47,7 +47,15 @@ set(SRC ...@@ -47,7 +47,15 @@ set(SRC
) )
if (NGRAPH_ONNX_IMPORT_ENABLE) if (NGRAPH_ONNX_IMPORT_ENABLE)
if (APPLE OR WIN32)
list(APPEND SRC onnx_import.cpp) list(APPEND SRC onnx_import.cpp)
else()
# ONNX unit tests temporarly disabled if CentOS detected
# (Protobuf issue with interpreting messages)
if (NOT ${DISTRIB_ID} STREQUAL "CentOS Linux")
list(APPEND SRC onnx_import.cpp)
endif()
endif()
endif() endif()
if (NGRAPH_INTERPRETER_ENABLE) if (NGRAPH_INTERPRETER_ENABLE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment