Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
99e43d1d
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
99e43d1d
编写于
12月 23, 2016
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add c++11 build python binding package
上级
c6d9d040
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
9 deletion
+9
-9
paddle/api/paddle_ld_flags.py
paddle/api/paddle_ld_flags.py
+5
-2
paddle/setup.py.in
paddle/setup.py.in
+4
-7
未找到文件。
paddle/api/paddle_ld_flags.py
浏览文件 @
99e43d1d
...
@@ -141,9 +141,12 @@ try:
...
@@ -141,9 +141,12 @@ try:
def
c_flag
(
self
):
def
c_flag
(
self
):
if
self
.
with_coverage
:
if
self
.
with_coverage
:
return
[
"-fprofile-arcs"
,
"-ftest-coverage"
,
"-O0"
,
"-g"
]
return
[
"-fprofile-arcs"
,
"-ftest-coverage"
,
"-O0"
,
"-g"
,
"-std=c++11"
]
else
:
else
:
return
None
return
[
"-std=c++11"
]
except
ImportError
:
except
ImportError
:
class
PaddleLDFlag
(
object
):
class
PaddleLDFlag
(
object
):
...
...
paddle/setup.py.in
浏览文件 @
99e43d1d
...
@@ -30,8 +30,10 @@ is_lin = (system == 'linux')
...
@@ -30,8 +30,10 @@ is_lin = (system == 'linux')
# The extra links will passed from COMAKE
# The extra links will passed from COMAKE
# because generate paddle LDFLAGS is too complicated to do in setup.py
# because generate paddle LDFLAGS is too complicated to do in setup.py
# it just read COMAKE generated LDFLAGS.
# it just read COMAKE generated LDFLAGS.
extra_comps = []
extra_links = []
extra_links = []
obj = api.paddle_ld_flags.PaddleLDFlag()
obj = api.paddle_ld_flags.PaddleLDFlag()
extra_comps = obj.c_flag()
ldflags = obj.ldflag_str()
ldflags = obj.ldflag_str()
if ldflags is not None:
if ldflags is not None:
extra_links.extend(ldflags.split(" "))
extra_links.extend(ldflags.split(" "))
...
@@ -51,20 +53,15 @@ elif is_osx == True:
...
@@ -51,20 +53,15 @@ elif is_osx == True:
include_dirs = [np.get_include(), "../"] # include numpy and paddle.
include_dirs = [np.get_include(), "../"] # include numpy and paddle.
extra_c = obj.c_flag()
attr=dict()
if extra_c is not None:
attr["extra_compile_args"] = extra_c
setup(name="py_paddle",
setup(name="py_paddle",
version="@PADDLE_VERSION@",
version="@PADDLE_VERSION@",
ext_modules=[
ext_modules=[
Extension('py_paddle._swig_paddle', # Build SWIG Extension.
Extension('py_paddle._swig_paddle', # Build SWIG Extension.
['Paddle_wrap.cxx'],
['Paddle_wrap.cxx'],
language = "c++",
include_dirs = include_dirs,
include_dirs = include_dirs,
extra_link_args = extra_links,
extra_link_args = extra_links,
**attr
extra_compile_args = extra_comps
)
)
],
],
packages=['py_paddle'],
packages=['py_paddle'],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录