#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 620
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass ../ac-manual
\begin_preamble
\version{1.0.4}
\end_preamble
\use_default_options false
\begin_modules
tcolorbox
\end_modules
\maintain_unincluded_children no
\language english
\language_package default
\inputencoding auto-legacy
\fontencoding auto
\font_roman "times" "default"
\font_sans "helvet" "default"
\font_typewriter "courier" "default"
\font_math "auto" "auto"
\font_default_family sfdefault
\use_non_tex_fonts false
\font_sc false
\font_roman_osf false
\font_sans_osf false
\font_typewriter_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\float_placement class
\float_alignment class
\paperfontsize 12
\spacing onehalf
\use_hyperref true
\pdf_title "Ag++ Manual"
\pdf_author "Georg Blaschke & other AspectC++ team members"
\pdf_subject "Documentation"
\pdf_keywords "AOP, AspectC++, ag++"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\papersize a4
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 0
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_formatted_ref 0
\use_minted 0
\use_lineno 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 3cm
\topmargin 3cm
\rightmargin 2.5cm
\bottommargin 3cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 2
\paperpagestyle fancy
\tablestyle default
\tracking_changes false
\output_changes false
\change_bars false
\postpone_fragile_content false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\docbook_table_output 0
\docbook_mathml_prefix 1
\end_header

\begin_body

\begin_layout Title

\emph on
Ag++  Manual
\end_layout

\begin_layout Author

\size largest
The AspectC++ Developers
\begin_inset VSpace 3mm
\end_inset


\begin_inset Newline newline
\end_inset


\size default
Version 2.5
\end_layout

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
clearpage
\end_layout

\end_inset


\end_layout

\begin_layout Section

\family sans
\begin_inset CommandInset label
LatexCommand label
name "sec:Introduction"

\end_inset


\family default
Introduction
\end_layout

\begin_layout Standard
The 
\family typewriter
ag++
\family default
 program provides a more intuitive frontend to the AspectC++ weaver (
\family typewriter
ac++
\family default
) in a GNU environment.
 The only prerequisites are a working installation of GNU C++ compiler,
 which also can run within a cygwin environment.
 It basically wraps the functionality of the aspect weaver and the c++ compiler into one single program.
 
\end_layout

\begin_layout Subsection
Weaving and Compiling in ag++
\end_layout

\begin_layout Standard

\family typewriter
ag++
\family default
 calls 
\family typewriter
ac++
\family default
 for each file in the parameter list.
 
\family typewriter
ac++
\family default
 then weaves the .cpp,
 .h and .ah files into a temporary .acc file.
 The .acc file contains all aspect headers and source code combined in regular C++ code.
 
\family typewriter
g++
\family default
 (or when specified,
 another back-end compiler) then compiles the .acc file into .o object files or an .elf executable.
 The generated .acc file can be saved and used for debugging using 
\family typewriter
--keep_woven 
\family default
or 
\family typewriter
--weave_only
\family default
 parameters (see Section 
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:Debugging with .acc files"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

).
 The whole translation process is illustrated in Figure 
\begin_inset CommandInset ref
LatexCommand formatted
reference "Figure:Figure 1"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
alignment center
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename ../images/acc context.svg
	width 14cm

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout

\family sans
\begin_inset CommandInset label
LatexCommand label
name "Figure:Figure 1"

\end_inset


\family default
Weaving and Compiling in ag++
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Section

\family sans
\begin_inset CommandInset label
LatexCommand label
name "sec:Invocation"

\end_inset


\family default
Invocation
\end_layout

\begin_layout Standard
The usage of 
\family typewriter
ag++
\family default
 is mainly influenced by the usage of the GNU g++ compiler and the synopsis is like:
\end_layout

\begin_layout Standard

\family typewriter
\begin_inset listings
lstparams "language=bash"
inline false
status open

\begin_layout Plain Layout

ag++ [options] [files...]
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Let's say,
 you want to 
\series bold
compile
\series default
 a single file (here:
 
\family typewriter
main.cc
\family default
) with 
\family typewriter
g++,

\family default
 you have to run
\end_layout

\begin_layout Standard

\family typewriter
\begin_inset listings
lstparams "language=bash"
inline false
status open

\begin_layout Plain Layout

g++ -c main.cc
\end_layout

\end_inset


\end_layout

\begin_layout Standard
in order to generate an object file.
\end_layout

\begin_layout Standard
To 
\series bold
weave
\series default
 and 
\series bold
compile
\series default
 a single file you simply invoke
\end_layout

\begin_layout Standard

\family typewriter
\begin_inset listings
lstparams "language=bash"
inline false
status open

\begin_layout Plain Layout

ag++ -c main.cc
\end_layout

\end_inset


\end_layout

\begin_layout Standard
the same way like you did before with 
\family typewriter
g++
\family default
.
\end_layout

\begin_layout Subsection
Options
\end_layout

\begin_layout Standard
All available options are summed up in the options table (see table 
\begin_inset CommandInset ref
LatexCommand ref
reference "tab:options"
nolink "false"

\end_inset

).
 The column labeled with 
\emph on
AC++
\emph default
 shows if the option is taken over from 
\family typewriter
ac++
\family default
 by 
\family typewriter
ag++
\family default
 ('X'),
 not supported by 
\family typewriter
ac++
\family default
 ('–') or modified by 
\family typewriter
ag++
\family default
 ('!').
 All options which are taken over,
 are not described in this document.
 Consult the AC++ Compiler Manual instead.
 Options which are not listed in the option table are accounted as 
\family typewriter
g++
\family default
 options.
 Some 
\family typewriter
g++
\family default
 options can not be automatically handled correctly by the options parser of 
\family typewriter
ag++.

\family default
 So all 
\family typewriter
g++
\family default
 options starting with 
\family typewriter
-p,
 -a,
 -d and -r
\family default
 (e.g.
 
\family typewriter
-pipe,
 -ansi,
 -dletters ,-remap
\family default
 ) have to be written between 
\family typewriter
--Xcompiler
\family default
 (see 
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:--Xcompiler"
nolink "false"

\end_inset

) and 
\family typewriter
--Xweaver
\family default
 (see 
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:--Xweaver"
nolink "false"

\end_inset

).
 If such options passed to 
\family typewriter
ag++
\family default
 without using 
\family typewriter
--Xcompiler
\family default
 they will be interpreted a 
\family typewriter
ag++/ac++
\family default
 options ;
 e.g.
 
\family typewriter
-pipe
\family default
 will be interpreted as 
\family typewriter
-p 
\begin_inset Quotes eld
\end_inset

ipe
\family default

\begin_inset Quotes erd
\end_inset


\family typewriter
.
\end_layout

\begin_layout Standard
\begin_inset Float table
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="31" columns="3">
<features tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="block" valignment="top" width="7cm">
<row endhead="true" newpage="true">
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
AC++
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Description
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--gen_config
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Only generate Puma configuration file
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--weave_only 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
Weave only
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-c 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
!
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
Compile only
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--keep_woven
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
Keep woven source code files
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--c_compiler <arg> 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
Path to C++ compiler
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--ac_compiler <arg> 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
Path to AspectC++ compiler
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--config_command <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Specify command which prints information about compiler
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--Xcompiler
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
In case of doupt account following options as 
\family typewriter
g++
\family default
 options.
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--Xweaver
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
In case of doupt account following options as 
\family typewriter
ac++
\family default
 options.
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--deps <arg> 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
–
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Path to an aspect dependency file (combine with -M...)
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-p|--path
\begin_inset space ~
\end_inset

<arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
!
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Defines a project directory
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-d|--dest <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Specifies a target directory for saving
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-v|--verbose <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
!
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Level of verbosity (
\family typewriter
0
\family default
-
\family typewriter
9
\family default
)
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-o|--output <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Name of the output file
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--include_files
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Generate manipulated header files (short version 
\family typewriter
-i
\family default
 is not supported)
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-a|--aspect_header <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
!
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
Name of aspect header file or
\family default
\series default
\shape default
\emph default
\bar default
 
\family typewriter
\size default
\noun default
\color inherit
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-r|--repository <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Name of the project repository
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--expr <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Pointcut expression to match in repository
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--config <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
!
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Parser configuration file
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--no_line
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Disable generation of 
\family typewriter
#line
\family default
 directives
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-k|--keywords
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Allow AspectC++ keywords in normal project files
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--real-instances
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Let 
\family typewriter
ac++
\family default
 perform a full template analysis
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--problem...
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Enable back-end compiler problem workaround 
\end_layout

\end_inset
</cell>
</row>
<row newpage="true">
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--no_problem...
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Disable back-end compiler problem workaround
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--warn...
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Show a specific 
\family typewriter
ac++
\family default
 warning that is suppressed by default
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--no_warn...
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Suppress a specific 
\family typewriter
ac++
\family default
 warning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-I <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Include file search path
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-D <name>[=<value>]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Macro definitions
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
-U <name>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Undefine a macro
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family typewriter
--include <arg>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Forced include
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "tab:options"

\end_inset


\family typewriter
ag++
\family default
 Compiler Option Summary
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Subsubsection

\family typewriter
--gen_config
\end_layout

\begin_layout Standard
Just create a parser configuration and quit afterwards.
 The argument of the 
\family typewriter
-o
\family default
 option specifies the name of the file.
 In any other case (no 
\family typewriter
--gen_config
\family default
 and/or no 
\family typewriter
-o
\family default
 option) a configuration file with the name 'puma.config' will be generated in the directory where 
\family typewriter
ag++
\family default
 was invoked.
 
\end_layout

\begin_layout Subsubsection

\family typewriter
--weave_only
\end_layout

\begin_layout Standard
Generate only woven source code files.
 With 
\family typewriter
-o
\family default
 option and one file the generated output is named after the argument of the 
\family typewriter
-o
\family default
 option.
 
\end_layout

\begin_layout Subsubsection

\family typewriter
--path
\end_layout

\begin_layout Standard
This options differs only slightly from the 
\family typewriter
--path
\family default
 option of 
\family typewriter
ac++
\family default
.
 In 
\family typewriter
ac++
\family default
 it is mandatory to specify a project path,
 whereby 
\family typewriter
ag++
\family default
 the current working directory is used as project path by default.
 Especially for larger projects it is NOT wise to rely on the default project path,
 as weaving take a lot of time.
 See the AspectC++ Compiler Manual for a more detailed description of this option.
\end_layout

\begin_layout Subsubsection

\family typewriter
-c
\end_layout

\begin_layout Standard
Like the 
\family typewriter
-c
\family default
 option of 
\family typewriter
g++
\family default
,
 this options effects the creation of object files of one or more source files.
\end_layout

\begin_layout Subsubsection

\family typewriter
-v|--verbose [<arg>]
\end_layout

\begin_layout Standard
Set the level of verbosity.
 
\end_layout

\begin_layout Subsubsection

\family typewriter
--aspect-header <arg>
\end_layout

\begin_layout Standard
This option differs from meaning in 
\family typewriter
ac++
\family default
 only if dependencies are generated ( see 
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:Generating-dependency-information"
nolink "false"

\end_inset

).
\end_layout

\begin_layout Subsubsection

\family typewriter
--keep_woven
\end_layout

\begin_layout Standard
Don't remove intermediate woven files.
\end_layout

\begin_layout Subsubsection

\family typewriter
--c_compiler
\end_layout

\begin_layout Standard
Specify path to GNU C++ compiler ̇ The default is 
\family typewriter
g++.
\end_layout

\begin_layout Subsubsection

\family typewriter
--ac_compiler
\end_layout

\begin_layout Standard
Specify path to AspectC++ compiler ̇ By default ag++ assumes,
 that the ac++ executable is located in the same directory like itself.
\end_layout

\begin_layout Subsubsection

\family typewriter
--config_command
\end_layout

\begin_layout Standard
Specify the command which prints information about the compiler.
 This information is necessary for generating the parser (puma) configuration file.
 The default value is 
\begin_inset Quotes erd
\end_inset


\family typewriter
<compiler> <compiler options> -E -dM -v -x c++ <an empty file>
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Subsubsection

\family typewriter
--config <arg>
\end_layout

\begin_layout Standard
Path to a puma configuration file.
 If this option is available the configuration file will not be generated automatically.
\end_layout

\begin_layout Subsubsection

\family typewriter
\begin_inset CommandInset label
LatexCommand label
name "subsec:--Xcompiler"

\end_inset

--Xcompiler
\end_layout

\begin_layout Standard

\family typewriter
ac++
\family default
 and 
\family typewriter
ag++
\family default
 options that might interfere with 
\family typewriter
g++
\family default
 options are not recognized after using 
\family typewriter
--Xcompiler
\family default
 in the argument list of an 
\family typewriter
ag++
\family default
 invocation.
 
\end_layout

\begin_layout Subsubsection

\family typewriter
\begin_inset CommandInset label
LatexCommand label
name "subsec:--Xweaver"

\end_inset

--Xweaver
\end_layout

\begin_layout Standard
Enable the recognition of those 
\family typewriter
ac++
\family default
 and 
\family typewriter
ag++
\family default
 options which previously have been disabled by the usage of –
\family typewriter
Xcompiler.
\end_layout

\begin_layout Subsubsection

\family typewriter
\begin_inset CommandInset label
LatexCommand label
name "subsec:--deps-<arg>"

\end_inset

--deps <arg>
\end_layout

\begin_layout Standard
This option is helpful to limit the effect of aspect header changes on incremental builds.
 The path to an aspect dependency file,
 which must exist,
 is passed as an argument.
 It only makes sense to use this option in combination with the generation of dependency information (see Section 
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:Generating-dependency-information"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

).
 An aspect dependency file consists of lines,
 where each line is either empty or defines an aspect dependency rule.
 The syntax of an aspect dependency rule is as follows:
\end_layout

\begin_layout LyX-Code

\emph on
<aspect-header-pattern>
\emph default
 '=>' 
\emph on
<source-code-pattern>
\end_layout

\begin_layout Standard
Each line may end with a comment that starts with 
\family typewriter
'#'
\family default
.
 A pattern is written in double quotes (
\family typewriter
'
\begin_inset Quotes erd
\end_inset

'
\family default
) and is matched against the canonical (absolute) path of source code files.
 
\family typewriter
'/'
\family default
 is used as the path separator.
 The left pattern is matched against all aspect header paths and the right against ordinary source code of the project.
 With this file the programmer of an aspect header can specify the source code files that are affected by the aspect.
\end_layout

\begin_layout LyX-Code
\begin_inset listings
lstparams "language=bash"
inline false
status open

\begin_layout Plain Layout

# Example aspect dependency rules
\end_layout

\begin_layout Plain Layout

"A1.ah" => "C.*"
\end_layout

\begin_layout Plain Layout

"D.ah" =>"/rootdir/**/dir/*.c++" # abc
\end_layout

\begin_layout Plain Layout

"deptest/?la.ah" => "y.c*"
\end_layout

\begin_layout Plain Layout

"dep*/b*.ah" => "x.h"
\end_layout

\begin_layout Plain Layout

"Slice*.ah" => ""
\end_layout

\end_inset


\end_layout

\begin_layout Standard
The first rule,
 for instance,
 specifies that a change in 
\family typewriter

\begin_inset Quotes eld
\end_inset

A1.ah
\begin_inset Quotes erd
\end_inset


\family default
 (or an included header file) shall trigger a rebuild of all translation units that depend on 
\family typewriter

\begin_inset Quotes eld
\end_inset

C.*
\begin_inset Quotes erd
\end_inset


\family default
,
 e.g.
 
\family typewriter

\begin_inset Quotes eld
\end_inset

C.cc
\begin_inset Quotes erd
\end_inset


\family default
 or 
\family typewriter

\begin_inset Quotes eld
\end_inset

C.h
\begin_inset Quotes erd
\end_inset


\family default
.
 Attention:
 If the rule is not consistent with the aspects that are implemented in 
\begin_inset Quotes eld
\end_inset

A1.ah
\begin_inset Quotes erd
\end_inset

,
 rebuilds will produce invalid programs.
 Use this feature with care!
 If there no rule for an aspect header in an aspect dependency file,
 
\emph on
all
\emph default
 translation units will depend on it.
 This is safe,
 but any change will trigger a 
\emph on
full rebuild
\emph default
.
 A path pattern may contain the following wildcard symbols:
\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="2">
<features tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Symbol
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Meaning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
*
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0 or more arbitrary characters in a path element
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
?
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 arbitrary character in a path element
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
**/
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0 or more arbitrary directory names
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
If a pattern does not begin with 
\family typewriter
'/'
\family default
,
 the pattern is automatically prefixed by 
\family typewriter
'/**/'
\family default
.
 As as consequence a filename,
 such as 
\family typewriter

\begin_inset Quotes eld
\end_inset

A1.ah
\begin_inset Quotes erd
\end_inset


\family default
,
 is matched in any directory of the project.
 The character '
\backslash
' is used as an escape character,
 e.g.
 
\family typewriter

\begin_inset Quotes eld
\end_inset

name-with-
\backslash
*.txt
\begin_inset Quotes erd
\end_inset


\family default
.
\end_layout

\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "subsec:Generating-dependency-information"

\end_inset

Generating dependency information
\end_layout

\begin_layout Standard
To produce dependency files just pass the 
\family typewriter
-M,
 -MM
\family default
,
 
\family typewriter
-MD
\family default
 or 
\family typewriter
-MMD
\family default
 to 
\family typewriter
ag++
\family default
 .
 Dependency files generated by 
\family typewriter
ag++
\family default
 are slighty different from dependency files created by 
\family typewriter
g++
\family default
,
 as they contain dependencies to aspect header files.
 If the 
\family typewriter
--aspect-header
\family default
 option is provided,
 only the header file specified as option argument is considered when building the dependency file;
 otherwise all aspect header files within the whole project path are considered.
\end_layout

\begin_layout Standard
If one or more aspect dependency files are provided,
 the dependency rules described in Section 
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:--deps-<arg>"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

 are applied.
 If there is no such file or if there is no rule defined for an aspect header,
 all translation units will depend on it.
\end_layout

\begin_layout Subsection
Examples
\end_layout

\begin_layout Itemize

\family typewriter
ag++ --help
\family default
 
\begin_inset Newline newline
\end_inset

Displays all options with a short description.
\end_layout

\begin_layout Itemize

\family typewriter
ag++ -o test Test.cc main.cc
\begin_inset Newline newline
\end_inset


\family default
Weave,
 compile and link the source files 
\family typewriter
Test.cc
\family default
 and 
\family typewriter
main.cc
\family default
.
 The created executable will be named '
\family typewriter
test
\family default
'.
\end_layout

\begin_layout Itemize

\family typewriter
ag++ --gen_config
\begin_inset Newline newline
\end_inset


\family default
Create a puma configuration file named 
\family typewriter
puma.config
\family default
 within the current working directory.
 
\end_layout

\begin_layout Itemize

\family typewriter
ag++ --gen_config -o my.config
\begin_inset Newline newline
\end_inset


\family default
Create a puma configuration file named 
\family typewriter
my.config.
\end_layout

\begin_layout Itemize

\family typewriter
ag++ --path src --include_files --dest gen/includes
\begin_inset Newline newline
\end_inset


\family default
Generate modified include files out of all include files found below 
\family typewriter
src
\family default
 directory and store them under '
\family typewriter
gen/includes
\family default
'.
\end_layout

\begin_layout Itemize

\family typewriter
ag++ -M -MFmain.d main.cc
\begin_inset Newline newline
\end_inset


\family default
Generate dependency file 
\family typewriter
main.d
\family default
 from source file 
\family typewriter
main.cc
\family default
 .
\end_layout

\begin_layout Itemize

\family typewriter
ag++ -MD -MFmain.d -c -o main.o main.cc
\begin_inset Newline newline
\end_inset


\family default
Generate dependency file 
\family typewriter
main.d
\family default
 and object file 
\family typewriter
main.o
\family default
 from source file 
\family typewriter
main.cc
\family default
 .
\end_layout

\begin_layout Itemize

\family typewriter
ag++ -p ../aspects -p .
 --Xcompiler
\begin_inset Newline newline
\end_inset


\family default
This string could be used to substitute 
\family typewriter
g++
\family default
 in a simple 
\family typewriter
make
\family default
 environment.
\end_layout

\begin_layout Section

\family sans
\begin_inset CommandInset label
LatexCommand label
name "sec:Special Use-Cases"

\end_inset


\family default
Special Use-Cases
\end_layout

\begin_layout Subsection

\family sans
\begin_inset CommandInset label
LatexCommand label
name "subsec:Debugging with .acc files"

\end_inset


\family default
Debugging with .acc Files
\end_layout

\begin_layout Standard
A temporary .acc file containing all source code and the woven aspect headers is generated when compiling (See Figure 
\begin_inset CommandInset ref
LatexCommand ref
reference "Figure:Figure 1"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

).
 This file is then used by 
\family typewriter
g++
\family default
 (or by another specified backend compiler) to compile to .o object files or an .elf executable.
 The temporary .acc-file can be saved and be used for debugging with the 
\family typewriter
--keep_woven 
\family default
or 
\family typewriter
--weave_only
\family default
 parameters.
 Because the code is woven automatically,
 the resulting .acc file is not optimized for readability.
 The following listing shows an example of woven code:
\end_layout

\begin_layout Standard
\begin_inset Flex Color Box
status open

\begin_layout Plain Layout
\begin_inset listings
lstparams "language={C++},basicstyle={\footnotesize\ttfamily}"
inline false
status open

\begin_layout Plain Layout

#line 6 "examples/helloworld/hello.h"
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

#line 6 "examples/helloworld/hello.h"
\end_layout

\begin_layout Plain Layout

void hello()
\end_layout

\begin_layout Plain Layout

#line 234 "main.acc"
\end_layout

\begin_layout Plain Layout

{
\end_layout

\begin_layout Plain Layout

  typedef TJP__Z5hellov_1< void,
 void,
 void,
 void (),
  AC::TLE > __TJP;
\end_layout

\begin_layout Plain Layout

    __TJP tjp;
\end_layout

\begin_layout Plain Layout

  tjp._result = 0;
\end_layout

\begin_layout Plain Layout

  AC::invoke_CSVProfiler_GenericProfiler__a0_around<__TJP> (&tjp);
\end_layout

\begin_layout Plain Layout

  
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

__attribute__((always_inline)) inline void __exec_old_hello()
\end_layout

\begin_layout Plain Layout

#line 6 "examples/helloworld/hello.h"
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

#line 6 "examples/helloworld/hello.h"
\end_layout

\begin_layout Plain Layout

{
\end_layout

\begin_layout Plain Layout

  std::cout << "Hello" << std::endl;
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Subsection

\family sans
\begin_inset CommandInset label
LatexCommand label
name "subsec:Optimization through config reuse"

\end_inset


\family default
Optimization by Configuration Reuse
\end_layout

\begin_layout Standard

\family typewriter
ag++
\family default
 generates a temporary configuration file that is deleted after compilation.
 To optimize compilation time,
 the configuration file can be generated once using 
\family typewriter
ag++ --gen_config
\family default
 and then be reused with 
\family typewriter
ag++ --config puma.config
\family default

\begin_inset Foot
status collapsed

\begin_layout Plain Layout
Historically a source code analysis and transformation framework called Puma was used to generate the configuration file.
 It it is no longer used in ag++,
 but it is still the default config name.
 The config name can be changed using the 
\family typewriter
-o
\family default
 paramter)
\end_layout

\end_inset

.
 The generated configuration file stores the system-specific information necessary to weave .cpp,
 .h,
 and .ah files into an .acc file.
 This information includes architecture of the target system,
 paths to system includes,
 system macros,
 and sizes of builtin data types (see Figure 4 for an example).
 The generated configuration file can be edited if needed,
 although this should not be necessary for normal usage.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
alignment center
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename ../images/ag++ puma.svg
	width 14cm

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Generation and usage of puma.config
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
alignment center
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "47line%"
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "default"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset listings
lstparams "basicstyle={\tiny\rmfamily}"
inline false
status open

\begin_layout Plain Layout

--size-type "long unsigned int"
\end_layout

\begin_layout Plain Layout

-D "__SIZE_WIDTH__=64"
\end_layout

\begin_layout Plain Layout

-D "__SSE2_MATH__=1"
\end_layout

\begin_layout Plain Layout

-D "__SSE2__=1"
\end_layout

\begin_layout Plain Layout

-D "__SSE_MATH__=1"
\end_layout

\begin_layout Plain Layout

-D "__SSE__=1"
\end_layout

\begin_layout Plain Layout

-D "__SSP_STRONG__=3"
\end_layout

\begin_layout Plain Layout

-D "__STDCPP_DEFAULT_NEW_ALIGNMENT__=16"
\end_layout

\begin_layout Plain Layout

-D "__STDCPP_THREADS__=1"
\end_layout

\begin_layout Plain Layout

-D "__STDC_HOSTED__=1"
\end_layout

\begin_layout Plain Layout

-D "__STDC_IEC_559_COMPLEX__=1"
\end_layout

\begin_layout Plain Layout

-D "__STDC_IEC_559__=1"
\end_layout

\begin_layout Plain Layout

-D "__STDC_IEC_60559_BFP__=201404L"
\end_layout

\begin_layout Plain Layout

-D "__STDC_IEC_60559_COMPLEX__=201404L"
\end_layout

\begin_layout Plain Layout

-D "__STDC_ISO_10646__=201706L"
\end_layout

\begin_layout Plain Layout

-D "__STDC_UTF_16__=1"
\end_layout

\begin_layout Plain Layout

-D "__STDC_UTF_32__=1"
\end_layout

\begin_layout Plain Layout

-D "__STDC__=1"
\end_layout

\begin_layout Plain Layout

-D "__UINT16_C(c)=c"
\end_layout

\begin_layout Plain Layout

-D "__UINT16_MAX__=0xffff"
\end_layout

\begin_layout Plain Layout

-D "__UINT16_TYPE__=short unsigned int"
\end_layout

\begin_layout Plain Layout

-D "__UINT32_C(c)=c ## U"
\end_layout

\begin_layout Plain Layout

-D "__UINT32_MAX__=0xffffffffU"
\end_layout

\begin_layout Plain Layout

-D "__UINT32_TYPE__=unsigned int"
\end_layout

\begin_layout Plain Layout

-D "__UINT64_C(c)=c ## UL"
\end_layout

\begin_layout Plain Layout

-D "__UINT64_MAX__=0xffffffffffffffffUL"
\end_layout

\begin_layout Plain Layout

-D "__UINT64_TYPE__=long unsigned int"
\end_layout

\begin_layout Plain Layout

-D "__UINT8_C(c)=c"
\end_layout

\begin_layout Plain Layout

-D "__UINT8_MAX__=0xff"
\end_layout

\begin_layout Plain Layout

-D "__UINT8_TYPE__=unsigned char"
\end_layout

\begin_layout Plain Layout

-D "__UINTMAX_C(c)=c ## UL"
\end_layout

\end_inset


\end_layout

\end_inset


\begin_inset space \hfill{}
\end_inset


\begin_inset Box Boxed
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "48line%"
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "default"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset listings
lstparams "basicstyle={\tiny\sffamily}"
inline false
status open

\begin_layout Plain Layout

-D "__cpp_template_auto=201606L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_template_template_args=201611L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_threadsafe_static_init=200806L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_unicode_characters=201411L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_unicode_literals=200710L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_user_defined_literals=200809L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_variable_templates=201304L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_variadic_templates=200704L"
\end_layout

\begin_layout Plain Layout

-D "__cpp_variadic_using=201611L"
\end_layout

\begin_layout Plain Layout

-D "__gnu_linux__=1"
\end_layout

\begin_layout Plain Layout

-D "__k8=1"
\end_layout

\begin_layout Plain Layout

-D "__k8__=1"
\end_layout

\begin_layout Plain Layout

-D "__linux=1"
\end_layout

\begin_layout Plain Layout

-D "__linux__=1"
\end_layout

\begin_layout Plain Layout

-D "__pic__=2"
\end_layout

\begin_layout Plain Layout

-D "__pie__=2"
\end_layout

\begin_layout Plain Layout

-D "__unix=1"
\end_layout

\begin_layout Plain Layout

-D "__unix__=1"
\end_layout

\begin_layout Plain Layout

-D "__x86_64=1"
\end_layout

\begin_layout Plain Layout

-D "__x86_64__=1"
\end_layout

\begin_layout Plain Layout

-D "linux=1"
\end_layout

\begin_layout Plain Layout

-D "unix=1"
\end_layout

\begin_layout Plain Layout

--target x86_64-linux-gnu
\end_layout

\begin_layout Plain Layout

--gnu 13.3.0
\end_layout

\begin_layout Plain Layout

--isystem "/usr/include/c++/13"
\end_layout

\begin_layout Plain Layout

--isystem "/usr/include/x86_64-linux-gnu/c++/13"
\end_layout

\begin_layout Plain Layout

--isystem "/usr/include/c++/13/backward"
\end_layout

\begin_layout Plain Layout

--isystem "/usr/lib/gcc/x86_64-linux-gnu/13/include"
\end_layout

\begin_layout Plain Layout

--isystem "/usr/local/include"
\end_layout

\begin_layout Plain Layout

--isystem "/usr/include/x86_64-linux-gnu"
\end_layout

\begin_layout Plain Layout

--isystem "/usr/include"
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Example content of puma.config
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Cross Compilation
\end_layout

\begin_layout Standard
By default,
 
\family typewriter
ag++
\family default
 invokes the host 
\family typewriter
g++
\family default
 compiler to generate the executable of woven code and the parser configuration file (see Section 
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:Optimization through config reuse"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

).
 However,
 you can also make 
\family typewriter
ag++
\family default
 use a 
\emph on
cross compiler
\emph default
.
 You can,
 for example,
 compile an program to ARM microcontrollers using the GNU ARM embedded toolchain with the following command:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "language=bash,basicstyle={\ttfamily},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

ag++ --c_compiler arm-none-eabi-g++ example.cpp
\end_layout

\end_inset


\end_layout

\begin_layout Standard
The 
\family typewriter
ag++
\family default
 option 
\family typewriter
--c_compiler
\family default
 specifies that the 
\family typewriter
arm-none-eabi-g++
\family default
 compiler (if installed) shall be used to generate the executable and the parser configuration file.
\end_layout

\begin_layout Standard
Note that since 
\family typewriter
ac++
\family default
 is internally using a clang parser in the weaving process,
 only targets supported by the open source version of clang work with 
\family typewriter
ac++
\family default
.
 To find out if your target is supported by 
\family typewriter
ac++
\family default
 you can install clang and print the target list with the following command:
 
\begin_inset Note Note
status collapsed

\begin_layout Plain Layout
Targets einfügen?
\end_layout

\begin_layout Plain Layout
aarch64 - AArch64 (little endian)
\end_layout

\begin_layout Plain Layout
aarch64_32 - AArch64 (little endian ILP32)
\end_layout

\begin_layout Plain Layout
aarch64_be - AArch64 (big endian)
\end_layout

\begin_layout Plain Layout
amdgcn - AMD GCN GPUs
\end_layout

\begin_layout Plain Layout
arm - ARM
\end_layout

\begin_layout Plain Layout
arm64 - ARM64 (little endian)
\end_layout

\begin_layout Plain Layout
arm64_32 - ARM64 (little endian ILP32)
\end_layout

\begin_layout Plain Layout
armeb - ARM (big endian)
\end_layout

\begin_layout Plain Layout
avr - Atmel AVR Microcontroller
\end_layout

\begin_layout Plain Layout
bpf - BPF (host endian)
\end_layout

\begin_layout Plain Layout
bpfeb - BPF (big endian)
\end_layout

\begin_layout Plain Layout
bpfel - BPF (little endian)
\end_layout

\begin_layout Plain Layout
hexagon - Hexagon
\end_layout

\begin_layout Plain Layout
lanai - Lanai
\end_layout

\begin_layout Plain Layout
loongarch32 - 32-bit LoongArch
\end_layout

\begin_layout Plain Layout
loongarch64 - 64-bit LoongArch
\end_layout

\begin_layout Plain Layout
mips - MIPS (32-bit big endian)
\end_layout

\begin_layout Plain Layout
mips64 - MIPS (64-bit big endian)
\end_layout

\begin_layout Plain Layout
mips64el - MIPS (64-bit little endian)
\end_layout

\begin_layout Plain Layout
mipsel - MIPS (32-bit little endian)
\end_layout

\begin_layout Plain Layout
msp430 - MSP430 [experimental]
\end_layout

\begin_layout Plain Layout
nvptx - NVIDIA PTX 32-bit
\end_layout

\begin_layout Plain Layout
nvptx64 - NVIDIA PTX 64-bit
\end_layout

\begin_layout Plain Layout
ppc32 - PowerPC 32
\end_layout

\begin_layout Plain Layout
ppc32le - PowerPC 32 LE
\end_layout

\begin_layout Plain Layout
ppc64 - PowerPC 64
\end_layout

\begin_layout Plain Layout
ppc64le - PowerPC 64 LE
\end_layout

\begin_layout Plain Layout
r600 - AMD GPUs HD2XXX-HD6XXX
\end_layout

\begin_layout Plain Layout
riscv32 - 32-bit RISC-V
\end_layout

\begin_layout Plain Layout
riscv64 - 64-bit RISC-V
\end_layout

\begin_layout Plain Layout
sparc - Sparc
\end_layout

\begin_layout Plain Layout
sparcel - Sparc LE
\end_layout

\begin_layout Plain Layout
sparcv9 - Sparc V9
\end_layout

\begin_layout Plain Layout
spirv - SPIR-V Logical
\end_layout

\begin_layout Plain Layout
spirv32 - SPIR-V 32-bit
\end_layout

\begin_layout Plain Layout
spirv64 - SPIR-V 64-bit
\end_layout

\begin_layout Plain Layout
systemz - SystemZ
\end_layout

\begin_layout Plain Layout
thumb - Thumb
\end_layout

\begin_layout Plain Layout
thumbeb - Thumb (big endian)
\end_layout

\begin_layout Plain Layout
ve - VE
\end_layout

\begin_layout Plain Layout
wasm32 - WebAssembly 32-bit
\end_layout

\begin_layout Plain Layout
wasm64 - WebAssembly 64-bit
\end_layout

\begin_layout Plain Layout
x86 - 32-bit X86:
 Pentium-Pro and above
\end_layout

\begin_layout Plain Layout
x86-64 - 64-bit X86:
 EM64T and AMD64
\end_layout

\begin_layout Plain Layout
xcore - XCore
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "language=bash,basicstyle={\ttfamily},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

clang -print-targets
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Besides the listed CPU types 
\family typewriter
ac++
\family default
 also supports the Infineon AURIX Tricore platform (
\family typewriter
tricore-g++
\family default
).
 
\end_layout

\begin_layout Subsection
Solving Option Ambiguities
\end_layout

\begin_layout Standard
Since 
\family typewriter
ag++
\family default
 executes both weaver and compiler,
 options that are passed to 
\family typewriter
ag++
\family default
 can have ambiguous meanings.
 For example you might want to run 
\family typewriter
ag++ -pipe
\family default
 to execute 
\family typewriter
g++
\family default
 with the 
\family typewriter
-pipe
\family default
 option,
 but 
\family typewriter
ac++ -p 
\begin_inset Quotes eld
\end_inset

ipe
\begin_inset Quotes erd
\end_inset


\family default
 will be executed instead,
 since both variants match your input and the matching weaver option is applied first.
 To clarify which tool your given option is intended for,
 you can use 
\family typewriter
--Xcompiler
\family default
 (see 
\begin_inset CommandInset ref
LatexCommand formatted
reference "subsec:--Xcompiler"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

) and 
\family typewriter
--Xweaver
\family default
 (see 
\begin_inset CommandInset ref
LatexCommand formatted
reference "subsec:--Xweaver"
plural "false"
caps "false"
noprefix "false"
nolink "false"

\end_inset

) in 
\family typewriter
ag++
\family default
.
 
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "language=bash,basicstyle={\ttfamily},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

ag++ --c_compiler arm-none-eabi-g++ 
\backslash

\end_layout

\begin_layout Plain Layout

--Xcompiler -specs=nosys.specs example.cpp
\end_layout

\end_inset


\end_layout

\begin_layout Standard
The above command uses the 
\family typewriter
--Xcompiler
\family default
 option to tell 
\family typewriter
ag++
\family default
 that every subsequent command line option shall be passed to the C++ (cross) compiler only.
 The other way around,
 any command line option after 
\family typewriter
--Xweaver
\family default
 will be passed to the ac++ tool only.
 You should pass special options to the cross compiler,
 such as 
\family typewriter
-specs=nosys.specs
\family default
 in our example,
 by placing them after the 
\family typewriter
--Xcompiler
\family default
 option.
 When designing a Makefile you should keep that in mind and include 
\family typewriter
–-Xcompiler
\family default
 per default.
\end_layout

\end_body
\end_document
