Commit 92430c2e authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CPU: Add CMake glue to populate header search paths

Also disable PCH in preparation of merge
parent 46840954
...@@ -101,7 +101,8 @@ include_directories( ...@@ -101,7 +101,8 @@ include_directories(
if(LLVM_INCLUDE_DIR) if(LLVM_INCLUDE_DIR)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR}) include_directories(SYSTEM ${LLVM_INCLUDE_DIR})
link_directories(${LLVM_LIB_DIR}) link_directories(${LLVM_LIB_DIR})
# Add sources for the LLVM-based code generator # Add sources for the CPU backend
# and all its dependencies
set(SRC ${SRC} set(SRC ${SRC}
codegen/compiler.cpp codegen/compiler.cpp
runtime/cpu/call_frame.cpp runtime/cpu/call_frame.cpp
...@@ -110,7 +111,10 @@ if(LLVM_INCLUDE_DIR) ...@@ -110,7 +111,10 @@ if(LLVM_INCLUDE_DIR)
runtime/cpu/emitter.cpp runtime/cpu/emitter.cpp
runtime/cpu/external_function.cpp runtime/cpu/external_function.cpp
) )
# LLVM binary builds are typically built without RTTI
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti") set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti")
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\";CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.0/include\";NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\"")
endif() endif()
add_library(ngraph SHARED ${SRC}) add_library(ngraph SHARED ${SRC})
......
...@@ -123,7 +123,7 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con ...@@ -123,7 +123,7 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con
// But that's a private header and isn't part of the public libclang API // But that's a private header and isn't part of the public libclang API
// Instead of re-implementing all of that functionality in a custom toolchain // Instead of re-implementing all of that functionality in a custom toolchain
// just hardcode the paths relevant to frequently used build/test machines for now // just hardcode the paths relevant to frequently used build/test machines for now
HSO.AddPath("/localdisk/menonjai/build/third-party/ext_llvm-prefix/src/ext_llvm/lib/clang/5.0.0/include", clang::frontend::System, false, false); HSO.AddPath(CLANG_BUILTIN_HEADERS_PATH, clang::frontend::System, false, false);
HSO.AddPath("/usr/include/x86_64-linux-gnu", clang::frontend::System, false, false); HSO.AddPath("/usr/include/x86_64-linux-gnu", clang::frontend::System, false, false);
HSO.AddPath("/usr/include", clang::frontend::System, false, false); HSO.AddPath("/usr/include", clang::frontend::System, false, false);
// Add C++ standard library headers // Add C++ standard library headers
...@@ -133,12 +133,8 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con ...@@ -133,12 +133,8 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con
// Debian-like + GCC 5 libstdc++ // Debian-like + GCC 5 libstdc++
HSO.AddPath("/usr/include/x86_64-linux-gnu/c++/5", clang::frontend::System, false, false); HSO.AddPath("/usr/include/x86_64-linux-gnu/c++/5", clang::frontend::System, false, false);
HSO.AddPath("/usr/include/c++/5", clang::frontend::System, false, false); HSO.AddPath("/usr/include/c++/5", clang::frontend::System, false, false);
// TODO: Hack in path to eigen headers for now HSO.AddPath(EIGEN_HEADERS_PATH, clang::frontend::System, false, false);
HSO.AddPath("/localdisk/menonjai/build/external/eigen/include/eigen3", HSO.AddPath(NGRAPH_HEADERS_PATH, clang::frontend::System, false, false);
clang::frontend::System,
false,
false);
HSO.AddPath("/home/menonjai/ngraph-cpp/src", clang::frontend::System, false, false);
// Language options // Language options
auto LO = Clang->getInvocation().getLangOpts(); auto LO = Clang->getInvocation().getLangOpts();
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
// TODO: Decide if we want to ship this or // TODO: Decide if we want to ship this or
// just enable it for developer build-test cycles // just enable it for developer build-test cycles
#define NGCPU_PCH //#define NGCPU_PCH
using namespace std; using namespace std;
using namespace ngraph::runtime::cpu; using namespace ngraph::runtime::cpu;
......
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