-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ninja compilation bug and warning on windows #32987
Fix ninja compilation bug and warning on windows #32987
Conversation
Thanks for your contribution! |
b32fe44
to
dc4e610
Compare
dc4e610
to
e8d74a3
Compare
e8d74a3
to
e6a32f4
Compare
e6a32f4
to
07b810f
Compare
07b810f
to
978dc6f
Compare
978dc6f
to
2dd83e1
Compare
2dd83e1
to
f2810c8
Compare
f2810c8
to
d7e2489
Compare
d7e2489
to
c97cfdf
Compare
c97cfdf
to
be975ae
Compare
0bba9af
to
e8e05d4
Compare
e8e05d4
to
4ebdfd8
Compare
4ebdfd8
to
e98c2e3
Compare
d6aec2d
to
7a088c6
Compare
7a088c6
to
5bc52bb
Compare
5bc52bb
to
48f7c22
Compare
48f7c22
to
f2ad9b9
Compare
f2ad9b9
to
a4e9177
Compare
8fffa6f
to
19ec2de
Compare
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel" | ||
FORCE) | ||
endif() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在project
前后写有啥区别吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写的靠后无法生效,Ninja在project后设置CMAKE_BUILD_TYPE为Debug,导致Release的默认参数失效
BUILD_ALWAYS 1 | ||
# UPDATE_COMMAND "" | ||
UPDATE_COMMAND "" | ||
#BUILD_ALWAYS 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个对Ninja构建有什么影响呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不影响Ninja,这个BUILD_ALWAYS导致mkldnn、warpctc增量编译失效,0改动完全重编
PATCH_COMMAND "" | ||
BUILD_ALWAYS 1 | ||
#BUILD_ALWAYS 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同mkldnn
if(NOT WIN32) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") | ||
else() | ||
set(CMAKE_CXX_STANDARD 14) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(CMAKE_CXX_STANDARD 14)
之后,在linux、mac上是不是也不用再单独设置CMAKE_CXX_FLAGS
了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux mac下CMAKE_CXX_STANDARD=14有编译wanring,没有改动,
VS下-std=c++14没有生效,会屏蔽这个flag,所以也没warning,但Ninja不会屏蔽,导致所有cl报warning
@@ -412,10 +412,10 @@ if "%WITH_TESTING%"=="ON" ( | |||
|
|||
echo Build Paddle the %build_times% time: | |||
if %GENERATOR% == "Ninja" ( | |||
ninja -j %PARALLEL_PROJECT_COUNT% | |||
ninja all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的不指定-j
会不会造成并行过高而影响编译时间?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该不会,之前是由于/m 和/MP 累乘,导致编译进程有核数的平方,而ninja默认并行思路就是核数大小,降了可能会变慢,先用默认的看看
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
125e6c1
to
e2e4791
Compare
e2e4791
to
b04c06d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
Others
Describe
1.fix ninja compilation MSVC(/MT and /MD flags) bug.
2.fix ninja compilation warning on windows.