-
Notifications
You must be signed in to change notification settings - Fork 10
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
Recommend using Ninja to build fcitx5-mcbopomofo #96
Comments
One can create
{
"version": 8,
"cmakeMinimumRequired": {
"major": 3,
"minor": 28,
"patch": 0
},
"configurePresets": [
{
"name": "release",
"displayName": "Release",
"description": "Release build with Ninja",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "/usr",
"CMAKE_BUILD_TYPE": "Release",
"ENABLE_CLANG_TIDY": "On"
}
},
{
"name": "debug",
"displayName": "Debug",
"description": "Debug build with Ninja",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "/usr",
"CMAKE_BUILD_TYPE": "Debug",
"ENABLE_CLANG_TIDY": "On"
}
}
]
} This will simplify the commands for developers:
|
Revisiting this issue. This is where I feel I don't know enough about making this recommendation. What could be the impact to places that build fcitx5-mcbopomofo automatically, for example the current CI and other package managers that build it from source? How prevalent can we expect to find 2x is a good win although this is a small project. What do you think if we provide the |
If we are talking about C++ projects, I know that big projects such as LLVM and chromium are using Ninja. It should also be easily found in many modern systems [1]. I have no problem with having these instructions in the wiki as an alternative instead of putting in the repo, if we do not feel familiar with the tool. [1] https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages |
FYI, just did some builds on my new system ( $ nproc
24
$ time ninja
[54/54] Linking CXX executable src/Engine/gramambular2/gramambular2_test
real 0m3.488s
user 0m45.746s
sys 0m1.505s
$ time make -j 26
real 0m6.126s
user 0m32.843s
sys 0m1.316s |
@xatier +CC @lukhnos For testing parallel execution of
but also for checking The main reason I'd like to know |
It won't make much difference on GitHub's CI, they are weak VMs with small # of cores. [1] I'm not sure if there are any reasons behind the Here are the numbers if you're interested: https://github.com/xatier/fcitx5-mcbopomofo/actions/runs/11823414619 |
I wonder if we would like to recommend using
ninja
to build the project.To enable
ninja
, simply add-G Ninja
to theCMake
command.I observed a ~2x boost on my system (
Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
)$ time make -j 18 ... [100%] Built target mcbopomofo real 0m48.043s user 2m9.943s sys 0m4.526s
The text was updated successfully, but these errors were encountered: