This page describes how to use the library without installing it.
You do not have time, do not know how or do not want to install
decoding
but still, you want to use it.
Suppose that you have uncompress decoding
in /dir/where/decoding/is
.
Just run make
within the directory of decoding
. Then you can
use decoding
without doing anything else.
Go to your favorite directory where you write code. Create
any .c
file, say foo.c
containing whatever you want. For exemple
put the following.
#include <decoding/decoding.h>
#define PRIME 101
#include <decoding/rings/gfp_word.c>
#include <decoding/algos.c>
int main(void) {
gf101 a;
gf101_ring_init();
gf101_random(a);
gf101_ll_print("a=%en",a);
return 0;
}
If you want to compile foo.c
just type at prompt
gcc `/dir/where/decoding/is/cflags` foo.c `/dir/where/decoding/is/ldflags` -o foo
If you have a Makefile
for your project you can for exemple add
in it the following.
...
CC = your_favorite_compiler
CFLAGS = your_cflags
LDFLAGS = your_ldflags
...
DECODING_CFLAGS = /dir/where/decoding/is/cflags
DECODING_LDFLAGS = /dir/where/decoding/is/ldflags
...
foo:
$(CC) `$(DECODING_CFLAGS)` $(CFLAGS) foo.c `$(DECODING_LDFLAGS)` $(LDFLAGS) -o foo
...
The executable you will build will be indenpendent of decoding
because decoding
only comes with a static library (.a
file). This is particularily
useful if you are building a library that you want to redistribute.
If you do not install decoding
you are not able, a priori, to
consult the manpages with a simple call to man
. You have to
specify the directory of the manpage you want to consult.
For exemple to see this manpage you have to type the following.
man /dir/where/decoding/is/doc/man3/decoding-cwi.3
You can also add the /dir/where/decoding/is/doc
to the MANPATH
environment variable so that man
will also search in the latter
directory for manpages. You can then consult the current manpage
with a simple man deciding-cwi
.
If you are fond of HTML
you can also access the HTML documentation.
Open the /dir/where/decoding/is/doc/html/index.html
in your
favorite browser and just read the documentation.
The library can be used by any C++ program. Just build the library
as described in the help, see decoding-build
(3). To build your
program with a C++ compiler, do as described above, just replace
gcc
by g++
or whatever C++ compiler you want.
All functions provided by the library are within the namespace
decoding
.
Written by Guillaume Quintin (quintin@lix.polytechnique.fr).
decoding-quick
(3),
man
(1).