C files calling UDI functions must include the header file:
#include <udi.h>This header defines various things that are needed to call the UDI routines. You may also need to add the option
-I/usr/local/include/udi-2.0" to your
SPMquot
cc" command line so that the compiler can find all the UDI
specific header files.
Before you make any calls to UDI, you need to call the
initialization routine begin_udi(0)" .
Similarly, before your programs exits it should call
SPMquot
end_udi()" .
Each time you call a UDI function, several tests are made to make
sure that you haven't made an error. This adds a bit of overhead,
especially since most DSP applications loop through the same
operations over and over. There exist, therefore, two sets of UDI
libraries, one with tests, and one without. During the
debugging phase of your application, you should link to the
library which includes the test code by adding
-ludi+ -ludifun+" to the
SPMquot
cc" command line, and defining
the C preprocessor variable ``TEST''. After you are reasonably sure
that your application is working, you can increase processing
performance and reduce the size of the executable
by linking to the libraries without the test code with
SPMquot
-ludi -ludifun". Depending on your compiler and where these
libraries are installed, you might also need to add
-L/usr/local/lib" to the
cc" command line as well. See
Figure 2.1 for a
makefile" skeleton for compiling a UDI
application.