Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
bfb48511
Commit
bfb48511
authored
Feb 16, 2019
by
Sang Ik Lee
Committed by
Robert Kimball
Feb 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve codegen's header search path finding logic for various Linux distributions. (#2468)
parent
8665e27e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
CMakeLists.txt
src/ngraph/codegen/CMakeLists.txt
+5
-5
compiler.cpp
src/ngraph/codegen/compiler.cpp
+0
-0
compiler.hpp
src/ngraph/codegen/compiler.hpp
+3
-1
No files found.
src/ngraph/codegen/CMakeLists.txt
View file @
bfb48511
...
...
@@ -33,10 +33,10 @@ add_library(codegen SHARED ${SRC})
# This must be kept in sync with the LLVM + Clang version in use
set_source_files_properties
(
compiler.cpp PROPERTIES COMPILE_FLAGS
"-fno-rtti"
)
get_target_property
(
LLVM_
LIB
_DIR libllvm INTERFACE_INCLUDE_DIRECTORIES
)
get_target_property
(
LLVM_
INCLUDE
_DIR libllvm INTERFACE_INCLUDE_DIRECTORIES
)
# find_file(HEADER_1 cmath HINTS /usr/include/c++/7)
get_filename_component
(
LLVM_LIB_DIR
${
LLVM_LIB
_DIR
}
/../lib/clang/5.0.2/include ABSOLUTE
)
get_filename_component
(
CLANG_INCLUDE_DIR
${
LLVM_INCLUDE
_DIR
}
/../lib/clang/5.0.2/include ABSOLUTE
)
if
(
NGRAPH_CPU_ENABLE
)
get_target_property
(
MKLDNN_INCLUDE_DIR libmkldnn INTERFACE_INCLUDE_DIRECTORIES
)
...
...
@@ -45,7 +45,7 @@ if(NGRAPH_CPU_ENABLE)
list
(
APPEND HEADER_SEARCH_DEFINES MKLDNN_HEADERS_PATH=
"
${
MKLDNN_INCLUDE_DIR
}
"
)
endif
()
list
(
APPEND HEADER_SEARCH_DEFINES CLANG_BUILTIN_HEADERS_PATH=
"
${
LLVM_LIB
_DIR
}
"
)
list
(
APPEND HEADER_SEARCH_DEFINES CLANG_BUILTIN_HEADERS_PATH=
"
${
CLANG_INCLUDE
_DIR
}
"
)
list
(
APPEND HEADER_SEARCH_DEFINES NGRAPH_HEADERS_PATH=
"
${
NGRAPH_INCLUDE_PATH
}
"
)
if
(
NGRAPH_DISTRIBUTED_ENABLE
)
...
...
@@ -76,7 +76,7 @@ set_source_files_properties(compiler.cpp PROPERTIES COMPILE_DEFINITIONS "${HEADE
# Generate the resource file containing all headers used by the codegen compiler
add_custom_target
(
header_resource
resource_generator --output
${
CMAKE_BINARY_DIR
}
/header_resource.hpp --base codegen
DEPENDS resource_generator
ext_llvm
DEPENDS resource_generator
BYPRODUCTS
)
if
(
NGRAPH_CPU_ENABLE
)
...
...
@@ -99,5 +99,5 @@ if (NGRAPH_CPU_ENABLE)
endif
()
target_include_directories
(
codegen SYSTEM PRIVATE
${
CMAKE_BINARY_DIR
}
)
target_link_libraries
(
codegen PRIVATE libllvm ngraph
)
set_target_properties
(
codegen PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${
NGRAPH_BUILD_DIR
}
)
install
(
TARGETS codegen DESTINATION
${
NGRAPH_INSTALL_LIB
}
)
src/ngraph/codegen/compiler.cpp
View file @
bfb48511
This diff is collapsed.
Click to expand it.
src/ngraph/codegen/compiler.hpp
View file @
bfb48511
...
...
@@ -78,7 +78,7 @@ public:
bool
is_debuginfo_enabled
()
{
return
m_debuginfo_enabled
;
}
void
set_precompiled_header_source
(
const
std
::
string
&
source
);
const
std
::
string
&
get_precompiled_header_source
()
const
;
void
add_header_search_path
(
const
std
::
string
&
path
);
void
add_header_search_path
(
const
std
::
string
&
path
,
bool
check_path
=
false
);
std
::
unique_ptr
<
ngraph
::
codegen
::
Module
>
compile
(
std
::
unique_ptr
<
clang
::
CodeGenAction
>&
compiler_action
,
const
std
::
string
&
source
);
...
...
@@ -95,8 +95,10 @@ private:
std
::
string
m_precompiled_header_source
;
bool
is_version_number
(
const
std
::
string
&
path
);
int
full_version_number
(
const
std
::
string
&
path
,
const
std
::
string
&
gpp_ver
);
std
::
string
find_header_version
(
const
std
::
string
&
path
);
std
::
string
find_os_specific_path
(
const
std
::
string
&
path
);
std
::
string
find_rh_devtoolset_path
();
void
configure_search_path
();
void
load_headers_from_resource
();
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment