Skip to content

Commit a8e60df

Browse files
committed
Update Python docs
1 parent 8bea64a commit a8e60df

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

‎manual/tracy.tex‎

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,37 +2392,30 @@ \subsubsection{Bindings}
23922392

23932393
\subsubsection{Building the Python package}
23942394

2395-
To build the Python package, you will need to use the CMake build system to compile the Tracy-Client.
2396-
The CMake option \texttt{-D TRACY\_CLIENT\_PYTHON=ON} is used to enable the generation of the Python bindings in conjunction with a mandatory creation of a shared Tracy-Client library via one of the CMake options \texttt{-D BUILD\_SHARED\_LIBS=ON} or \texttt{-D DEFAULT\_STATIC=OFF}.
2397-
2398-
The following other variables are available in addition:
2399-
2400-
\begin{itemize}
2401-
\item \texttt{EXTERNAL\_PYBIND11} --- Can be used to disable the download of pybind11 when Tracy is embedded in another CMake project that already uses pybind11.
2402-
\item \texttt{TRACY\_CLIENT\_PYTHON\_TARGET} --- Optional directory to copy Tracy Python bindings to when Tracy is embedded in another CMake project.
2403-
\item \texttt{BUFFER\_SIZE} --- The size of the global pointer buffer (defaults to 128) for naming Tracy profiling entities like frame marks, plots, and memory locations.
2404-
\item \texttt{NAME\_LENGTH} --- The maximum length (defaults to 128) of a name stored in the global pointer buffer.
2405-
\end{itemize}
2406-
2407-
Be aware that the memory allocated by this buffer is global and is not freed, see section~\ref{uniquepointers}.
2408-
2409-
See below for example steps to build the Python bindings using CMake:
2395+
To build the Python package, run the following commands:
24102396

24112397
\begin{lstlisting}
2412-
mkdir build
2413-
cd build
2414-
cmake -DTRACY_STATIC=OFF -DTRACY_CLIENT_PYTHON=ON ../
2415-
make -j$(nproc)
2398+
cd ../python
2399+
pip wheel .
24162400
\end{lstlisting}
24172401

2418-
Once this has finished building the Python package can be built as follows:
2402+
This will create a wheel package in the \texttt{python} folder.
2403+
Please note that this requires CMake and a C++ compiler installed on the system, as the Tracy-Client library is built in the background.
24192404

2405+
You can pass additional CMake options to the package build to configure the Tracy-Client library:
24202406
\begin{lstlisting}
2421-
cd ../python
2422-
python3 setup.py bdist_wheel
2407+
pip wheel . --config-settings cmake.define.TRACY_ENABLE=OFF
24232408
\end{lstlisting}
24242409

2425-
The created package will be in the folder \texttt{python/dist}.
2410+
The following additional CMake options are available when building the Python package:
2411+
2412+
\begin{itemize}
2413+
\item \texttt{BUFFER\_SIZE} --- The size of the global pointer buffer (defaults to 128) for naming Tracy profiling entities like frame marks, plots, and memory locations.
2414+
\item \texttt{NAME\_LENGTH} --- The maximum length (defaults to 128) of a name stored in the global pointer buffer.
2415+
\item \texttt{EXTERNAL\_PYBIND11} --- Can be used to disable the download of pybind11 when Tracy is embedded in another CMake project that already uses pybind11.
2416+
\end{itemize}
2417+
2418+
Be aware that the memory allocated by this buffer is global and is not freed, see section~\ref{uniquepointers}.
24262419

24272420
\subsection{Fortran API}
24282421
\label{fortranapi}

0 commit comments

Comments
 (0)