执行编译时可通过 -j 选项指定并行的任务数量来加快速度,通常我们将其设置为编译机器的 CPU 数量,可以结合 nproc 命令使用:
1
make -s -j "$(nproc)"
-s 选项意为 silence,即不打印编译的过程日志,也可启用。
编译的过程可能会比较耗时,成功后的输出如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _hashlib
_lzma _sqlite3 _ssl
_tkinter _uuid readline
To find the necessary bits, look in setup.py in detect_modules()for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc pwdtimeCould not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
Python 3.10.0a6+ (heads/master:80017752ba, Apr 6 2021, 13:47:23)[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>>