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
a8c1adbf
Commit
a8c1adbf
authored
Nov 28, 2018
by
Adam Procter
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into r0.10
parents
e10fa7d2
2579549e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
20 deletions
+32
-20
setup.py
python/setup.py
+32
-20
No files found.
python/setup.py
View file @
a8c1adbf
...
...
@@ -126,16 +126,13 @@ def has_flag(compiler, flagname):
def
cpp_flag
(
compiler
):
"""
Return the -std=c++[11/14]
compiler flag.
"""
Check and return the -std=c++11
compiler flag.
The c++14 is prefered over c++11 (when it is available).
"""
if
has_flag
(
compiler
,
'-std=c++14'
):
return
'-std=c++14'
elif
has_flag
(
compiler
,
'-std=c++11'
):
if
has_flag
(
compiler
,
'-std=c++11'
):
return
'-std=c++11'
else
:
raise
RuntimeError
(
'Unsupported compiler --
at least
C++11 support is needed!'
)
raise
RuntimeError
(
'Unsupported compiler -- C++11 support is needed!'
)
sources
=
[
...
...
@@ -273,6 +270,17 @@ data_files = [
NGRAPH_CPP_LIBRARY_DIR
+
"/"
+
library
for
library
in
os
.
listdir
(
NGRAPH_CPP_LIBRARY_DIR
)
],
),
(
'licenses'
,
[
PYNGRAPH_SOURCE_DIR
+
"/../licenses/"
+
license
for
license
in
os
.
listdir
(
PYNGRAPH_SOURCE_DIR
+
"/../licenses"
)
],
),
(
''
,
[
PYNGRAPH_SOURCE_DIR
+
"/../LICENSE"
],
)
]
...
...
@@ -321,29 +329,33 @@ class BuildExt(build_ext):
"""
def
build_extensions
(
self
):
if
sys
.
platform
==
'win32'
:
raise
RuntimeError
(
'Unsupported platform: win32!'
)
"""-Wstrict-prototypes is not a valid option for c++"""
try
:
self
.
compiler
.
compiler_so
.
remove
(
"-Wstrict-prototypes"
)
except
(
AttributeError
,
ValueError
):
pass
for
ext
in
self
.
extensions
:
ext
.
extra_compile_args
+=
[
cpp_flag
(
self
.
compiler
)]
if
has_flag
(
self
.
compiler
,
'-fstack-protector-strong'
):
ext
.
extra_compile_args
+=
[
'-fstack-protector-strong'
]
el
se
:
el
if
has_flag
(
self
.
compiler
,
'-fstack-protector'
)
:
ext
.
extra_compile_args
+=
[
'-fstack-protector'
]
if
has_flag
(
self
.
compiler
,
'-frtti'
):
ext
.
extra_compile_args
+=
[
'-frtti'
]
if
sys
.
platform
==
'darwin'
:
ext
.
extra_compile_args
+=
[
'-stdlib=libc++'
,
'-mmacosx-version-min=10.7'
,
]
ext
.
extra_link_args
+=
[
"-Wl,-rpath,@loader_path/../.."
]
else
:
if
has_flag
(
self
.
compiler
,
'-fvisibility=hidden'
):
ext
.
extra_compile_args
+=
[
'-fvisibility=hidden'
]
if
has_flag
(
self
.
compiler
,
'-fvisibility=hidden'
):
ext
.
extra_compile_args
+=
[
'-fvisibility=hidden'
]
if
has_flag
(
self
.
compiler
,
'-flto'
):
ext
.
extra_compile_args
+=
[
'-flto'
]
if
has_flag
(
self
.
compiler
,
'-fPIC'
):
ext
.
extra_compile_args
+=
[
'-fPIC'
]
if
sys
.
platform
.
startswith
(
'linux'
):
ext
.
extra_link_args
+=
[
'-Wl,-rpath,$ORIGIN/../..'
]
if
sys
.
platform
!=
'darwin'
:
ext
.
extra_link_args
+=
[
'-z'
,
'noexecstack'
]
ext
.
extra_link_args
+=
[
'-z'
,
'relro'
]
ext
.
extra_link_args
+=
[
'-z'
,
'now'
]
ext
.
extra_compile_args
+=
[
'-Wformat'
,
'-Wformat-security'
,
'-Wno-comment'
]
elif
sys
.
platform
==
'darwin'
:
ext
.
extra_link_args
+=
[
"-Wl,-rpath,@loader_path/../.."
]
ext
.
extra_compile_args
+=
[
'-Wformat'
,
'-Wformat-security'
]
ext
.
extra_compile_args
+=
[
'-O2'
,
'-D_FORTIFY_SOURCE=2'
]
build_ext
.
build_extensions
(
self
)
...
...
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