diff --git a/inference-engine/cmake/FindlibGNA.cmake b/inference-engine/cmake/FindlibGNA.cmake index a32466102e1cb5..5968ec8624f7d7 100644 --- a/inference-engine/cmake/FindlibGNA.cmake +++ b/inference-engine/cmake/FindlibGNA.cmake @@ -14,50 +14,20 @@ endif () set(libGNA_FOUND TRUE) -set(GNA_KERNEL_LIB_NAME gna CACHE STRING "" FORCE) set(GNA_LIBS_LIST "libGNA::API" "libGNA::KERNEL") - -if (GNA_LIBRARY_VERSION STREQUAL "GNA1") - # use old version of GNA Library from gna_20181120 - if (WIN32) - set(GNA_LIB_DIR x64 CACHE STRING "" FORCE) - else () - list(APPEND GNA_LIBS_LIST - "libGNA::OLD_API_LIB") - set(GNA_LIB_DIR lib CACHE STRING "" FORCE) - set(GNA_KERNEL_LIB_NAME gna_kernel CACHE STRING "" FORCE) - endif() - set(libGNA_INCLUDE_DIRS "${GNA}/${GNA_PLATFORM_DIR}/include" CACHE STRING "" FORCE) -else() - # use current version of GNA library - set(GNA_LIB_DIR x64 CACHE STRING "" FORCE) - set(libGNA_INCLUDE_DIRS "${GNA}/include" CACHE STRING "" FORCE) -endif() -set(libGNA_LIBRARIES_BASE_PATH ${GNA}/${GNA_PLATFORM_DIR}/${GNA_LIB_DIR} CACHE STRING "" FORCE) +set(libGNA_LIBRARIES_BASE_PATH "${GNA}/${GNA_PLATFORM_DIR}/x64" CACHE STRING "" FORCE) add_library(libGNA::KERNEL SHARED IMPORTED) find_library(GNA_KERNEL_LIBRARY - ${GNA_KERNEL_LIB_NAME} + gna HINTS ${libGNA_LIBRARIES_BASE_PATH}) set_target_properties(libGNA::KERNEL PROPERTIES IMPORTED_LOCATION ${GNA_KERNEL_LIBRARY}) -if ((GNA_LIBRARY_VERSION STREQUAL "GNA1") AND (NOT WIN32)) - add_library(libGNA::OLD_API_LIB SHARED IMPORTED) - find_library(GNA_API_LIBRARY - gna_api - HINTS - ${libGNA_LIBRARIES_BASE_PATH}) - set_target_properties(libGNA::OLD_API_LIB PROPERTIES IMPORTED_LOCATION ${GNA_API_LIBRARY}) - target_link_libraries(libGNA::OLD_API_LIB INTERFACE libGNA::KERNEL) - set_target_properties(libGNA::OLD_API_LIB PROPERTIES IMPORTED_NO_SONAME TRUE) - set_target_properties(libGNA::KERNEL PROPERTIES IMPORTED_NO_SONAME TRUE) -endif() - add_library(libGNA::API INTERFACE IMPORTED) -set_property(TARGET libGNA::API PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${libGNA_INCLUDE_DIRS}) +set_property(TARGET libGNA::API PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GNA}/include") add_library(libGNA INTERFACE IMPORTED) foreach(_lib_name ${GNA_LIBS_LIST}) @@ -75,6 +45,6 @@ endforeach(_lib_name) if (WIN32) set_target_properties(libGNA::KERNEL PROPERTIES IMPORTED_IMPLIB ${GNA_KERNEL_LIBRARY}) -elseif(NOT GNA_LIBRARY_VERSION STREQUAL "GNA1") +else() set_target_properties(libGNA PROPERTIES INTERFACE_LINK_OPTIONS "-Wl,-rpath-link,${libGNA_LIBRARIES_BASE_PATH}") endif () diff --git a/inference-engine/cmake/check_features_ie.cmake b/inference-engine/cmake/check_features_ie.cmake index 9eccd8518f534e..c156c7a906e291 100644 --- a/inference-engine/cmake/check_features_ie.cmake +++ b/inference-engine/cmake/check_features_ie.cmake @@ -25,11 +25,6 @@ endif() if (ENABLE_GNA) add_definitions(-DENABLE_GNA) - - if (UNIX AND NOT APPLE AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4) - message(WARNING "${GNA_LIBRARY_VERSION} is not supported on GCC version ${CMAKE_CXX_COMPILER_VERSION}. Fallback to GNA1") - set(GNA_LIBRARY_VERSION GNA1) - endif() endif() if (ENABLE_SPEECH_DEMO) diff --git a/inference-engine/cmake/dependencies.cmake b/inference-engine/cmake/dependencies.cmake index 72bf2f99e9dbaa..fedec6e33c011b 100644 --- a/inference-engine/cmake/dependencies.cmake +++ b/inference-engine/cmake/dependencies.cmake @@ -274,22 +274,16 @@ if (ENABLE_GNA) GNA_LIB_DIR libGNA_INCLUDE_DIRS libGNA_LIBRARIES_BASE_PATH) - if (GNA_LIBRARY_VERSION STREQUAL "GNA1") - RESOLVE_DEPENDENCY(GNA - ARCHIVE_UNIFIED "GNA/gna_20181120.zip" - TARGET_PATH "${TEMP}/gna") - else() - if(GNA_LIBRARY_VERSION STREQUAL "GNA1_1401") - set(GNA_VERSION "01.00.00.1401") - endif() - if(GNA_LIBRARY_VERSION STREQUAL "GNA2") - set(GNA_VERSION "02.00.00.0925") - endif() - RESOLVE_DEPENDENCY(GNA - ARCHIVE_UNIFIED "GNA/GNA_${GNA_VERSION}.zip" - TARGET_PATH "${TEMP}/gna_${GNA_VERSION}" - VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*") + if(GNA_LIBRARY_VERSION STREQUAL "GNA1_1401") + set(GNA_VERSION "01.00.00.1401") + endif() + if(GNA_LIBRARY_VERSION STREQUAL "GNA2") + set(GNA_VERSION "02.00.00.0925") endif() + RESOLVE_DEPENDENCY(GNA + ARCHIVE_UNIFIED "GNA/GNA_${GNA_VERSION}.zip" + TARGET_PATH "${TEMP}/gna_${GNA_VERSION}" + VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*") update_deps_cache(GNA "${GNA}" "Path to GNA root folder") debug_message(STATUS "gna=" ${GNA}) endif() diff --git a/inference-engine/cmake/features_ie.cmake b/inference-engine/cmake/features_ie.cmake index 84f4c1daef42f1..102130ff6464e7 100644 --- a/inference-engine/cmake/features_ie.cmake +++ b/inference-engine/cmake/features_ie.cmake @@ -45,18 +45,13 @@ if (NOT THREADING STREQUAL "TBB" AND endif() if (ENABLE_GNA) - if (UNIX AND NOT APPLE AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4) - set (DEFAULT_GNA_LIB GNA1) - else() - set (DEFAULT_GNA_LIB GNA2) - endif() + set (DEFAULT_GNA_LIB GNA2) set(GNA_LIBRARY_VERSION "${DEFAULT_GNA_LIB}" CACHE STRING "GNAVersion") - set_property(CACHE GNA_LIBRARY_VERSION PROPERTY STRINGS "GNA1" "GNA1_1401" "GNA2") + set_property(CACHE GNA_LIBRARY_VERSION PROPERTY STRINGS "GNA1_1401" "GNA2") list (APPEND IE_OPTIONS GNA_LIBRARY_VERSION) - if (NOT GNA_LIBRARY_VERSION STREQUAL "GNA1" AND - NOT GNA_LIBRARY_VERSION STREQUAL "GNA1_1401" AND + if (NOT GNA_LIBRARY_VERSION STREQUAL "GNA1_1401" AND NOT GNA_LIBRARY_VERSION STREQUAL "GNA2") - message(FATAL_ERROR "GNA_LIBRARY_VERSION should be set to GNA1, GNA1_1401 or GNA2. Default option is ${DEFAULT_GNA_LIB}") + message(FATAL_ERROR "GNA_LIBRARY_VERSION should be set to GNA1_1401 or GNA2. Default option is ${DEFAULT_GNA_LIB}") endif() endif()