CPython编译过程记录 - WinChua/blog GitHub Wiki

  1. ctype 模块编译不通过: yum install libffi-devel libffi

  2. 缺失的库:

  • lmza -> yum install xz-devel
  • bz2 -> yum install bzip2-devel
  • uuid -> uuid-devel;
    更新完库之后clean ./configure --with-pydebug;, make all # 如果没有. --with-pydebug的话, gdb 调试的时候会出现optimized out 也就是不是用优化,--with-pydebug 同时会定义宏 -DPy_DEBUG
  1. 如何查看是否定义了 Py_DEBUG

    import sysconfig
    print(sysconfig.get_config_var("Py_DEBUG"))
    
  2. 使用 YCM-Generator生成文件, ./config_gen.py ~/cpython

  3. 如何使用python-gdb.py

    echo 'add-auto-load-safe-path ~/cpython/' >> ~/.gdbinit