<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                            INVOKING THE COMPILER                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\chapter{Invoking the \faust compiler}
The \faust compiler is invoked using the \texttt{faust} command. It translate \faust programs into C++ code.
The generated code can be wrapped into an optional \emph{architecture file} allowing to directly produce a fully operational program.

\begin{rail}
compiler : "faust" (options) (file +);
\end{rail}

For example \lstinline'faust noise.dsp' will compile \lstinline'noise.dsp' and output the corresponding C++ code on the standard output.  The option \lstinline'-o' allows to choose the output file : \lstinline'faust noise.dsp -o noise.cpp'. The option \lstinline'-a' allows to choose the architecture file : \lstinline'faust -a alsa-gtk.cpp noise.dsp'. 

To compile a \faust program into an ALSA application on Linux you can use the following commands: 
\begin{lstlisting}
	faust -a alsa-gtk.cpp noise.dsp -o noise.cpp
	g++ -lpthread -lasound  
		`pkg-config --cflags --libs gtk+-2.0` 
		noise.cpp -o noise
\end{lstlisting} 

\section{Compilation options}
Compilation options are listed in the following table :

\bigskip

\small
%%\begin{tabularx}{\textwidth}[t]{|l|l|X|}

\tablefirsthead{
\hline
\textbf{Short} 				&amp; \textbf{Long} 					&amp; \textbf{Description}   \\
\hline
}
\tablehead{
\hline
\textbf{Short} 				&amp; \textbf{Long} 					&amp; \textbf{Description}   \\
\hline
}
\tabletail{
  \hline
  \multicolumn{3}{|r|}{\small\sl continued on next page}\\
  \hline
}
\tablelasttail{
  \hline
}


\begin{supertabular}{|p{1.5cm}|p{4cm}|p{5cm}|}  
\texttt{-h} 				&amp; \texttt{--help} 					&amp; print the help message  \\
\texttt{-v} 				&amp; \texttt{--version} 				&amp; print version information  \\
\texttt{-d} 				&amp; \texttt{--details} 				&amp; print compilation details  \\
\texttt{-tg} 				&amp; \texttt{--task-graph} 			&amp; draw a graph of all internal computation loops as a .dot (graphviz) file. \\
\texttt{-sg} 				&amp; \texttt{--signal-graph} 			&amp; draw a graph of all internal signal expressions as a .dot (graphviz) file.  \\

\texttt{-ps} 				&amp; \texttt{--postscript} 			&amp; generate block-diagram postscript files  \\
\texttt{-svg} 				&amp; \texttt{--svg} 					&amp; generate block-diagram svg files  \\
\texttt{-blur} 				&amp; \texttt{--shadow-blur} 			&amp; add a blur to boxes shadows  \\
\texttt{-sd} 				&amp; \texttt{--simplify-diagrams} 		&amp; simplify block-diagram before drawing them  \\
\texttt{-f \farg{n}} 		&amp; \texttt{--fold \farg{n}}  		&amp; max complexity of svg diagrams before splitting into several files (default 25 boxes)  \\
\texttt{-mns \farg{n}} 		&amp; \texttt{--max-name-size \farg{n}} &amp; max character size used in svg diagram labels\\
\texttt{-sn}             	&amp; \texttt{--simple-names}			&amp; use simple names (without arguments) for block-diagram (default max size : 40 chars) \\
\texttt{-xml} 				&amp; \texttt{--xml} 					&amp; generate an additional description file in xml format  \\
\texttt{-uim} 				&amp; \texttt{--user-interface-macros} 	&amp; add user interface macro definitions to the C++ code  \\
\texttt{-flist} 			&amp; \texttt{--file-list} 				&amp; list all the source files and libraries implied in a compilation  \\
\texttt{-norm} 				&amp; \texttt{--normalized-form} 		&amp; prints the internal signals in normalized form and exits  \\
\hline
\texttt{-lb}	 			&amp; \texttt{--left-balanced} 			&amp; generate left-balanced expressions  \\
\texttt{-mb} 				&amp; \texttt{--mid-balanced} 			&amp; generate mid-balanced expressions (default)  \\
\texttt{-rb} 				&amp; \texttt{--right-balanced}			&amp; generate right-balanced expressions  \\
\texttt{-lt} 				&amp; \texttt{--less-temporaries}		&amp; generate less temporaries in compiling delays  \\
\texttt{-mcd \farg{n}}		&amp; \texttt{--max-copy-delay \farg{n}}&amp; threshold between copy and ring buffer delays (default 16 samples)\\
\hline
\texttt{-vec} 				&amp; \texttt{--vectorize}				&amp; generate easier to vectorize code  \\
\texttt{-vs \farg{n}}		&amp; \texttt{--vec-size \farg{n}}		&amp; size of the vector (default 32 samples) when -vec \\
\texttt{-lv \farg{n}}		&amp; \texttt{--loop-variant \farg{n}}	&amp; loop variant [0:fastest (default), 1:simple] when -vec\\
\texttt{-dfs} 				&amp; \texttt{--deepFirstScheduling}	&amp; schedule vector loops in deep first order when -vec \\
\hline
\texttt{-omp} 				&amp; \texttt{--openMP}					&amp; generate parallel code using OpenMP (implies -vec)  \\
\texttt{-sch} 				&amp; \texttt{--scheduler}				&amp; generate parallel code using threads directly (implies -vec)  \\
\texttt{-g} 				&amp; \texttt{--groupTasks}				&amp; group sequential tasks together when -omp or -sch is used \\
\hline
\texttt{-single} 			&amp; \texttt{--single-precision-floats} &amp; use floats for internal computations (default)  \\
\texttt{-double} 			&amp; \texttt{--double-precision-floats} &amp; use doubles for internal computations  \\
\texttt{-quad} 				&amp; \texttt{--quad-precision-floats}	&amp;  use extended for internal computations  \\
\hline
\texttt{-mdoc} 				&amp; \texttt{--mathdoc}				&amp; generates the full mathematical description of a \faust program \\
\texttt{-mdlang \farg{l}}			&amp; \texttt{--mathdoc-lang \farg{l}} 		&amp; choose the language of the mathematical description (\farg{l} = en, fr, ...) \\
\texttt{-stripmdoc} 			&amp; \texttt{--strip-mdoc-tags}		&amp; remove documentation tags when printing \faust listings\\
\hline
\texttt{-cn \farg{name}} 	&amp; \texttt{--class-name \farg{name}}	&amp; name of the dsp class to be used instead of 'mydsp' \\
\texttt{-t \farg{time}} 	&amp; \texttt{--timeout \farg{time}}	&amp; time out of time seconds (default 600) for the compiler to abort \\
\texttt{-a \farg{file}} 	&amp;  									&amp; architecture file to use  \\
\texttt{-o \farg{file}} 	&amp;  									&amp; C++ output file\\
%%\end{tabularx} 
\end{supertabular} 
\normalsize

\bigskip

</pre></body></html>