Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Apr 9, 2021

  • Elaborate PGO and LTO documentaton.
  • Document MAINCC, PURIFY and LINKCC variables.

https://bugs.python.org/issue43774

* Elaborate PGO and LTO documentaton.
* Document MAINCC, PURIFY and LINKCC variables.
@vstinner
Copy link
Member Author

vstinner commented Apr 9, 2021

cc @serge-sans-paille

(disabled by default).

The C compiler ``clang`` requires ``llvm-profdata`` program for PGO. On
macOS, GCC also requires it: GCC is just an alis to clang on macOS.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: alias
nit: Clang

Copy link
Member Author

Choose a reason for hiding this comment

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

"Clang": oh no, I beg you pardon! It's now fixed :-D


Enable Link Time Optimization (LTO) in any build (disabled by default).

The C compiler ``clang`` requires ``llvm-av`` for LTO.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: llvm-ar

Copy link
Contributor

Choose a reason for hiding this comment

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

  • as well as an LTO-aware linker (ld.gold or lld)

* ``python.o`` and the static ``libpython`` library are linked into the
final ``python`` program.
* C extensions are built by the Makefile (see :file:`Modules/Setup`)
and ``python setup.py build``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe document the various symlink created ? (like python3.x)

* ``make platform:``: build the ``python`` program, but don't build the
standard library extension modules.
* ``make profile-opt``: build Python using Profile Guided Optimization (PGO).
You can use the configure :option:`--enable-optimizations` option to use
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You can use the configure :option:--enable-optimizations option to make this the default of the make command.

At the beginning of the files, C extensions are built as built-in modules.
Extensions defined after the ``*shared*`` marker are built as dynamic libraries.

The :file:`setup.py` script only build C extensions as shared libraries using
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: builds

C compiler command used to build the ``main()`` function of programs like
``python``.

Variable set by the :option:`--with-cxx-main` option.
Copy link
Contributor

Choose a reason for hiding this comment

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

of the configure script?


.. envvar:: PURIFY

Purify command. Purify is a memory debugger program.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add a link to the official purify website (looks like a closed source tool, right?)

Copy link
Member Author

Choose a reason for hiding this comment

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

I found https://en.wikipedia.org/wiki/PurifyPlus but I'm not sure if it's this software. In case of doubt, I prefer to omit it.

Yeah, it's closed source. GCC and Clang have now great open source implementations (ASAN, UBSAN, etc.) supported by Python, see the Debug Options in this document.

@vstinner
Copy link
Member Author

vstinner commented Apr 9, 2021

@serge-sans-paille: PR updated to address your review.

@vstinner vstinner merged commit bd88ccb into python:master Apr 9, 2021
@vstinner vstinner deleted the configure_pgo_lto branch April 9, 2021 12:35
@vstinner
Copy link
Member Author

vstinner commented Apr 9, 2021

Thanks for the review @serge-sans-paille! I merged my PR. I plan to send an email to python-dev to get a wider review, once the doc will be online at docs.python.org.

@stefanrad25
Copy link

stefanrad25 commented Apr 9, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants