Subversion Repositories gelsvn

Rev

Rev 596 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 596 Rev 613
Line 1... Line -...
1
GEL README, Andreas Bærentzen, February 2006.
-
 
2
==========
-
 
3
 
-
 
4
This README describes the GEL project. GEL stands for Geometry and Linear 
-
 
5
Algebra which are the constituents we will mostly put into this library. It is
-
 
6
intended as a library for computer graphics and computer vision tasks with a
-
 
7
strong emphasis on the handling of shape and geometry. 
-
 
8
 
-
 
9
GEL is broken down into a number of libraries, and the overall structure is as
-
 
10
follows:
-
 
11
 
-
 
12
- CGLA is a library targeted at vectors and matrices of dimensions 2,3, and
-
 
13
  4. CGLA is useful in computer graphics where small efficient vectors are
-
 
14
	everywhere.
-
 
15
- LinAlg is a very simple Lapack wrapper which simplifies solving (large)
-
 
16
  linear systems. 
-
 
17
- Geometry contains (mostly) Spatial data structures. There are voxel grid
-
 
18
	class templates and a K-D tree template. There is also a triangle mesh class
-
 
19
	useful for real time rendering.
-
 
20
- HMesh is a half edge based polygonal mesh data structure. This is useful for
-
 
21
	algorithms which change mesh connectivity.
-
 
22
- GLGraphics contains Tools for visualization. There is a trackball and some
-
 
23
	other OpenGL compatible tools.
-
 
24
- Util contains various utilities such as hash table classes, a tool for
-
 
25
	command line arguments, a 2D grid class, a resource manager and other
-
 
26
	miscellany.  
-
 
27
 
-
 
28
GEL is intended for use both under a variety of unix platforms (Linux
-
 
29
and OSX in particular) and  under windows. This README is mostly for
-
 
30
unix users. Windows users should also consult README_MSVC
-
 
31
 
-
 
32
Dependencies: GEL depends on Lapack/BLAS, and OpenGL and GLUT. However, the applications have more dependencies.
-
 
33
 
-
 
34
Who made GEL
-
 
35
==========
-
 
36
 
-
 
37
GEL is mostly the work of Andreas Bærentzen, but other people
-
 
38
contribute. In particular, Jeppe Frisvad, Bjarke Jakobsen, Henrik
-
 
39
Aanæs, and Bent D. Larsen. We are all from Informatics and
-
 
40
Mathematical Modelling, a department of the Technical University of
-
 
41
Denmark. 
-
 
42
 
-
 
43
Regarding LICENSE.
-
 
44
==========
-
 
45
 
-
 
46
I was considering putting GEL under the LGPL. But it is a long complex
-
 
47
text. The longer any kind of document, the more chances for loopholes
-
 
48
in my opinion. Instead, I list a few simple rules below. The most
-
 
49
important one is that if you want to use GEL for some purpose, and it
-
 
50
is not crystal clear whether it is against the rules, contact me. As
-
 
51
for the rules:
-
 
52
 
-
 
53
You are allowed to use GEL for academic or commercial purposes. In
-
 
54
particular, you are welcome to give GEL to students as a basis for 
-
 
55
academic work or to use it for your own applications.
-
 
56
 
-
 
57
The biggest limitation that I want to impose is that you cannot repackage
-
 
58
GEL in any way. You are not allowed to distribute another library which
-
 
59
contains GEL or parts of GEL unless you make it clear that this other
-
 
60
library contains GEL. You are also not allowed to redistribute GEL in a
-
 
61
changed form. If you want changes to be made, contact me.
-
 
62
 
-
 
63
Of course, neither I nor my employer will give you any money or be
-
 
64
held responsible in any way, under any circumstances what so ever - no
-
 
65
matter what sort of damage GEL might inflict upon you. Not that I can
-
 
66
foresee GEL causing you any damage :-) 
-
 
67
 
-
 
68
If anything is unclear, please contact me. In fact, if you want to use
-
 
69
GEL for a bigger project, I'd appreciate an email to jab@imm.dtu.dk
-
 
70
 
-
 
71
In a project such as this, it is almost impossible to completely avoid
-
 
72
building upon fragments of other peoples source code. GEL includes an
-
 
73
obj loader based on work by Nate Robins. Some pieces of source code
-
 
74
from Graphics Gems have also been used. All of this amounts to only a
-
 
75
small fraction of the GEL source code and it should not be in
-
 
76
violation of any license. Should you disagree, contact me, and I will
-
 
77
rectify the situation.
-
 
78
 
-
 
79
----------------------------------------------------------------------
-
 
80
1. INTRODUCTION
-
 
81
----------------------------------------------------------------------
-
 
82
 
-
 
83
In the following, I discuss the structure of the source code and how to
-
 
84
add new directories to the framework. 
-
 
85
 
-
 
86
The idea is that this framework should be a) simple to use and b) let 
-
 
87
people easily compile the same source code under various unix platforms.
-
 
88
A seperate configuration is kept for each combination of OS, architecture, 
-
 
89
and compiler. It is possible to specify targets release or debug.
-
 
90
 
-
 
91
Source files are compiled in build directories, and separate build 
-
 
92
directories are kept for each unique combination of 
-
 
93
 
-
 
94
os architecture compiler target
-
 
95
 
-
 
96
such as
-
 
97
 
-
 
98
Linux_i686_g++3_debug
-
 
99
 
-
 
100
this makes it easier to work in a heterogenous environment or to 
-
 
101
experiment with seperate compilers or just to switch between debug mode 
-
 
102
and optimized.
-
 
103
 
-
 
104
To see how to use the framework, you may skip to section 5.
-
 
105
 
-
 
106
----------------------------------------------------------------------
-
 
107
2. DIRECTORY STRUCTURE
-
 
108
----------------------------------------------------------------------
-
 
109
 
-
 
110
The directories under the root of the source tree (where you find this 
-
 
111
README) are
-
 
112
 
-
 
113
src        - Source code for GEL libraries
-
 
114
apps       - Source code for applications
-
 
115
apps       - Source code for test programs
-
 
116
doc        - Documentation
-
 
117
bin        - Executables
-
 
118
lib        - Libraries
-
 
119
makefiles  - As the name suggests, makefiles
-
 
120
 
-
 
121
src contains a number of subdirectories each of which represents a 
-
 
122
link library. apps  also contains subdirectories, however each of these
-
 
123
is supposed to contain source code for an executable.
-
 
124
 
-
 
125
----------------------------------------------------------------------
-
 
126
3. FILE NAMES
-
 
127
----------------------------------------------------------------------
-
 
128
 
-
 
129
source files are *.c or *.cpp depending on whether it is C or C++
-
 
130
header files are named *.h
-
 
131
 
-
 
132
----------------------------------------------------------------------
-
 
133
4. MAKEFILES
-
 
134
----------------------------------------------------------------------
-
 
135
 
-
 
136
Some defintions:
-
 
137
----------------
-
 
138
 
-
 
139
The PLATFORM is a string concatenation of the os cpu and compiler, e.g.
-
 
140
 
-
 
141
Linux_i686_g++
-
 
142
 
-
 
143
The TARGET is either `debug' or `release'. By default it is debug. It is
-
 
144
recommended that you do _not_ hardwire your own default into the makefiles
-
 
145
as I did for many years. It seems better to define the variable when running
-
 
146
make, using "make TARGET=release" or by setting the target variable in the
-
 
147
environment.
-
 
148
 
-
 
149
 
-
 
150
Make'ing from the source root
-
 
151
-----------------------------
-
 
152
 
-
 
153
Just typing
-
 
154
> make 
-
 
155
 
-
 
156
from the root of the source tree will cause first every library and
-
 
157
then every application to be remade. However, there are several
-
 
158
targets.
-
 
159
 
-
 
160
make all			 - equivalent to "make lib shared test app"
-
 
161
 
-
 
162
make lib       - make all libraries
-
 
163
 
-
 
164
make shared    - For the current target platform combination, a shared library
-
 
165
								 is created by stringing together the compiled static libraries
-
 
166
 
-
 
167
make app       - make all applications
-
 
168
 
-
 
169
make clean     - clean all library directories and app directories.
-
 
170
                 this removes only files pertaining to the current
-
 
171
                 platform and target (release/debug). This also
-
 
172
                 removes generated libraries. 
-
 
173
 
-
 
174
make distclean - cleans and completely removes all build directories. 
-
 
175
 
-
 
176
make platform  - copies a template to OS_CPU_COMPILER.mk in the
-
 
177
                 makefiles directory. Use this only if you know what you
-
 
178
								 are doing.
-
 
179
 
-
 
180
make install   - Copies header files and libraries to the appropriate place
-
 
181
							   which is PREFIX=/usr/local by default. The libraries which
-
 
182
								 are copied are either the debug or release versions depending
-
 
183
								 on the active target. 
-
 
184
 
-
 
185
								 Install does not install applications since many are little
-
 
186
								 test programs that do not belong in your path.
-
 
187
 
-
 
188
 
-
 
189
Make'ing in subdirectories
-
 
190
--------------------------
-
 
191
 
-
 
192
Go to a subdirectory of src, say src/somedir. 
-
 
193
Here you have the following options:
-
 
194
 
-
 
195
make
1
GEL
196
make lib
-
 
197
make clean
-
 
198
 
-
 
199
The first two invocations are identical and will rebuild all sourcefiles and
-
 
200
put them in a library directory. The latter will remove all object and
-
 
201
dependency files (but only for the current platform
-
 
202
(e.g. Linux_i686_g++_debug) The default target is lib.
-
 
203
 
-
 
204
Go to a subdirectory of apps, say apps/somedir. 
2
GEometry and Linear algebra 
205
Here you have the following options:
-
 
206
 
-
 
207
make
-
 
208
 
-
 
209
or
3
or
-
 
4
Graphics Elements Library
210
 
5
 
211
make app
-
 
212
 
-
 
213
will recompile the source files in the current directory and build the 
-
 
214
programs. This is the default target. When compiled, the application is
-
 
215
moved to wherever/GEL/bin
-
 
216
 
-
 
217
make force
-
 
218
 
-
 
219
does the same but tries first to recompile all libraries that the 
-
 
220
applications in somedir depend on. This is the safe way to recompile,
-
 
221
but it takes a few seconds more, so if you are sure the libraries are
-
 
222
up to date, just go make.
-
 
223
 
-
 
224
make clean
-
 
225
 
-
 
226
works like above. 
-
 
227
 
-
 
228
Makefiles in subdirectories under apps should generally be edited.
-
 
229
When create by `make makefiles' the Makefile in apps/somedir looks
-
 
230
like this 
-
 
231
 
-
 
232
PROGRAMS 	= prog1 prog2
-
 
233
OWN_LIBS 	= Lib1 Lib2
-
 
234
LIBS			= ${GLLIBS} ${XLIBS} -lm -lz -lexpat
-
 
235
 
-
 
236
Add something like this
-
 
237
 
-
 
238
PROGRAMS 	= prog1 prog2
-
 
239
OWN_LIBS 	= Lib1 Lib2
-
 
240
LIBS			= ${GLLIBS} ${XLIBS} -lm -lz -lexpat
-
 
241
 
-
 
242
where prog1 and prog2 are programs you wish to create. These must 
-
 
243
correspond to source files with the same name and suffix .cpp. In
-
 
244
other words, 
-
 
245
 
-
 
246
prog1.cpp 
-
 
247
prog2.cpp
-
 
248
 
-
 
249
must exist (and contain a main function)
-
 
250
 
-
 
251
Lib1 and Lib2 are libraries that must also be in the directory structure,
-
 
252
i.e. under src there are subdirectories 
-
 
253
 
-
 
254
src/Lib1
-
 
255
src/Lib2
-
 
256
 
-
 
257
the files in these subdirectories will be compiled and put in library 
-
 
258
files named libLib1.a under lib. More precisely it will be put here:
-
 
259
 
-
 
260
lib/PLATFORM_TARGET/
-
 
261
 
-
 
262
PLATFORM and TARGET are defined above. Another library directory are for
-
 
263
precompiled libraries whose source code is not a part of this tree. Put
-
 
264
such libraries here:
-
 
265
 
-
 
266
lib/PLATFORM/
-
 
267
 
-
 
268
this directory is created by 
-
 
269
 
-
 
270
make platform from the source root.
-
 
271
 
-
 
272
----------------------------------------------------------------------
-
 
273
5. CONFIGURATION
-
 
274
----------------------------------------------------------------------
-
 
275
 
-
 
276
When you add a new project to this framework, you should go through
-
 
277
the following steps:
-
 
278
 
-
 
279
Add directories for libraries under src. E.g. add 
-
 
280
 
-
 
281
mkdir src/somelib
-
 
282
 
-
 
283
Then add directories for applications:
-
 
284
 
-
 
285
mkdir apps/someapp
-
 
286
 
-
 
287
Copy appropriate source files to these directories and then edit
-
 
288
 
-
 
289
makefiles/config.mk
-
 
290
 
-
 
291
to tell us which compiler to use (leave blank to use default) 
-
 
292
 
-
 
293
Finally, from the source root type 
-
 
294
 
-
 
295
make platform
-
 
296
 
-
 
297
Depending on your compiler you may now have to edit the makefile called
-
 
298
 
-
 
299
makefiles/PLATFORM.mk 
-
 
300
 
-
 
301
to set special compile flags. No go 
-
 
302
 
-
 
303
make makefiles
-
 
304
 
-
 
305
Finally you are all set. Go
-
 
306
 
-
 
307
make
-
 
308
 
-
 
309
 
-
 
310
----------------------------------------------------------------------
-
 
311
6. DEPENDENCIES IN GEL
-
 
312
----------------------------------------------------------------------
6
So, GEL is a small library with a good support for 2,3,4 D vectors, simple linear system solving (via Lapack), Mesh representation of surfaces, and the volume representation. There are also several other things some of which pertain to simple user interfaces. For instance, GEL contains a console library.
313
 
-
 
314
Each directory under src represents a library. There are some dependencies
-
 
315
between these libraries.
-
 
316
 
-
 
317
 
-
 
318
 
-
 
319
lib						depends on
-
 
320
-----------------------------------
-
 
321
CGLA 					nothing 
-
 
322
 
7
 
-
 
8
DOCUMENTATION
-
 
9
---
323
Util 					CGLA
10
Some installation instructions below. But for more documentation please see the doc directory. There is a doxygen script for creating a reference manual and a latex file intro.tex which explains the basics. Please doxygen or pdflatex your documentation. A license is also found in the intro document.
324
 
11
 
325
LinAlg 				CGLA
12
Building on XCode/OSX
-
 
13
---
326
 
14
 
327
Geometry 			LinAlg, CGLA
15
An XCode project has been created and is found in the root directory. The XCode project produces a framework for the GEL library and compiles all the applications.
328
 
16
 
-
 
17
CMake
-
 
18
---
329
HMesh					CGLA, Util, Geometry, LinAlg (indirectly)
19
On other platforms, you may need to install GLUT and Lapack. Then CMake can be used
-
 
20
to produce build files.
330
 
21
 
331
GLGraphics		Everything (since it contains general rendering
-
 
332
							facilities)
22
Glut is available here:
333
 
23
 
-
 
24
http://user.xmission.com/~nate/glut.html
334
 
25
 
335
----------------------------------------------------------------------
-
 
336
7. TODO
26
Direct link:
337
----------------------------------------------------------------------
-
 
338
 
27
 
339
- No real testing of blended C and C++.
28
http://user.xmission.com/~nate/glut/glut-3.7.6-bin.zip
340
- No dependency computation for .c 
-
 
341
 
29
 
-
 
30
Lapack you can find here:
342
 
31
 
-
 
32
http://www.netlib.org/clapack/
343
 
33
 
-
 
34
Direct link:
344
 
35
 
-
 
36
http://www.netlib.org/clapack/CLAw32.zip
345
 
37
 
-
 
38
running CMake configuration you will need to set
346
 
39
 
-
 
40
INCLUDE_GLUT
-
 
41
LIB_LAPACK
-
 
42
LIB_GLUT
347
 
43