GitHub increased the number of CPUs in its GitHub-hosted runners from
two to four for Linux and Windows. macOS remains at two CPUs. Stop
hard-coding the number of CPUs when we build fio and detect the number
at runtime.
https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
configure_flags+=(--extra-cflags="${extra_cflags}")
./configure "${configure_flags[@]}"
- make -j 2
+ make -j "$(nproc 2>/dev/null || sysctl -n hw.logicalcpu)"
+# macOS does not have nproc, so we have to use sysctl to obtain the number of
+# logical CPUs.
}
main