Commit d2fe5723 authored by Robert Kimball's avatar Robert Kimball

interpreter working static

parent 4d62a0f3
......@@ -249,6 +249,7 @@ NORMALIZE_BOOL(NGRAPH_PYTHON_BUILD_ENABLE)
NORMALIZE_BOOL(NGRAPH_USE_PREBUILT_LLVM)
NORMALIZE_BOOL(NGRAPH_PLAIDML_ENABLE)
NORMALIZE_BOOL(NGRAPH_JSON_ENABLE)
NORMALIZE_BOOL(NGRAPH_STATIC_LIB_ENABLE)
message(STATUS "NGRAPH_UNIT_TEST_ENABLE: ${NGRAPH_UNIT_TEST_ENABLE}")
message(STATUS "NGRAPH_TOOLS_ENABLE: ${NGRAPH_TOOLS_ENABLE}")
......@@ -271,6 +272,7 @@ message(STATUS "NGRAPH_USE_PREBUILT_LLVM: ${NGRAPH_USE_PREBUILT_LLVM}")
message(STATUS "NGRAPH_PLAIDML_ENABLE: ${NGRAPH_PLAIDML_ENABLE}")
message(STATUS "NGRAPH_DISTRIBUTED_ENABLE: ${NGRAPH_DISTRIBUTED_ENABLE}")
message(STATUS "NGRAPH_JSON_ENABLE: ${NGRAPH_JSON_ENABLE}")
message(STATUS "NGRAPH_STATIC_LIB_ENABLE: ${NGRAPH_STATIC_LIB_ENABLE}")
#-----------------------------------------------------------------------------------------------
# Installation logic...
......
......@@ -486,34 +486,36 @@ configure_file(version.in.hpp version.hpp)
if (NGRAPH_STATIC_LIB_ENABLE)
add_library(ngraph STATIC ${SRC})
target_compile_definitions(ngraph PUBLIC INTERPRETER_BACKEND_STATIC)
if (NGRAPH_CPU_ENABLE)
target_compile_definitions(ngraph PUBLIC CPU_BACKEND_STATIC)
if (NGRAPH_INTERPRETER_ENABLE)
target_compile_definitions(ngraph PUBLIC INTERPRETER_BACKEND_STATIC)
endif()
# if (NGRAPH_CPU_ENABLE)
# target_compile_definitions(ngraph PUBLIC CPU_BACKEND_STATIC)
# endif()
if (NGRAPH_INTELGPU_ENABLE)
target_compile_definitions(ngraph PUBLIC INTELGPU_BACKEND_STATIC)
endif()
# if (NGRAPH_INTELGPU_ENABLE)
# target_compile_definitions(ngraph PUBLIC INTELGPU_BACKEND_STATIC)
# endif()
if (NGRAPH_GPU_ENABLE)
target_compile_definitions(ngraph PUBLIC GPU_BACKEND_STATIC)
endif()
# if (NGRAPH_GPU_ENABLE)
# target_compile_definitions(ngraph PUBLIC GPU_BACKEND_STATIC)
# endif()
if (NGRAPH_NOP_ENABLE)
target_compile_definitions(ngraph PUBLIC NOP_BACKEND_STATIC)
endif()
# if (NGRAPH_NOP_ENABLE)
# target_compile_definitions(ngraph PUBLIC NOP_BACKEND_STATIC)
# endif()
if (NGRAPH_GPUH_ENABLE)
target_compile_definitions(ngraph PUBLIC GPUH_BACKEND_STATIC)
endif()
# if (NGRAPH_GPUH_ENABLE)
# target_compile_definitions(ngraph PUBLIC GPUH_BACKEND_STATIC)
# endif()
if (NGRAPH_GENERIC_CPU_ENABLE)
target_compile_definitions(ngraph PUBLIC GENERIC_CPU_BACKEND_STATIC)
endif()
# if (NGRAPH_GENERIC_CPU_ENABLE)
# target_compile_definitions(ngraph PUBLIC GENERIC_CPU_BACKEND_STATIC)
# endif()
if (NGRAPH_PLAIDML_ENABLE)
target_compile_definitions(ngraph PUBLIC PLAIDML_BACKEND_STATIC)
endif()
# if (NGRAPH_PLAIDML_ENABLE)
# target_compile_definitions(ngraph PUBLIC PLAIDML_BACKEND_STATIC)
# endif()
else()
add_library(ngraph SHARED ${SRC})
endif()
......
......@@ -14,8 +14,14 @@
# limitations under the License.
# ******************************************************************************
if (NGRAPH_STATIC_LIB_ENABLE)
set(LIBRARY_TYPE STATIC)
else()
set(LIBRARY_TYPE SHARED)
endif()
if (NGRAPH_INTERPRETER_ENABLE)
add_library(interpreter_backend STATIC int_backend.cpp node_wrapper.cpp int_executable.cpp)
add_library(interpreter_backend ${LIBRARY_TYPE} int_backend.cpp node_wrapper.cpp int_executable.cpp)
if(NGRAPH_LIB_VERSIONING_ENABLE)
set_target_properties(interpreter_backend PROPERTIES
VERSION ${NGRAPH_VERSION}
......
......@@ -43,7 +43,7 @@ static runtime::BackendConstructor* interpreter_get_backend_constructor_pointer(
return s_backend_constructor.get();
}
#ifdef INTERPRETER_BACKEND_STATIC
#ifndef INTERPRETER_BACKEND_STATIC
extern "C" runtime::BackendConstructor* get_backend_constructor_pointer()
{
return interpreter_get_backend_constructor_pointer();
......
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