Skip to content
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

Windows system supports Ninja compilation #31161

Merged
merged 20 commits into from
Mar 4, 2021
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d07d999
support for compiling with Ninja, test changes have no effect without…
Avin0323 Feb 23, 2021
400cacc
fix compilation error with ninja, test=develop
Avin0323 Feb 24, 2021
00f2be6
test compliation with Ninja on Windows CI, test=develop
Avin0323 Feb 24, 2021
6f20935
Merge branch 'develop' into compile-with-ninja
Avin0323 Feb 24, 2021
adfce13
test compliation with Ninja on Windows CI, notest, test=windows_ci
Avin0323 Feb 24, 2021
47ddb12
test compliation with Ninja on Windows CI, notest, test=windows_ci
Avin0323 Feb 24, 2021
22435e8
test compliation with Ninja on Windows CI, notest, test=windows_ci
Avin0323 Feb 24, 2021
5dafcdc
test compliation with Ninja on Windows CI, notest, test=windows_ci
Avin0323 Feb 24, 2021
1d03798
fix compile tool warnings info on Windows, test=develop
Avin0323 Feb 24, 2021
ad0bb6a
fix compilaton error with Ninja on Windows, test=develop
Avin0323 Feb 25, 2021
fafe2e4
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Avin0323 Feb 25, 2021
02f0c4f
fix compilaton error with Ninja on Windows, test=develop
Avin0323 Feb 25, 2021
111fb03
merge develop
Avin0323 Mar 1, 2021
6aa33cb
add comments and modify build script using MSVC and Ninja, test=develop
Avin0323 Mar 2, 2021
3675a65
fix inference_lib path error on Windows, test=develop
Avin0323 Mar 2, 2021
9cc124b
fix inference lib path error, test=develop
Avin0323 Mar 3, 2021
a7ac841
remove test code, test=develop
Avin0323 Mar 3, 2021
d9bb8ed
fix compare string error on Windows, test=develop
Avin0323 Mar 3, 2021
002da93
fix compare string error on Windows, test=develop
Avin0323 Mar 3, 2021
7c35a9a
remove analysis_predictor depend of paddle_inference, test=develop
Avin0323 Mar 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix compilaton error with Ninja on Windows, test=develop
Avin0323 committed Feb 25, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit ad0bb6ad13344efb38a8ef35526d3c293943b401
11 changes: 8 additions & 3 deletions paddle/fluid/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -345,11 +345,16 @@ if (LINUX)
endif()

if (WIN32)
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
set(paddle_framework_lib_path ${CMAKE_CURRENT_BINARY_DIR})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也能改成 $<TARGET_FILE_DIR: paddle_framework_shared> 这种形式吗

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个就不行了,后面configure_file不能正确解析cmake的生成表达式。

else()
set(paddle_framework_lib_path ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
endif()
set(FLUID_FRAMEWORK_IMPORT_LIB
${PADDLE_BINARY_DIR}/paddle/fluid/framework/${CMAKE_BUILD_TYPE}/paddle_framework.lib
CACHE INTERNAL "Fluid framework lib")
${paddle_framework_lib_path}/paddle_framework.lib
CACHE INTERNAL "Fluid framework lib")
set(FLUID_FRAMEWORK_SHARED_LIB
${PADDLE_BINARY_DIR}/paddle/fluid/framework/${CMAKE_BUILD_TYPE}/paddle_framework.dll
${paddle_framework_lib_path}/paddle_framework.dll
CACHE INTERNAL "Fluid framework dll")
endif()

3 changes: 3 additions & 0 deletions paddle/fluid/inference/capi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -26,4 +26,7 @@ cc_library(paddle_inference_c_shared SHARED SRCS ${C_API_SRCS} DEPS paddle_infer
set_target_properties(paddle_inference_c_shared PROPERTIES OUTPUT_NAME paddle_inference_c)
if(WIN32)
target_link_libraries(paddle_inference_c_shared shlwapi.lib)
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analysis_predictor 能否直接作为 paddle_inference_c_shared 的DEP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个depend是不需要的了,已删除

target_link_libraries(paddle_inference_c_shared analysis_predictor)
endif()
endif()
1 change: 0 additions & 1 deletion paddle/scripts/paddle_build.bat
Original file line number Diff line number Diff line change
@@ -144,7 +144,6 @@ rem clcache.exe -M 21474836480
:: install ninja
pip uninstall -y ninja
pip install ninja
ninja -V
set GENERATOR=Ninja

rem ------show summary of current environment----------