Go to the first, previous, next, last section, table of contents.


11 Using the library

For the following discussion, we will assume that you have installed the CLN source in $CLN_DIR and built it in $CLN_TARGETDIR. For example, for me it's CLN_DIR="$HOME/cln" and CLN_TARGETDIR="$HOME/cln/linuxelf". You might define these as environment variables, or directly substitute the appropriate values.

11.1 Compiler options

Until you have installed CLN in a public place, the following options are needed:

When you compile CLN application code, add the flags

   -I$CLN_DIR/include -I$CLN_TARGETDIR/include

to the C++ compiler's command line (make variable CFLAGS or CXXFLAGS). When you link CLN application code to form an executable, add the flags

   $CLN_TARGETDIR/src/libcln.a

to the C/C++ compiler's command line (make variable LIBS).

If you did a make install, the include files are installed in a public directory (normally /usr/local/include), hence you don't need special flags for compiling. The library has been installed to a public directory as well (normally /usr/local/lib), hence when linking a CLN application it is sufficient to give the flag -lcln.

11.2 Include files

Here is a summary of the include files and their contents.

<cl_object.h>
General definitions, reference counting, garbage collection.
<cl_number.h>
The ordinary number classes.
<cl_real.h>
Functions for class cl_R, the real numbers.
<cl_float.h>
Functions for class cl_F, the floats.
<cl_sfloat.h>
Functions for class cl_SF, the short-floats.
<cl_ffloat.h>
Functions for class cl_FF, the single-floats.
<cl_dfloat.h>
Functions for class cl_DF, the double-floats.
<cl_lfloat.h>
Functions for class cl_LF, the long-floats.
<cl_rational.h>
Functions for class cl_RA, the rational numbers.
<cl_integer.h>
Functions for class cl_I, the integers.
<cl_complex.h>
Functions for class cl_N, the complex numbers.
<cl_random.h>
Random number generators.
<cl_malloc.h>
cl_malloc_hook, cl_free_hook.
<cl_abort.h>
cl_abort.
<cl_io.h>
Input/Output.
<cl_input.h>
Flags for customizing input operations.
<cl_output.h>
Flags for customizing output operations.
<cl_condition.h>
Conditions/exceptions.
<cl_string.h>
Strings.
<cl_symbol.h>
Symbols.
<cl_proplist.h>
Property lists.
<cl_ring.h>
General rings.
<cl_numtheory.h>
Number threory functions.
<cl_modinteger.h>
Modular integers.
<cl_V.h>
Vectors.
<cl_GV.h>
General vectors.
<cl_GV_integer.h>
General vectors over cl_I.
<cl_GV_rational.h>
General vectors over cl_RA.
<cl_GV_real.h>
General vectors over cl_R.
<cl_GV_complex.h>
General vectors over cl_N.
<cl_GV_modinteger.h>
General vectors of modular integers.
<cl_SV.h>
Simple vectors.
<cl_SV_integer.h>
Simple vectors over cl_I.
<cl_SV_rational.h>
Simple vectors over cl_RA.
<cl_SV_real.h>
Simple vectors over cl_R.
<cl_SV_complex.h>
Simple vectors over cl_N.
<cl_SV_ringelt.h>
Simple vectors of general ring elements.
<cl_univpoly.h>
Univariate polynomials.
<cl_univpoly_integer.h>
Univariate polynomials over the integers.
<cl_univpoly_rational.h>
Univariate polynomials over the rational numbers.
<cl_univpoly_real.h>
Univariate polynomials over the real numbers.
<cl_univpoly_complex.h>
Univariate polynomials over the complex numbers.
<cl_univpoly_modint.h>
Univariate polynomials over modular integer rings.
<cl_timing.h>
Timing facilities.
<cln.h>
Includes all of the above.

11.3 An Example

(This section still needs to be written.)

11.4 Debugging support

When debugging a CLN application with GNU gdb, two facilities are available from the library:


Go to the first, previous, next, last section, table of contents.