Commit 7b665771 authored by Robert Kimball's avatar Robert Kimball Committed by Scott Cyphers

remove version tagging from shared libraries (#2094)

* remove version tagging from shared libraries

* add flag to enable/disable library versioning
parent b25f1714
......@@ -99,6 +99,7 @@ option(NGRAPH_DEBUG_ENABLE "Enable output for NGRAPH_DEBUG statements" FALSE)
option(NGRAPH_ONNX_IMPORT_ENABLE "Enable ONNX importer" FALSE)
option(NGRAPH_DEX_ONLY "Build CPU DEX without codegen" FALSE)
option(NGRAPH_CODE_COVERAGE_ENABLE "Enable code coverage data collection" FALSE)
option(NGRAPH_LIB_VERSIONING_ENABLE "Enable shared library versioning" FALSE)
message(STATUS "NGRAPH_UNIT_TEST_ENABLE: ${NGRAPH_UNIT_TEST_ENABLE}")
message(STATUS "NGRAPH_TOOLS_ENABLE: ${NGRAPH_TOOLS_ENABLE}")
......@@ -113,6 +114,7 @@ message(STATUS "NGRAPH_DEBUG_ENABLE: ${NGRAPH_DEBUG_ENABLE}")
message(STATUS "NGRAPH_ONNX_IMPORT_ENABLE: ${NGRAPH_ONNX_IMPORT_ENABLE}")
message(STATUS "NGRAPH_DEX_ONLY: ${NGRAPH_DEX_ONLY}")
message(STATUS "NGRAPH_CODE_COVERAGE_ENABLE: ${NGRAPH_CODE_COVERAGE_ENABLE}")
message(STATUS "NGRAPH_LIB_VERSIONING_ENABLE: ${NGRAPH_LIB_VERSIONING_ENABLE}")
message(STATUS "NGRAPH_PYTHON_BUILD_ENABLE: ${NGRAPH_PYTHON_BUILD_ENABLE}")
if (NGRAPH_HYBRID_ENABLE)
......
......@@ -197,7 +197,11 @@ add_subdirectory(codegen)
add_subdirectory(runtime)
target_compile_definitions(ngraph PRIVATE SHARED_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}")
set_target_properties(ngraph PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(ngraph PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
target_link_libraries(ngraph PRIVATE libjson)
target_compile_definitions(ngraph PUBLIC NGRAPH_VERSION="${NGRAPH_VERSION}")
......
......@@ -76,7 +76,11 @@ if (NGRAPH_GPU_ENABLE OR (NGRAPH_CPU_ENABLE AND NOT NGRAPH_DEX_ONLY))
add_dependencies(header_resource ext_eigen ext_mkldnn)
endif()
set_target_properties(codegen PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(codegen PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
add_dependencies(codegen header_resource)
if (NGRAPH_CPU_ENABLE)
add_dependencies(codegen libmkldnn libeigen)
......
......@@ -32,6 +32,10 @@ target_include_directories(onnxifi-ngraph SYSTEM PRIVATE ${ONNX_INCLUDE_DIR} ${O
set(ONNXIFI_VERSION ${NGRAPH_VERSION})
set(ONNXIFI_ABI_VERSION 1)
set_target_properties(onnxifi-ngraph PROPERTIES VERSION ${ONNXIFI_VERSION} SOVERSION ${ONNXIFI_ABI_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(onnxifi-ngraph PROPERTIES
VERSION ${ONNXIFI_VERSION}
SOVERSION ${ONNXIFI_ABI_VERSION})
endif()
install(TARGETS onnxifi-ngraph DESTINATION ${NGRAPH_INSTALL_LIB})
......@@ -165,7 +165,11 @@ if (NGRAPH_CPU_ENABLE)
set(NGRAPH_CPU_DEBUGINFO_ENABLE 0 CACHE STRING "Enable debuginfo in the CPU backend")
add_library(cpu_backend SHARED ${SRC})
set_target_properties(cpu_backend PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(cpu_backend PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
if (NGRAPH_DEX_ONLY)
target_compile_definitions(cpu_backend PRIVATE "NGRAPH_DEX_ONLY")
endif()
......
......@@ -136,7 +136,11 @@ if (NGRAPH_GPU_ENABLE)
endif()
add_library(gpu_backend SHARED ${SRC} ${CUDA_OBJ})
set_target_properties(gpu_backend PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(gpu_backend PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
target_link_libraries(gpu_backend PUBLIC ngraph codegen)
find_library(CUDA_nvrtc_LIBRARY nvrtc /usr/local/cuda/lib64)
find_library(CUDA_cuda_LIBRARY cuda /usr/local/cuda/lib64/stubs)
......
......@@ -16,7 +16,11 @@
if (NGRAPH_HYBRID_ENABLE)
add_library(hybrid_backend SHARED hybrid_backend.cpp)
set_target_properties(hybrid_backend PROPERTIES VERSION ${NGRAPH_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(hybrid_backend PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
target_link_libraries(hybrid_backend PUBLIC ngraph)
set_target_properties(hybrid_backend PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${NGRAPH_BUILD_DIR})
......
......@@ -16,7 +16,11 @@
if (NGRAPH_INTERPRETER_ENABLE)
add_library(interpreter_backend SHARED int_backend.cpp node_wrapper.cpp)
set_target_properties(interpreter_backend PROPERTIES VERSION ${NGRAPH_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(interpreter_backend PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
target_link_libraries(interpreter_backend PUBLIC ngraph)
set_target_properties(interpreter_backend PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${NGRAPH_BUILD_DIR})
......@@ -24,7 +28,7 @@ if (NGRAPH_INTERPRETER_ENABLE)
LIBRARY DESTINATION "${NGRAPH_INSTALL_LIB}"
ARCHIVE DESTINATION "${NGRAPH_INSTALL_LIB}"
)
if(NGRAPH_DISTRIBUTED_ENABLE)
find_package(MPI REQUIRED)
target_compile_definitions(interpreter_backend
......
......@@ -16,7 +16,11 @@
if (NGRAPH_NOP_ENABLE)
add_library(nop_backend SHARED nop_backend.cpp)
set_target_properties(nop_backend PROPERTIES VERSION ${NGRAPH_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(nop_backend PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
target_link_libraries(nop_backend PUBLIC ngraph)
set_target_properties(nop_backend PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${NGRAPH_BUILD_DIR})
......
......@@ -58,7 +58,11 @@ if (NGRAPH_PLAIDML_ENABLE)
install(FILES ${PLAIDML_LIBRARIES} DESTINATION ${NGRAPH_INSTALL_LIB})
add_library(plaidml_backend SHARED ${SRC})
set_target_properties(plaidml_backend PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(plaidml_backend PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
target_include_directories(plaidml_backend SYSTEM PUBLIC ${PLAIDML_INCLUDE_DIRS})
target_link_libraries(plaidml_backend PUBLIC ngraph libplaidml)
set_target_properties(plaidml_backend PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${NGRAPH_BUILD_DIR}")
......@@ -66,4 +70,4 @@ if (NGRAPH_PLAIDML_ENABLE)
else()
message(STATUS "PlaidML not enabled")
endif()
......@@ -22,7 +22,11 @@ set (SRC
)
add_library(ngraph_test_util SHARED ${SRC})
set_target_properties(ngraph_test_util PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION})
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(ngraph_test_util PROPERTIES
VERSION ${NGRAPH_VERSION}
SOVERSION ${NGRAPH_API_VERSION})
endif()
target_include_directories(ngraph_test_util PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
target_link_libraries(ngraph_test_util ngraph libgtest)
......
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