Commit d98771f8 authored by Robert Kimball's avatar Robert Kimball

put back NGRAPH_CPU_ENABLE flag so that CPU build can be disabled

parent be13ab7c
......@@ -87,6 +87,11 @@ endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
# Set true if CPU backend is built by default
if (NOT DEFINED NGRAPH_CPU_ENABLE)
SET(NGRAPH_CPU_ENABLE TRUE)
endif()
#-----------------------------------------------------------------------------------------------
# External projects install directory
#-----------------------------------------------------------------------------------------------
......
......@@ -13,7 +13,7 @@
include(ExternalProject)
if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND
if(NGRAPH_CPU_ENABLE AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND
(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows"))
message(STATUS "Fetching LLVM from llvm.org")
set(LLVM_RELEASE_URL http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu16.04.tar.xz)
......
......@@ -95,7 +95,7 @@ include_directories(
"${EIGEN_INCLUDE_DIR}"
)
if (LLVM_INCLUDE_DIR AND
if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
MKLDNN_INCLUDE_DIR)
find_package(ZLIB REQUIRED)
......@@ -162,7 +162,7 @@ message(STATUS "LIBRARY_OUTPUT_DIRECTORY set to: ${COMMON_LIBRARY_OUTPUT_DIRECTO
target_include_directories(ngraph PUBLIC "${NGRAPH_INCLUDE_PATH}")
if(LLVM_LINK_LIBS)
if(NGRAPH_CPU_ENABLE AND LLVM_LINK_LIBS)
target_link_libraries(ngraph PRIVATE ${LLVM_LINK_LIBS})
endif()
......@@ -172,7 +172,7 @@ if (APPLE)
set_property(TARGET ngraph PROPERTY SUFFIX "")
endif()
if(MKLDNN_LIB_DIR)
if(NGRAPH_CPU_ENABLE AND MKLDNN_LIB_DIR)
target_link_libraries(ngraph PRIVATE mkldnn)
endif()
......@@ -211,7 +211,7 @@ install(DIRECTORY
DESTINATION "${NGRAPH_INSTALL_LIB}"
)
endif()
if (LLVM_INCLUDE_DIR AND
if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
MKLDNN_INCLUDE_DIR)
# Currently this is required for Argon codegen. To avoid this, we'll need to decouple LLVM from
# compiler.hpp
......@@ -227,10 +227,10 @@ endif()
add_dependencies(ngraph eigen)
if(LLVM_INCLUDE_DIR)
if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
add_dependencies(ngraph ext_llvm)
endif()
if(MKLDNN_INCLUDE_DIR)
if(NGRAPH_CPU_ENABLE AND MKLDNN_INCLUDE_DIR)
add_dependencies(ngraph ext_mkldnn)
endif()
......@@ -57,7 +57,7 @@ if(MKLDNN_INCLUDE_DIR)
set(SRC ${SRC} mkldnn.cpp)
endif()
if(LLVM_INCLUDE_DIR)
if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR})
link_directories(${LLVM_LIB_DIR})
set(SRC ${SRC} codegen.cpp)
......
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