Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
457be4dd
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
457be4dd
编写于
1月 02, 2023
作者:
5991120
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify setup.py and paddle_build.sh
上级
71bc8e99
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
25 addition
and
19 deletion
+25
-19
setup.py
setup.py
+25
-19
未找到文件。
setup.py
浏览文件 @
457be4dd
...
...
@@ -21,8 +21,8 @@ import platform
import
re
import
shutil
import
subprocess
import
sysconfig
import
sys
import
sysconfig
from
contextlib
import
contextmanager
from
distutils.spawn
import
find_executable
from
subprocess
import
CalledProcessError
...
...
@@ -50,20 +50,21 @@ assert (
CMAKE
),
'The "cmake" executable is not found. Please check if Cmake is installed.'
#CMAKE: full path to python library
if
(
platform
.
system
()
==
"Windows"
)
:
#
CMAKE: full path to python library
if
platform
.
system
()
==
"Windows"
:
cmake_python_library
=
"{}/libs/python{}.lib"
.
format
(
sysconfig
.
get_config_var
(
"prefix"
),
sysconfig
.
get_config_var
(
"VERSION"
)
)
sysconfig
.
get_config_var
(
"prefix"
),
sysconfig
.
get_config_var
(
"VERSION"
)
)
# Fix virtualenv builds
if
not
os
.
path
.
exists
(
cmake_python_library
):
cmake_python_library
=
"{}/libs/python{}.lib"
.
format
(
sys
.
base_prefix
,
sysconfig
.
get_config_var
(
"VERSION"
)
)
sys
.
base_prefix
,
sysconfig
.
get_config_var
(
"VERSION"
)
)
else
:
cmake_python_library
=
"{}/{}"
.
format
(
sysconfig
.
get_config_var
(
"LIBDIR"
),
sysconfig
.
get_config_var
(
"INSTSONAME"
))
sysconfig
.
get_config_var
(
"INSTSONAME"
),
)
TOP_DIR
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
...
...
@@ -571,13 +572,16 @@ def options_process(args, build_options):
for
key
,
value
in
sorted
(
build_options
.
items
()):
if
value
is
not
None
:
args
.
append
(
"-D{}={}"
.
format
(
key
,
value
))
if
(
'PYTHON_EXECUTABLE:FILEPATH'
not
in
build_options
.
keys
()):
args
.
append
(
"-D{}={}"
.
format
(
'PYTHON_EXECUTABLE'
,
sys
.
executable
))
if
(
'PYTHON_INCLUDE_DIR:PATH'
not
in
build_options
.
keys
()):
args
.
append
(
'-D{}={}'
.
format
(
'PYTHON_INCLUDE_DIR'
,
sysconfig
.
get_path
(
"include"
)))
if
(
'PYTHON_LIBRARY:FILEPATH'
not
in
build_options
.
keys
()):
args
.
append
(
'-D{}={}'
.
format
(
'PYTHON_LIBRARY'
,
cmake_python_library
))
if
'PYTHON_EXECUTABLE:FILEPATH'
not
in
build_options
.
keys
():
args
.
append
(
"-D{}={}"
.
format
(
'PYTHON_EXECUTABLE'
,
sys
.
executable
))
if
'PYTHON_INCLUDE_DIR:PATH'
not
in
build_options
.
keys
():
args
.
append
(
'-D{}={}'
.
format
(
'PYTHON_INCLUDE_DIR'
,
sysconfig
.
get_path
(
"include"
)
)
)
if
'PYTHON_LIBRARY:FILEPATH'
not
in
build_options
.
keys
():
args
.
append
(
'-D{}={}'
.
format
(
'PYTHON_LIBRARY'
,
cmake_python_library
))
def
get_cmake_generator
():
...
...
@@ -700,9 +704,11 @@ def build_steps():
os
.
remove
(
cmake_cache_file_path
)
CMAKE_GENERATOR
=
get_cmake_generator
()
bool_ninja
=
(
CMAKE_GENERATOR
==
"Ninja"
)
bool_ninja
=
CMAKE_GENERATOR
==
"Ninja"
build_ninja_file_path
=
os
.
path
.
join
(
build_path
,
"build.ninja"
)
if
os
.
path
.
exists
(
cmake_cache_file_path
)
and
not
(
bool_ninja
and
not
os
.
path
.
exists
(
build_ninja_file_path
)):
if
os
.
path
.
exists
(
cmake_cache_file_path
)
and
not
(
bool_ninja
and
not
os
.
path
.
exists
(
build_ninja_file_path
)
):
print
(
"Do not need rerun camke,everything is ready,run build now"
)
else
:
cmake_run
(
build_path
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录