File: liblink

package info (click to toggle)
iml 1.0.3-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,020 kB
  • ctags: 180
  • sloc: sh: 8,654; ansic: 6,206; makefile: 70
file content (83 lines) | stat: -rw-r--r-- 2,287 bytes parent folder | download | duplicates (4)
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
83


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 ATLAS 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>,
  ATLAS header file is in directory <atlas-include-dir>,
  ATLAS library is in directory <atlas-lib-dir>.


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<atlas-include-dir>, -I<gmp-include-dir>


Linking
=======

Your program must have the following linking flags

-liml -lcblas -latlas -lgmp 

It is important to put flag -liml ahead of other three flags, and 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<atlas-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<atlas-include-dir> -I<gmp-include-dir>]
   yourprogram.c [-o yourprogram] 
   [-L<iml-lib-dir> -L<atlas-lib-dir> -L<gmp-lib-dir>] 
   -liml -lcblas -latlas -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"
}