Skip to content

Commit

Permalink
Add info about LTO usage for Fortran; C++ projects can be linked as b…
Browse files Browse the repository at this point in the history
…efore
  • Loading branch information
foxtran committed Jan 11, 2025
1 parent 7c48baf commit 9d03627
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion manual/tracy.tex
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ \subsubsection{CMake integration}

\begin{lstlisting}
# set options before add_subdirectory
# available options: TRACY_ENABLE, TRACY_ON_DEMAND, TRACY_NO_BROADCAST, TRACY_NO_CODE_TRANSFER, ...
# available options: TRACY_ENABLE, TRACY_LTO, TRACY_ON_DEMAND, TRACY_NO_BROADCAST, TRACY_NO_CODE_TRANSFER, ...
option(TRACY_ENABLE "" ON)
option(TRACY_ON_DEMAND "" ON)
add_subdirectory(3rdparty/tracy) # target: TracyClient or alias Tracy::TracyClient
Expand Down Expand Up @@ -2406,6 +2406,20 @@ \subsubsection{First steps}
target_link_libraries(<TARGET> PUBLIC Tracy::TracyClientF90)
\end{lstlisting}

For using Link-Time optimizations, link both \texttt{Tracy::TracyClient} and \texttt{Tracy::TracyClientF90} to any target where you use Tracy for profiling:

\begin{lstlisting}
target_link_libraries(<TARGET> PUBLIC Tracy::TracyClient Tracy::TracyClientF90)
\end{lstlisting}

\begin{bclogo}[
noborder=true,
couleur=black!5,
logo=\bcbombe
]{Important}
The same compiler (vendor + version) must be used for LTO for \textbf{ALL} languages in project.
\end{bclogo}

\begin{bclogo}[
noborder=true,
couleur=black!5,
Expand Down Expand Up @@ -2434,6 +2448,12 @@ \subsubsection{First steps}
\begin{lstlisting}
target_link_libraries(<TARGET> PUBLIC TracyClientF90)
\end{lstlisting}

For using Link-Time optimizations (LTO), you also need to link with \texttt{TracyClient}:

\begin{lstlisting}
target_link_libraries(<TARGET> PUBLIC TracyClient TracyClientF90)
\end{lstlisting}
\end{bclogo}

\paragraph{\texttt{tracy} module}
Expand Down

0 comments on commit 9d03627

Please sign in to comment.