Update the changelog
[opencv] / apps / Hawk / CVEiCL / EiC / README
1  ----------------------------------\r
2         EiC BUILD INSTRUCTIONS \r
3         \r
4                 by\r
5 \r
6              Ed Breen\r
7 \r
8  ---------TABLE-of-CONTENTS--------- \r
9 \r
10 1. INTRODUCTION:\r
11 2. INSTALLING EIC FROM THE SOURCE DISTRIBUTION:\r
12         Step 1\r
13         Step 2 \r
14         Step 3\r
15         Step 4\r
16         Step 5 \r
17         Step 6\r
18 3  BUILDING A TOY VERSION OF EiC\r
19 4. EXPLANATION OF NON-PORTABLE MACROS USED:\r
20         $(addprefix PREFIX,NAMES...)    (from GNU info Make)\r
21 5. TROUBLE SHOOTING:\r
22 6. PORTING EiC TO OTHER PLATFORMS\r
23 \r
24  --END-of-TABLE-of-CONTENTS---------\r
25 \r
26  ------------------------------------\r
27 - INTRODUCTION:\r
28 \r
29         EiC's distribution plus binaries require approximately 4\r
30         Mbytes of disk space. To build EiC, you will need GNU make and\r
31         gcc 2.6.3 or later. However, if you don't have GNU make then\r
32         the section on 'explanation of non-portable macros' may help\r
33         you over come this limitation.\r
34 \r
35 \r
36  -------------------------------------------\r
37 - INSTALLING EiC FORM THE SOURCE DISTRIBUTION:\r
38 \r
39         There are just six easy steps to installing EiC.  Please read\r
40         all six steps before starting at step 1.\r
41 \r
42 -- Step 1\r
43 \r
44         Untar the distribution. It will automatically unpack itself\r
45         into a subdirectory off the current directory. This\r
46         subdirectory will be named EiC and will be referred to as the\r
47         top EiC directory or the HOMEofEiC.\r
48         \r
49         If you use GNU tar, then:\r
50                 % tar -xvzf EiC.tar.gz\r
51         else\r
52                 % gunzip EiC.tar.gz \r
53                 % tar -xvf EiC.tar.gz\r
54 \r
55 -- Step 2 \r
56 \r
57         If you haven't already done so, then:\r
58 \r
59                 % cd EiC\r
60 -- Step 3\r
61 \r
62         This step looks worse than it really is. You shouldn't have to\r
63         do anything, other than setting the directory where EiC will\r
64         be installed.\r
65         \r
66         In the project parameter file:\r
67 \r
68                 /EiC/project.params\r
69 \r
70         you will need to set EiC's installation directory; this is\r
71         where the EiC binary will be placed, via:\r
72         \r
73                 INSTALL_DIR = $(HOME)/bin\r
74 \r
75         By default, it points to 'bin', which is assumed to be just\r
76         off your home directory and within your search path. If you\r
77         don't have a bin directory, make it or just change the\r
78         assignment to point to any other directory that is in your\r
79         search PATH, and that you have write access to.\r
80 \r
81         The rest of this step can now be skipped over and only if things\r
82         fail, after step 4, will you need to refer to the rest of step\r
83         3.\r
84  \r
85         Now, you will need to:\r
86 \r
87                 a) set the EiC project parameters,  and\r
88                 b) check the appropriate platform parameters are\r
89                    set according to your site.\r
90 \r
91         Hopefully, the default settings will do.  However, if you are\r
92         uncertain about what to do, with respect to what the various\r
93         parameters mean or platform types, then consult the DATA\r
94         DICTIONARY section in the file:\r
95         \r
96                 EiC/config/GuideLines.make.\r
97 \r
98         Now check the parameter settings in the file:\r
99 \r
100                 EiC/config/$(PLATFORM)/make.params\r
101 \r
102         where $(PLATFORM) is the platform type that you are going\r
103         to compile EiC for. Check the directory EiC/config\r
104         for the platforms supported. They are indicated by\r
105         directories with names starting with '_'; for example,\r
106         _LINUX, _SOLARIS, _SUNOS, etc. \r
107 \r
108         If you find any parameter setting in the platform make.params\r
109         file that are not to your liking, then you have can override\r
110         these settings by placing a corresponding  parameter in\r
111         the file: \r
112 \r
113                 EiC/override.params\r
114 \r
115         The main purpose of the override.params file is to\r
116         allow for any peculiarities that are unique\r
117         to any particular site. More information on this\r
118         file can be found in the file itself.\r
119         \r
120 \r
121 -- Step 4\r
122 \r
123         From EiC's top directory type the following command:\r
124                 \r
125                 % config/makeconfig\r
126 \r
127         makeconfig will use its default procedures to determine your\r
128         operating system, and other configuration settings. It will\r
129         attempt to produce the file:\r
130                 \r
131                  EiC/make.proj\r
132 \r
133         that will contain the correct configuration setup for the EiC\r
134         project Makefiles within your environment. To get more\r
135         infomation about makeconfig type:\r
136                 \r
137                 % config/makeconfig -h\r
138 \r
139 -- Step 5 \r
140 \r
141         If makeconfig was successful, then from the EiC top directory,\r
142         type:\r
143  \r
144                 % make install\r
145                 % make clean\r
146                 % rehash\r
147                 % cd test\r
148                 % test.sh       // run EiC's test procedures\r
149 \r
150 \r
151         You will have to also set the environmental variable\r
152         HOMEofEiC to point to directory where EiC is\r
153         installed. See README.BIN for further information on\r
154         HOMEofEiC.\r
155 \r
156         Hopefully everythings goes to plan -- if not, see the section\r
157         on trouble shooting below.\r
158 \r
159 \r
160 -- Step 6\r
161          To make the documentation then\r
162                 \r
163                 % cd EiC/doc\r
164                 % make install\r
165 \r
166 \r
167 - BUILDING A TOY VERSION OF EiC\r
168 \r
169         To build a version of the EiC interpreter\r
170         that does not include EiC's runtime library\r
171         then change to EiC's src directory\r
172 \r
173                 % cd EiC/src\r
174                 % make -f makefile.seic \r
175                 % rm *.o\r
176 \r
177         This will produce the binary `seic'. It\r
178         is the starting point for experimenting\r
179         with EiC.\r
180         \r
181 - EXPLANATION OF NON-PORTABLE MACROS USED:\r
182 \r
183 -- $(addprefix PREFIX,NAMES...)    (from GNU info Make)\r
184                 \r
185         The argument NAMES is regarded as a series of names, separated\r
186         by whitespace; PREFIX is used as a unit.  The value of PREFIX\r
187         is prepended to the front of each individual name and the\r
188         resulting larger names are concatenated with single spaces\r
189         between them.  For example,\r
190 \r
191                 $(addprefix src/,foo bar)\r
192 \r
193         produces the result `src/foo src/bar'.\r
194 \r
195 - TROUBLE SHOOTING:\r
196 \r
197         If the compiler complains about duplicate definitions\r
198         of standard C funtions, then make sure you are using\r
199         gcc 2.6.3 or later, via:\r
200 \r
201                 % gcc -v\r
202         \r
203         If the installation procedure completely fails, then\r
204         check that make is being initiated correctly in each\r
205         subdirectly. You may need to set the SHELL variable in the\r
206         top level make file (../EiC/Makefile):\r
207 \r
208                 SHELL = /bin/ksh\r
209 \r
210 \r
211         If you don't have a ksh shell, then you may have to \r
212         do most things by hand:\r
213 \r
214                 % cd EiC\r
215                 % config/makeconfig\r
216                 % make install    // let it fail\r
217                 % cd module/stdClib/src\r
218                 % make headers\r
219                 % cd ../../../src \r
220                 % make headers\r
221                 % cd ../module/stdClib/src\r
222                 % make install\r
223                 % cd ../../../src\r
224                 % make install\r
225                 % cd ../main\r
226                 % make install\r
227         \r
228         Check that you aren't installing EiC for a platform it\r
229         doesn't know about (see porting EiC to other platforms below).\r
230         \r
231         If everything compiles, without errors, and your system reports\r
232         after typing:\r
233 \r
234                 % eic\r
235                 eic: Command not found\r
236         \r
237         Then check your search path and the directory where EiC\r
238         was installed. Or maybe just enter\r
239         \r
240                 % rehash\r
241 \r
242 \r
243         Read all of step 3.\r
244 \r
245 \r
246 -------------------------------------------------\r
247 - PORTING EiC TO OTHER PLATFORMS\r
248 \r
249 This part of the documentation explains how to port EiC to a new\r
250 platform. It is also assumed that the following steps will be\r
251 performed on the new platform.  The following outlines the steps I\r
252 took to port EiC to a Dec Alpha.\r
253 \r
254 -- Porting the EiC interpreter\r
255 \r
256         First get the platform name \r
257         via `uname'.\r
258 \r
259         At the system prompt:\r
260 \r
261         % uname\r
262         OSF1\r
263 \r
264         Therefore, the DEC alpha platform name is:\r
265         \r
266                 OSF1\r
267 \r
268         Now change to the directory EiC/config and\r
269         create the appropriate platform directory.\r
270 \r
271                 % cd EiC/config\r
272                 % mkdir _OSF1 \r
273 \r
274         Note the leading underscore. Now pick one of the existing\r
275         platforms that you feel is compatible with the new\r
276         platform and copy over its `make.params' file.\r
277         For example:\r
278 \r
279                 % cp _LINUX/make.params _OSF1\r
280         \r
281         Now edit the copy of make.params, to reflect to the new OS, in\r
282         particular change the PLATFORM designation.\r
283 \r
284         Next, check for data alignment, pointer size and\r
285         byte ordering, by compiling and running \r
286         `alignment' in EiC/config:\r
287 \r
288                 % gcc alignment.c\r
289                 % a.out\r
290                 #define EIC_LITTLE_ENDIAN 1\r
291                 {1, 1}, /* char */\r
292                 {2, 2}, /* short */\r
293                 {4, 4}, /* int */\r
294                 {8, 8}, /* long */\r
295                 {4, 4}, /* float */\r
296                 {8, 8}, /* double */\r
297                 {8, 8}, /* pointer */\r
298                 {0, 1}, /* struct*/\r
299 \r
300                 % rm a.out\r
301 \r
302         Now you need to inform EiC about this by\r
303         adding the following structure to the \r
304         EiC source file `EiC/src/metric.h': \r
305 \r
306         /* Dec Alpha */\r
307         #ifdef _OSF1\r
308         #define EIC_LITTLE_ENDIAN  1\r
309         short metric[8][2] = { /* size, alignment pairs */\r
310                 {1, 1}, /* char */\r
311                 {2, 2}, /* short */\r
312                 {4, 4}, /* int */\r
313                 {8, 8}, /* long */\r
314                 {4, 4}, /* float */\r
315                 {8, 8}, /* double */\r
316                 {8, 8}, /* pointer */\r
317                 {0, 1}, /* struct*/\r
318         };\r
319         #endif\r
320         \r
321         Now inform the makefile system of the new platform.\r
322         In the directory EiC type:\r
323 \r
324         <EiC> % config/makeconfig\r
325         TOP_DIR = /home/edb/compilers/EiC\r
326         CONFIG_DIR = /home/edb/compilers/EiC/config\r
327         platform = _OSF1\r
328 \r
329         This completes the porting of the EiC\r
330         interpeter and the Makefile system to the new\r
331         platform. Now the fun begins -- we have to\r
332         port EiC's runtime library.\r
333 \r
334 -- Porting the runtime library.\r
335 \r
336         Change to the directory EiC/module/stdClib/src and\r
337         add  the appropriate patform directory:\r
338 \r
339         <EiC/.../src> mkdir _OSF1\r
340 \r
341         Copy the contents of an already established\r
342         platform to this directory:\r
343 \r
344         <EiC/.../src> cp -r _LINUX/* _OSF1\r
345 \r
346         Now each header file in this directory must be\r
347         made compatible with the platform header files in\r
348         `/usr/include'. Also the file "fcntl.h" needs to be\r
349         addressed. However, you don't have to worry about\r
350 \r
351                 stdio.h\r
352                 stdlib.h\r
353                 errno.h\r
354                 stdtypes.h\r
355                 limits.h\r
356                 float.h\r
357                 signal.h\r
358                 termdefs.h\r
359 \r
360         As these files get automaticly constructed by EiC's build\r
361         process during installation, by the EiC/config/genstdio.c\r
362         program. As this document is usually as not as up todate as\r
363         the gentstdio.c file you should also check it for any other .h\r
364         files it may now be generating. To do this, just look at the\r
365         contents of the main() function.\r
366                 \r
367          To help with this process of generating header files, I used\r
368          gcc and grep; for example, when inspecting termios.h:\r
369         \r
370         </usr/include> gcc -D_POSIX_SOURCE -E termios.h | less\r
371 \r
372 \r
373 \r
374 \r
375 \r
376 \r
377 \r
378 \r
379 \r
380 \r
381 \r
382 \r