/usr/share/doc/libiml-dev/liblink is in libiml-dev 1.0.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | This file provides instructions on how to compile and link your programs with
the library. You could link C or C++ programs with the library.
The package will install library libiml.a and header file iml.h in the target
machine. To link with the library, you need to locate the package directory
as well as GMP and CBLAS (ATLAS by default) directories.
Suppose
compiler is CC,
this package header file is in directory <iml-include-dir>,
this package library is in directory <iml-lib-dir>,
GMP header file is in directory <gmp-include-dir>,
GMP library is in directory <gmp-lib-dir>,
CBLAS header file is in directory <cblas-include-dir>,
CBLAS library is in directory <cblas-lib-dir>,
linker flags needed to link to CBLAS are <cblas-linker-flags>.
Header Include
==============
In the source code of your program, you should include both "gmp.h" and
"iml.h" like this:
#include "gmp.h"
#include "iml.h"
It is important to put "gmp.h" ahead of "iml.h" since iml.h uses symbols
defined in GMP.
Header Options
==============
If the header files are not installed in the default search path, which is
usually /usr or /usr/local, you should add one more of the following options
-I<iml-include-dir>, -I<cblas-include-dir>, -I<gmp-include-dir>
Linking
=======
Your program must have the following linking flags
-liml <cblas-linker-flags> -lgmp
It is important to put flag -liml ahead of other three flags.
If ATLAS is used, then <cblas-linker-flags> should be "-lcblas -latlas"
Note that it is also important to put -lcblas ahead of -latlas.
If the libraries are not installed in the default search path, you should add
one or more of the following options
-L<iml-lib-dir> -L<cblas-lib-dir> -L<gmp-lib-dir>
Overall, you could use the following way to compile and link your program with
this library:
CC [-I<iml-include-dir> -I<cblas-include-dir> -I<gmp-include-dir>]
yourprogram.c [-o yourprogram]
[-L<iml-lib-dir> -L<cblas-lib-dir> -L<gmp-lib-dir>]
-liml <cblas-linker-flags> -lgmp
icc compiler
=============
If you compile C programs using icc, you might need add another linker flag
-no_cpprt. Otherwise, the linker might link with a run time C++ library and
end up with an error message.
Use the Library in C++
======================
If you want to call the library functions from C++ programs, you need to
include the package header file in the following way
extern "C"
{
#include "iml.h"
}
|