-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallation.html
More file actions
608 lines (532 loc) · 23.2 KB
/
installation.html
File metadata and controls
608 lines (532 loc) · 23.2 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CM3 Installation Notes</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<META HTTP-EQUIV="Resource-type" CONTENT="document">
<META HTTP-EQUIV="Reply-to" CONTENT="[email protected]">
<LINK HREF="normal.css" REL="stylesheet" TYPE="text/css">
<META NAME="robots" content="noindex">
</head>
<body bgcolor="#ffffff">
<h1>CM3 5.4 installation notes</h1>
<hr>
<h2>Terminology</h2>
<p>
This section explains some of the terms that are used throughout
this document. Some of them may be familiar, but in the context of
CM3 they may have slightly different meanings.
</p>
<h3>Package</h3>
<p>
A <i>package</i> in CM3-speak is a software component of the
CM3 system. Packages are divided into categories.
The top-level directory of the CM3 source tree contains
a lot of directories representing these categories.
</p>
<p>
Packages have explicit import and export declarations, i.e.
they implement the principle of information hiding on a
higher level than modules. For details on packages see
http://...
</p>
<p>Packages can be local to a given user's workspace, or can be installed system-wide,
so other users on the system can use them, too. Installing a package
system-wide is also called <i>shipping</i> the package.</p>
<p>
For example, the <i>m3-sys</i> category contains, among others,
the packages <i>cm3</i> (the compiler user interface), <i>m3front</i>
(the compiler frontend), <i>cminstall</i> (the installation program),
<i>m3cc</i> (the compiler backend) and <i>m3quake</i> (the Quake language
interpreter).
</p>
<h3>Quake?</h3>
<p>
Yes, <i>Quake</i>. Although this term has been overloaded for a while
by a very popular video game, CM3 stuck to the name <i>quake</i>
for its built-in scripting language for build management
(replacing the UNIX make program).
</p>
<p>
CM3 reads and understands so-called <i>m3makefiles</i>. These files
have a similar purpose as Makefiles processed by UNIX make.
This is part of the reason why installing CM3 is quite different
from installing other software on a UNIX system - other software
does not have make-like functionality built-in.
</p>
<h3>Target</h3>
<p>
A <i>target</i> is short for target platform and defines a combination
of an operating system and a
certain processor architecture. CM3 needs to know the details
of both to work correctly. We do not consider cross-compilation
here, and assume that you want to install CM3 on the target
you want to run it on to produce code for the same target.
An example target would be the FreeBSD operating system
running on x86 processors.
</p>
<hr>
<h2>Specific Installation Example</h2>
<p>
If you would like to
<ul>
<li>install on <b>Ubuntu</b>, <b>Debian</b> or a related distribution, or</li>
<li>install a <b>recent snapshot</b> of CM3,</li>
</ul>
you will want to read
<a href="./install-cm3-on-ubuntu-7-10.html">these more specific installation instructions</a>.
</p>
<p>
Alternatively, continue reading the general instructions below.
</p>
<hr>
<h2>Installation Prerequisites</h2>
<h3>Check the list of known problems</h3>
<p>
Read the <a href="known-problems.html">known problems page</a>,
especially the parts regarding CM3 5.4. You may run into one
or more of the problems mentioned there while installing CM3,
so it is a good idea to know about them in advance.
</p>
<h3>Supported Targets</h3>
<p>
For this release, the following targets are supported:
</p>
<table border=1>
<tr>
<td><b>Name</b></td> <td><b>Description</b></td>
</tr>
<tr>
<td>FreeBSD4</td> <td>FreeBSD 4.x and later on x86</td>
</tr>
<tr>
<td>LINUXLIBC6</td> <td>Linux with glibc-6 on x86</td>
</tr>
<tr>
<td>SOLgnu</td> <td>Solaris 8 and later on sparc with GNU compiler</td>
</tr>
<tr>
<td>PPC_DARWIN</td> <td>Apple's Darwin (MacOS X) system on powerpc</td>
</tr>
<tr>
<td>NetBSD2_i386</td> <td>NetBSD 2 and later on x86</td>
</tr>
<!-- ENOSUPP: Windows is not supported (yet?)
<tr>
<td>NT386</td> <td>Microsoft Windows NT/2000/XP</td>
</tr>
-->
</table>
<h3>Minimal Binary Installation Archives</h3>
<p>
To install CM3, the first thing you need is a so-called
<i>minimal binary installation archive</i> for your platform.
</p>
<p>
The archive contains a very bare-bones cm3 installation.
It contains a complete compiler and runtime
libraries, but it should only be used for bootstrapping
a full cm3 installation from source. A full installation
contains a lot of additional tools and libraries,
some of which are vital for common use.
<p>
A minimal binary installation archive is named as follows:
</p>
<blockquote><tt>cm3-min-OSTYPE-TARGET-CM3VERSION.tgz</tt>.</blockquote>
<p>
<i>OSTYPE</i> is POSIX for most platforms supported by CM3.
</p>
<p>
<i>TARGET</i> is the target CM3 shall produce code for.
</p>
<p>
You can download a minimal binary installation archive from
the <a href="download.html">download page</a>.
</p>
<h3>CM3 source packages</h3>
<p>
As mentioned above, you also need the CM3 source code
to install CM3. Several source packages are available:
</p>
<blockquote><tt>cm3-src-sys-CM3VERSION.tgz</tt></blockquote>
<p>
The <i>src-sys</i> archive contains source code for the compiler
(except the compiler backend), the linker and vital core libraries.
</p>
<blockquote><tt>cm3-src-gnu-CM3VERSION.tgz</tt></blockquote>
<p>
The <i>src-gnu</i> archive contains source code for the compiler
backend, which is based on the
<a href="http://gcc.gnu.org">GNU C compiler</a>, and the debugger
m3gdb, which is based on the
<a href="http://www.gnu.org/software/gdb/">GNU debugger</a>.
</p>
<blockquote><tt>cm3-src-std-CM3VERSION.tgz</tt></blockquote>
<p>
The <i>src-std</i> archive contains source code for a pre-defined set
of standard packages that will compile and work.
</p>
<blockquote><tt>cm3-src-all-CM3VERSION.tgz</tt></blockquote>
<p>
The <i>src-all</i> archive contains the full source code for the cm3
distribution. Not all of this is needed to get a working
installation. It contains experimental packages that are
not compiled and installed by default, and may even be
broken. It also includes everything included in other packages below.
This archive is most interesting for developers who want to extend
and enhance the CM3 system, or fix broken packages.
</p>
<p>
To get a complete cm3 installation, you need either the src-all
archive or <b>all three of</b> the src-std, src-sys and src-gnu archives.
If you really do not need or want the standard packages (unlikely),
you could skip the src-std package.</p>
<p>You can download the source archives from the
<a href="download.html">download page</a>.
You can verify the integrity of the downloaded
archives by using the checksums and md5 hashes provided
<a href="checksums.php3">here</a>.
</p>
<hr>
<h2>Performing the installation</h2>
<h3>Unpacking the archive</h3>
<p>
<b>WARNING:</b> The archive unpacks into the <b>current</b> directory!
</p>
<p>
Once you have got the binary installation package, create a
new temporary directory (for example, /tmp/cm3), change into it,
and unpack the minimal binary installation archive.
</p>
<p>
Use a command like this on UNIX-like systems:
</p>
<pre>
tar -zxf cm3-min-OSTYPE-TARGET-CM3VERSION.tgz
</pre>
<!-- ENOSUPP
<p>On Windows, you can unpack the installation archive with most common
archiver programs such as winzip or 7zip.</p>
-->
<p>
You will get the installation program
(<tt>cminstall(.exe)</tt>), a copyright notice, a system archive
(<tt>system.tgz</tt>) with the
precompiled standard libraries <tt>m3core</tt> and <tt>libm3</tt>.
You can place additional archives,
e.g. the doc distribution (<tt>cm3-doc-CM3VERSION.tgz</tt>) in
the same directory.
</p>
<h3>Coping with cminstall</h3>
<p>
The cminstall installation program helps you setting up your initial CM3 configuration
and extracts <i>system.tgz</i>. Alas, it is not perfect, and can be very
confusing to use, especially for first-time users. There are plans to
improve the installer in a future release. I will try to guide you through it
as best as I can.
</p>
<p>
Change into the directory where you unpacked the archive, and
start the installer by running
<pre>
./cminstall
</pre>
<!-- ENOSUPP
on UNIX-like systems and
<pre>
cminstall.exe
</pre>
on Windows.
Note that the installer is text-based. You will need to open
a command-line window in order to use it.
-->
</p>
<p>
The installer will first ask you where you want to install CM3.
The default installation prefix is <i>/usr/local/cm3</i>.
</p>
<p>Next, it will ask about the default editor. This question is present
for historical reasons. It is related to
the graphical CM3 IDE called <i>Reactor</i>, which is not
yet included in CM3. It used to be distributed with the commercial CM3 releases
made by Critical Mass Inc., and was removed from the Open Source distribution
because of licensing issues. There are efforts to add the IDE again in a future release.
For now, you can simply ignore this question and pick the default by hitting Enter.</p>
<p>Next, it will ask about paths to various development tools and libaries.
This is a very important part, since some packages in CM3 will not compile if
these libraries cannot be found. Given the amount of targets cm3
runs on and the differences between them, we cannot give concrete
examples for every possible situation. You will have to find out
how to install the required tools and libraries on your system yourself.
(Hint to Linux users: You may need to install library packages having a -dev or
-devel suffix.)</p>
<p>I will elaborate a bit on what cminstall does when it
asks a question, since this can be a bit confusing at first. The example
output is based on the FreeBSD version, and may look slightly different
on your system.</p>
<p>Let's consider this question cminstall is asking:
<pre>
Where are the flex/bison libraries?
looking for library file(s): libfl.a
checking for library files in directory /usr/lib... found
checking for library files in directory /usr/local/lib... not found
checking for library files in directory /usr/local/gnu/lib... not found
checking for directory /usr/lib... found
1: /usr/lib
Where are the flex/bison libraries? [/usr/lib](1 of 1)</pre>
</p>
<p>
As you can see, cminstall prints the name of the library file it
is looking for, <i>libfl.a</i>.
It then searches a couple of directories for this file, and
reports whether it found it. The
<i>found</i> and <i>not found</i> lines are the only indicators
whether cminstall was successful.
</p>
<p>
In this case, the file was only found in one directory.
Hitting enter would use the default answer <i>/usr/lib</i>, which is displayed in
square brackets, and continue with the installation.
This is perfectly fine here, since the file has indeed been found in /usr/lib,
as indicated by the line
</p>
<pre>
checking for library files in directory /usr/lib... found
</pre>
<p>However, if cminstall cannot find the file, it behaves
like this:</p>
<pre>
Where are the flex/bison libraries?
looking for library file(s): libfl.a
checking for library files in directory /usr/lib... not found
checking for library files in directory /usr/local/lib... not found
checking for library files in directory /usr/local/gnu/lib... not found
checking for directory /usr/lib... found
1: /usr/lib
Where are the flex/bison libraries? [/usr/lib](1 of 1)
</pre>
<p>As you can see, it still suggests <i>/usr/lib</i> as the default,
even though the library was not found. Simply hitting enter now
results in the following question:</p>
<pre>
The libraries libfl.a are not present in the chosen directory.
Would you like to change the library names? [yes]
</pre>
<p>Even though the default answer is <i>yes</i>, one would usually
want to answer <i>no</i> here, and search the software packages available
for the operating system for a package containing the needed library file.
After installing the package, you can tell cminstall to try to find the
library again by answering <i>no</i> to the next question:</p>
<pre>
Would you like to continue nonetheless? [yes]
</pre>
<p>If you answer <i>no</i> here, cminstall will try to find the library
again. If you answer <i>yes</i> the default directory is entered into the
configuration file and installation continues. If the library is not present in
the chosen directory however, compiling
the full cm3 installation will probably fail, so answering <i>yes</i>
is usually not a really good idea (even though it is the default answer).</p>
<p>Next, let us consider the situation where you would have to rename
a library file so cminstall can find it. This mostly applies to targets
where CM3 uses shared libraries (Linux, for example). The following
example uses output generated on a Fedora Core 5 Linux system.</p>
<pre>
Where are the OpenGL libraries?
looking for library file(s): libGLU.so
looking for library file(s): libGL.so libGLU.so
checking for library files in directory /usr/lib... not found
checking for library files in directory /usr/local/lib... not found
checking for library files in directory /usr/local/gnu/lib... not found
checking for directory /usr/lib... found
</pre>
<p>The output above suggests that cminstall could not find either libGL.so or
libGLU.so, or both. Unfortunately, cminstall is not very smart when looking for
libraries. It does not (yet) do wildcard matching on the files it is looking for.
Manually searching our system, we find the following libraries in the /usr/lib
directory:</p>
<pre>
[user@fedora ~]$ ls -l /usr/lib/libGL*
lrwxrwxrwx 1 root root 10 Jul 24 15:28 /usr/lib/libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root 12 Jul 24 15:22 /usr/lib/libGL.so.1 -> libGL.so.1.2
-rwxr-xr-x 1 root root 389656 Jun 26 14:51 /usr/lib/libGL.so.1.2
lrwxrwxrwx 1 root root 20 Jul 24 15:22 /usr/lib/libGLU.so.1 -> libGLU.so.1.3.060402
-rwxr-xr-x 1 root root 498828 Jun 26 14:51 /usr/lib/libGLU.so.1.3.060402
</pre>
<p>So we do indeed have a libGL.so file. What is missing is a libGLU.so file.
We have a libGLU.so.1 file, however. Let's use that instead, by telling cminstall
that we want to rename the libraries.</p>
<pre>
checking for directory /usr/lib... found
1: /usr/lib
Where are the OpenGL libraries? [/usr/lib](1 of 1) /usr/lib
The libraries libGL.so libGLU.so are not present in the chosen directory.
Would you like to change the library names? [yes] yes
Warning: Changing the required library names is currently only partially
supported by the installer. You will have to edit /usr/local/cm3/bin/cm3.cfg
manually after the installation and adapt the -l suffixes in the SYSTEM_LIBS
array.
Sorry for the inconvenience.
</pre>
<p>The warning about having to adapt -l suffixes can be ignored in our case,
since we are not renaming the library itself. We are only adding a version number.</p>
<pre>
enter library file (or ENTER to continue): libGL.so
enter library file (or ENTER to continue): libGLU.so.1
enter library file (or ENTER to continue):
Would you like to add library search paths? [yes] no
</pre>
<p>We do not need to add a search path, since cminstall is already searching /usr/lib,
where our GL libraries reside.</p>
<p>Cminstall now suceeds:</p>
<pre>
looking for library file(s): libGLU.so.1 libGL.so
checking in directory /usr/lib... found
checking in directory /usr/local/lib... not found
checking in directory /usr/local/gnu/lib... not found
checking in directory /usr/lib... found
</pre>
<p>Cminstall found the library in /usr/lib, so the installation can continue.</p>
<h3>After cminstall is done</h3>
<p>When cminstall is done, update your environment so that CM3 binaries and libraries can be
found by the system.</p>
<p>
On UNIX-like systems, extend your PATH and LD_LIBRARY_PATH settings so they include
CM3 binaries and libraries. Here is an example for bourne shells:
</p>
<pre>
export PATH="${PATH}:/usr/local/cm3/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cm3/lib"
</pre>
<!-- ENOSUPP
<p>On Windows, you need to append the <i>bin</i> directory that resides
in the cm3 installation prefix to the PATH environment
variable in the system preferences.</p>
-->
<h3>Bootstrapping the full CM3 installation</h3>
<p>
First, create a new directory for the source tree and unpack all
needed source distribution archives there. Here are example
commands for UNIX-like systems:
</p>
<p>
<b>WARNING:</b> The archives unpack into the <b>current</b> directory!
</p>
<pre>
mkdir cm3
cd cm3
tar -zxf /path/to/cm3-src-sys-CM3VERSION.tgz
tar -zxf /path/to/cm3-src-gnu-CM3VERSION.tgz
tar -zxf /path/to/cm3-src-std-CM3VERSION.tgz
</pre>
<p>
Shell scripts in the
<tt>scripts/</tt> subdirectory of the source tree can be used to
build and install (or "ship") single packages or groups of packages.
See the file <tt>scripts/README</tt> for details.
We use a few of these scripts to bootstrap a full CM3 installation.
</p>
<pre>
cd scripts
./do-cm3-core.sh buildship
./install-cm3-compiler.sh upgrade
./do-cm3-std.sh buildship
</pre>
<!-- ENOSUPP
<p>
The scripts directory also contains corresponding .cmd scripts that can
be used on the Windows platform. Running the .sh scripts from within
Cygwin also works.
</p>
-->
<p>These steps take a while, especially the last one. When this is done,
the installation is finished.</p>
<hr>
<h2>If the installation fails</h2>
<p>
If the installation fails for any reason, send mail to
<a href="mailto:m3-support{at}elego.de">m3-support{at}elego.de</a>.
As always, please include as much useful information
as possible in your email, especially the log file written by
cminstall, which resides in the installation prefix you chose,
and of course hardware/operating system information.
</p>
<hr>
<h2>Upgrading CM3</h2>
<p>
If you want to upgrade to a new CM3 version, use the
<tt>upgrade.sh</tt> script, and have a look at the <a
href="upgrading.html">chapter about upgrading</a>.
</p>
<p>If you are using a pre-5.3 version of cm3, a fresh install is
recommended instead of upgrading. But you can also try using the upgrade-5.3.sh script
instead of the upgrade.sh script.
</p>
<hr>
<h1>Troubleshooting</h1>
<p>
Please have a look at the
<a href="known-problems.html">Known Problems Page</a>. If you
encounter any problem or difficulty that isn't mentioned there,
don't hesitate to contact <a
href="mailto:m3-support{at}elego.de">m3-support{at}elego.de</a>, or --
even better -- <a href="cm3-problem-report.html">file a problem
report</a> (preferably with a working fix :-)
</p>
<!-- ENOSUPP
<hr>
<h1>Windows-specific Notes</h1>
<p>
CM3 (like any other currently available Modula-3 distribution)
does not provide its own linker, as this is a standard system
utility. Unfortunaltey, on WIN32 systems no linker is installed
by default if you don't buy the Microsoft development tools.
The NT386 target (which is the only one currently supported for the
WIN32 platform) needs the Microsoft linker (and C compiler if
you compile C sources) to be operable. It seems that the Borland
linker (which is freely evailable) cannot be used without
changes as it does not support the definition of entry
points. This needs to be further investigated, though. Anybody
who knows about other usable linkers or who gets M3 programs
linked without the Microsoft tools, please let us know.
The Microsoft Visual C++ Express Edition which can be downloaded
free of charge does <b>not</b> seem to work with CM3, unfortunately.
</p>
<p>
Anybody who would like to volunteer writing a linker for WIN32
in Modula-3 would also be very welcome :-)
</p>
<p>
If you want to use the UNIX shell scripts provided in the scripts
directory, you will also need a recent installation of the
cygwin32 emulation environment, which is a good idea anyway,
since it provides you with a more-or-less standard shell (bash)
and an almost-POSIX programming environment. Cygwin32 has
improved very much in recent years. It can be downloaded from <a
href="http://www.cygwin.com/">http://www.cygwin.com/</a> and is
easy to install. Future releases of CM3 5.1 may also feature a
cygwin based build target as known from the PM3 distribution
(NT386GNU).
</p>
<p>
I have been told that recent versions of WinZip should be fine
to unpack the gzipped tar archives of the distribution. However,
there has been at least one report of failure and I haven't
tried it myself, so I would recommend using the cygwin tools
anyway. The cygwin environment mentionend above contains gnu tar
and gzip that can be used to unpack the archive. As a last
resort, here are some links to the (old versions of)
<a href="win32-tools/gzip.exe"
type="application/octet-stream">gzip.exe</a>,
<a href="win32-tools/tar.exe"
type="application/octet-stream">tar.exe</a>, and
<a href="win32-tools/cygwin.dll"
type="application/octet-stream">cygwin.dll</a> that are also
used by the binary installer itself.
</p>
-->
<hr>
<address><a href="mailto:m3-support{at}elego.de">m3-support{at}elego.de</a></address>
<!-- Created: Fri Feb 16 15:27:10 MET 2001 -->
</body>
</html>