-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-cm3-on-ubuntu-7-10.html
More file actions
280 lines (177 loc) · 12.3 KB
/
install-cm3-on-ubuntu-7-10.html
File metadata and controls
280 lines (177 loc) · 12.3 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
<!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="m3-support@elego.de">
<LINK HREF="normal.css" REL="stylesheet" TYPE="text/css">
<META NAME="robots" content="noindex">
</head>
<body bgcolor="#ffffff">
<h1>CM3 5.5.1 Installation on Ubuntu 7.10 and Similar GNU/Linux Distributions</h1>
<p>(c) 2008-2009 by Elego Software Solutions GmbH</p>
<p>This document is published under the same license as cm3 (Critical Mass Modula3), which basically means that it is free to change and/or distribute under certain conditions, and that there is NO WARRANTY OR RELIABILITY of any kind. Refer to CM3's license information for further details.</p>
<p>Last full review: 2008-February-16</p>
<p>Last minor update: 2009-April-11</p>
<p>Author: Neels Janosch Hofmeyr (neels@elego.de)</p>
<p>This document is based on these installation notes:</p>
<pre> <a href="http://www.opencm3.net/installation.html">http://www.opencm3.net/installation.html</a></pre>
<p>However, this document gives more specific information that applies to
Ubuntu 7.10 and possibly other Ubuntus and GNU/Linux distributions.</p>
<p>(It has been reported to work for Ubuntu 8.04)</p>
<p>Here we go...</p>
<p>=========================================================================</p>
<p>Prerequisites:</p>
<p>To follow these instructions as they are, you need write access to /usr/local. You may choose to do the installation as root entirely, but you would have to make sure root's environment variables are set correctly. It is easier (and safer) to give a standard user access to /usr/local like this, where `fred' stands for your username:</p>
<pre> sudo -s
addgroup local
usermod -a -G local fred
chgrp -R local /usr/local
chmod -R g+rw /usr/local
exit # exits root shell to become fred</pre>
<p>In order for the group changes to take effect, you might have to relogin
your user (end X session and login again).</p>
<p>Now, you are user fred and can run the commands given here as they are.</p>
<br>
<br>
<p>Before you start, be sure to have these packages installed:</p>
<pre> gcc (the GNU compiler collection)</pre>
<pre> binutils (for ar and as)</pre>
<pre> flex (for libfl.a)</pre>
<pre> libncurses5-dev (for libtermcap)</pre>
<p>Furthermore, cminstall will look for the following packages/libraries,
which are only necessary if you want to develop applications that use these
libraries; you can choose to <i>not</i> install these and ignore errors from
cminstall as described below. Otherwise, install these packages:</p>
<pre> libpq-dev (for libpq.so)</pre>
<pre> freeglut3-dev (for libGL.so, libGLU.so)</pre>
<pre> unixodbc-dev (for libodbc.so)</pre>
<pre> libmotif-dev (for libXm.so)</pre>
<pre> libx11-dev (for a series of libX*.so files)</pre>
<p>Also, in order for cminstall (below) to find some of the X11 libraries, you have to create symbolic links:</p>
<pre> cd /usr/lib</pre>
<pre> sudo ln -s libXmu.so.6 libXmu.so</pre>
<pre> sudo ln -s libXaw.so.7 libXaw.so</pre>
<p>(If any other library file is not found, try to locate it using packages.ubuntu.com and install the appropriate package or add symbolic links to account for slight name differences as above)</p>
<p>=========================================================================</p>
<p>First, let's do the minimal binary installation.</p>
<p>Download a cm3-min-POSIX-LINUXLIBC6* (or cm3-min-LINUXLIBC6*) package to your Desktop, from</p>
<pre> <a href="http://www.opencm3.net">http://www.opencm3.net</a></pre>
<p>(i.e. one of
<pre> <a href="http://www.opencm3.net/download.html">http://www.opencm3.net/download.html</a></pre>
<pre> <a href="http://www.opencm3.net/uploaded-archives/index.html">http://www.opencm3.net/uploaded-archives/index.html</a></pre>
<pre> <a href="http://www.opencm3.net/snaps/snapshot-index.html">http://www.opencm3.net/snaps/snapshot-index.html</a></pre>
<p>).</p>
<p>Note that most earlier minimal binaries do <i>not</i> work, so stick with d5.5.1 or later. The following versions are known to succeed:</p>
<pre> cm3-min-POSIX-LINUXLIBC6-d5.5.1-2008-01-24-03-35-01.tgz</pre>
<pre> cm3-min-POSIX-LINUXLIBC6-d5.6.0-2008-02-13-03-35-02.tgz</pre>
<pre> cm3-min-POSIX-LINUXLIBC6-d5.7.0-2008-04-24-14-00-04.tgz</pre>
<p>You will find an appropriate checksum on</p>
<pre> <a href="http://www.opencm3.net/checksums.php3">http://www.opencm3.net/checksums.php3</a></pre>
<p>or just use the commands from this screenshot:</p>
<p>"</p>
<pre> $ md5sum cm3-min-POSIX-LINUXLIBC6-d5.7.0-2008-04-24-14-00-04.tgz
ba70f9511a2bd3da912935dbcf3df423 cm3-min-POSIX-LINUXLIBC6-d5.7.0-2008-04-24-14-00-04.tgz
neels@dub:~/elego/SafeCVS/install
$ wget -q -O - http://www.opencm3.net/checksums.php3 | grep cm3-min-POSIX-LINUXLIBC6-d5.7.0-2008-04-24-14-00-04.tgz
-rw-r--r-- 1 neels m3 8215951 2009-04-11 22:51 uploaded-archives/cm3-min-POSIX-LINUXLIBC6-d5.7.0-2008-04-24-14-00-04.tgz
596342621 8215951 uploaded-archives/cm3-min-POSIX-LINUXLIBC6-d5.7.0-2008-04-24-14-00-04.tgz
ba70f9511a2bd3da912935dbcf3df423 uploaded-archives/cm3-min-POSIX-LINUXLIBC6-d5.7.0-2008-04-24-14-00-04.tgz</pre>
<p>"</p>
<p>Note that <b>the tarballs do not unpack to a subdirectory but to the current directory</b>, so run these commands:</p>
<pre> mkdir ~/cm3-min</pre>
<pre> cd ~/cm3-min</pre>
<pre> tar xzf ~/Desktop/cm3-min-POSIX-LINUXLIBC6-d5.6.0-2008-02-13-03-35-02.tgz</pre>
<pre> ./cminstall</pre>
<p>Ideally, cminstall will just succeed. If it asks any questions, that's because it could not find some library. Below are the would-be correct answers.</p>
<p>Note that, if one of the libraries is not installed and if you furthermore choose to skip that library, you can answer the questions like shown for OpenGL and X11 below: first choose the default by hitting enter, then answer no, finally answer yes.</p>
<p>(Again, note that none of these questions have to be answered if the libraries are all being found)</p>
<pre> Where would you like the system installed? /usr/local/cm3 </pre>
<pre> What should be the default text editor for new Reactor users? /usr/bin/vi</pre>
<pre> Where are the flex/bison libraries? /usr/lib</pre>
<pre> Where are the Postgres95 libraries? /usr/lib</pre>
<pre> Where are the OpenGL libraries? /usr/lib
The libraries libGL.so libGLU.so are not present in the chosen directory.
Would you like to change the library names? no
Would you like to continue nonetheless? yes</pre>
<pre> Where are the ODBC libraries? /usr/lib</pre>
<pre> Where are the Motif libraries? /usr/lib</pre>
<pre> Where are the X11 libraries? /usr/lib
The libraries libX11.so libICE.so libSM.so libXt.so libXext.so libXmu.so libXaw.so are not present in the chosen directory.
Would you like to change the library names? no
Would you like to continue nonetheless? yes</pre>
<pre> Where is your C compiler? /usr/bin/gcc</pre>
<pre> Where is your library archiver? /usr/bin/ar</pre>
<pre> Where is your assembler? /usr/bin/as</pre>
<p>That's all for cminstall. You have installed the minimal cm3 compiler to /usr/local/cm3.</p>
<p>Now, we need to register cm3's path locations (not entirely unlike the instructions given by cminstall's output).</p>
<p>(The following two sudos are needed regardless of write permission to /usr/local)</p>
<p>To adjust PATH, as root, edit the file</p>
<pre> /etc/environment</pre>
<p>(e.g.</p>
<pre> sudo gedit /etc/environment</pre>
<p>) and add the PATH element /usr/local/cm3/bin, to yield a line like this:</p>
<pre> PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/cm3/bin"</pre>
<p>To adjust your library path, run</p>
<pre> sudo -s
echo /usr/local/cm3/lib > /etc/ld.so.conf.d/cm3
exit</pre>
<p>, which creates a new single-line file in /etc/ld.so.conf.d/. (Note that `sudo echo ...' does not work because of the `>' pipe.)</p>
<p>To check whether this worked, make sure that the cm3 path elements are added to the environment variables. First, <i>you have to open a new shell</i> to update the environment (just run `bash' or open a new terminal window). Then run</p>
<pre> echo $PATH</pre>
<p>which should print a line including /usr/local/cm3/bin -- something like</p>
<pre> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/cm3/bin:/usr/local/pgsql/bin</pre>
<p>. Then, try running</p>
<pre> cm3 -version</pre>
<p>, which should print something like</p>
<pre>Critical Mass Modula-3 version d5.6.0-2008-02-13-03-35-02
last updated: 2008-01-31
compiled: 2008-02-13 04:01:27
configuration: /usr/local/cm3/bin/cm3.cfg</pre>
<p>. Great, the minimal binary installation is now complete! However, there is not much you can do with <i>this</i> cm3, yet.</p>
<p>=========================================================================</p>
<p>Let's continue with downloading and compiling the full cm3 sources.</p>
<p>Upon writing this file, the newest available stable tarballs (version 5.4.0) are too old. So, you have to go about downloading the cm3 sources from CVS like this:</p>
<p>(CVS instructions adapted from <a href="http://www.opencm3.net/cvs-cm3.html">http://www.opencm3.net/cvs-cm3.html</a> )</p>
<pre> cd # (go to your home directory)</pre>
<pre> cvs -d :pserver:anonymous@modula3.elegosoft.com:/usr/cvs login</pre>
<p>When prompted for a password, just hit Enter.</p>
<p>Now you can choose to take the exact state that worked when writing this file, or to use the newest available sources.</p>
<p>The sources that worked for me are obtained via:</p>
<pre> cvs -z 3 -d :pserver:anonymous@modula3.elegosoft.com:/usr/cvs checkout -D "2008-02-15 23:50" cm3</pre>
<p>or</p>
<pre> cvs -z 3 -d :pserver:anonymous@modula3.elegosoft.com:/usr/cvs checkout -D "2008-01-24 23:52" cm3</pre>
<p>The most recent sources, as of the time that you are running the command, are obtained via:</p>
<pre> cvs -z 3 -d :pserver:anonymous@modula3.elegosoft.com:/usr/cvs checkout cm3</pre>
<p>This will download the complete cm3 sources and may take a while.</p>
<p>(I added a `-z 3' argument to use level 3 compression for transferring the data, to speed up the download.)</p>
<p>=========================================================================</p>
<p>Now we're ready to start compiling the full-featured cm3 compiler, using the minimal cm3 compiler from above:</p>
<pre> cd ~/cm3/scripts</pre>
<pre> ./do-cm3-core.sh buildship</pre>
<pre> ./install-cm3-compiler.sh upgrade</pre>
<pre> ./do-cm3-std.sh buildship</pre>
<p>These lines will compile for a long time, producing lots of output. Make sure that each of them exited without errors. If some of the libraries were missing upon cminstall (above), some packages may not compile successfully. It may help to run</p>
<pre> ./do-cm3-std.sh buildship</pre>
<p>a few more times.</p>
<p>[TODO: how to exclude certain packages from compilation and shipping]</p>
<p>If these commands complete without issuing error messages in the last few lines, your cm3 installation was probably successful. Again, verify that your full-featured cm3 is working. Run:</p>
<pre> cm3 -version</pre>
<p>and expect similar output as above, but showing data matching the compiled
version:</p>
<pre>Critical Mass Modula-3 version d5.6.0
last updated: 2008-01-31
compiled: 2009-04-11 23:05:21
configuration: /usr/local/cm3/bin/cm3.cfg</pre>
<p>=========================================================================</p>
<p>You can now free some disc space.</p>
<p>You will definitely want to remove the minimal binary files. You won't need them anymore:</p>
<pre> rm -rf ~/cm3-min</pre>
<p>If you want to make changes to the cm3 compiler itself, you can keep the sources at ~/cm3 for rebuilding at a later stage. Otherwise, just remove these as well:</p>
<pre> rm -rf ~/cm3</pre>
<p>If you also remove the downloaded files from your Desktop, this leaves your home directory as it was before you started the installation.</p>
<p>=========================================================================</p>
<p>Congratulations, you have just installed Critical Mass Modula3!</p>
<p>Thank you for using Critical Mass Modula3 - for further questions, feel free to contact m3-support@elego.de</p>