3294
|
1 @c Copyright (C) 1996, 1997 John W. Eaton |
|
2 @c This is part of the Octave manual. |
|
3 @c For copying conditions, see the file gpl.texi. |
|
4 |
|
5 @c The text of this file will eventually appear in the file INSTALL |
|
6 @c in the Octave distribution, as well as in the Octave manual. |
|
7 |
|
8 @ifclear INSTALLONLY |
4167
|
9 @node Installation |
3294
|
10 @appendix Installing Octave |
|
11 @end ifclear |
|
12 |
|
13 @ifset INSTALLONLY |
|
14 @include conf.texi |
|
15 |
|
16 This file documents the installation of Octave. |
|
17 |
|
18 Octave is free software; you can redistribute it and/or modify it |
|
19 under the terms of the GNU General Public License as published by the |
|
20 Free Software Foundation. |
|
21 |
4167
|
22 @node Installation |
3294
|
23 @chapter Installing Octave |
|
24 @end ifset |
|
25 |
|
26 @cindex installing Octave |
|
27 |
|
28 Here is the procedure for installing Octave from scratch on a Unix |
3862
|
29 system. |
3294
|
30 |
|
31 @itemize @bullet |
|
32 @item |
|
33 Run the shell script @file{configure}. This will determine the features |
|
34 your system has (or doesn't have) and create a file named |
|
35 @file{Makefile} from each of the files named @file{Makefile.in}. |
|
36 |
|
37 Here is a summary of the configure options that are most frequently used |
|
38 when building Octave: |
|
39 |
|
40 @table @code |
|
41 @item --prefix=@var{prefix} |
|
42 Install Octave in subdirectories below @var{prefix}. The default value |
|
43 of @var{prefix} is @file{/usr/local}. |
|
44 |
|
45 @item --srcdir=@var{dir} |
|
46 Look for Octave sources in the directory @var{dir}. |
|
47 |
|
48 @item --with-f2c |
|
49 Use @code{f2c} even if a Fortran compiler is available. |
|
50 |
4838
|
51 @item --with-f77 |
|
52 Use @code{f77} to compile Fortran code. You may also specify the name |
|
53 of the compiler to use as an optional argument. For example, |
|
54 @code{--with-f77=g77} sets the name of the Fortran compiler to |
|
55 @code{g77}. |
3294
|
56 |
|
57 @item --enable-shared |
|
58 Create shared libraries. If you are planning to use |
3690
|
59 @code{--enable-lite-kernel} or the dynamic loading features, you will |
3294
|
60 probably want to use this option. It will make your @file{.oct} files |
|
61 much smaller and on some systems it may be necessary to build shared |
|
62 libraries in order to use dynamically linked functions. |
|
63 |
|
64 You may also want to build a shared version of @code{libstdc++}, if your |
|
65 system doesn't already have one. Note that a patch is needed to build |
|
66 shared versions of version 2.7.2 of @code{libstdc++} on the HP-PA |
|
67 architecture. You can find the patch at |
|
68 @url{ftp://ftp.cygnus.com/pub/g++/libg++-2.7.2-hppa-gcc-fix}. |
|
69 |
|
70 @item --enable-dl |
|
71 Use @code{dlopen} and friends to make Octave capable of dynamically |
|
72 linking externally compiled functions. This only works on systems that |
|
73 actually have these functions. If you plan on using this feature, you |
|
74 should probably also use @code{--enable-shared} to reduce the size of |
|
75 your @file{.oct} files. |
|
76 |
|
77 @item --enable-shl |
|
78 Use @code{shl_load} and friends to make Octave capable of dynamically |
|
79 linking externally compiled functions. This only works on systems that |
|
80 actually have these functions (only HP-UX systems). If you plan on |
|
81 using this feature, you should probably also use @code{--enable-shared} |
|
82 to reduce the size of your @file{.oct} files. |
|
83 |
|
84 @item --enable-lite-kernel |
|
85 Compile smaller kernel. This currently requires the dynamic linking |
|
86 functions @code{dlopen} or @code{shl_load} and friends so that Octave |
|
87 can load functions at run time that are not loaded at compile time. |
|
88 |
3960
|
89 @item --without-blas |
3690
|
90 Compile and use the generic BLAS and LAPACK versions included with |
|
91 Octave. By default, configure first looks for BLAS and LAPACK matrix |
|
92 libraries on your system, including optimized BLAS implementations such |
|
93 as the free ATLAS 3.0, as well as vendor-tuned libraries. (The use of |
|
94 an optimized BLAS will generally result in several-times faster matrix |
|
95 operations.) Only use this option if your system has BLAS/LAPACK |
|
96 libraries that cause problems for some reason. You can also use |
3960
|
97 @code{--with-blas=lib} to specify a particular BLAS library |
3690
|
98 @code{-llib} that configure doesn't check for automatically. |
|
99 |
3294
|
100 @item --help |
|
101 Print a summary of the options recognized by the configure script. |
|
102 @end table |
|
103 |
|
104 See the file @file{INSTALL} for more information about the command line |
|
105 options used by configure. That file also contains instructions for |
|
106 compiling in a directory other than where the source is located. |
|
107 |
|
108 @item |
|
109 Run make. |
|
110 |
|
111 You will need a recent version of GNU Make. Modifying Octave's |
|
112 makefiles to work with other make programs is probably not worth |
|
113 your time. We recommend you get and compile GNU Make instead. |
|
114 |
|
115 For plotting, you will need to have gnuplot installed on your system. |
|
116 Gnuplot is a command-driven interactive function plotting program. |
|
117 Gnuplot is copyrighted, but freely distributable. The `gnu' in gnuplot |
|
118 is a coincidence---it is not related to the GNU project or the FSF in |
|
119 any but the most peripheral sense. |
|
120 |
|
121 To compile Octave, you will need a recent version of GNU Make. You |
|
122 will also need @code{g++} 2.7.2 or later. Version 2.8.0 or @code{egcs} |
|
123 1.0.x should work. Later versions may work, but C++ is still evolving, |
|
124 so don't be too surprised if you run into some trouble. |
|
125 |
|
126 It is no longer necessary to have @code{libg++}, but you do need to have |
|
127 the GNU implementation of @code{libstdc++}. If you are using @code{g++} |
|
128 2.7.2, @code{libstdc++} is distributed along with @code{libg++}, but for |
|
129 later versions, @code{libstdc++} is distributed separately. For |
|
130 @code{egcs}, @code{libstdc++} is included with the compiler |
|
131 distribution. |
|
132 |
|
133 If you plan to modify the parser you will also need GNU @code{bison} and |
|
134 @code{flex}. If you modify the documentation, you will need GNU |
|
135 Texinfo, along with the patch for the @code{makeinfo} program that is |
|
136 distributed with Octave. |
|
137 |
|
138 GNU Make, @code{gcc}, and @code{libstdc++}, @code{gnuplot}, |
|
139 @code{bison}, @code{flex}, and Texinfo are all available from many |
|
140 anonymous ftp archives. The primary site is @url{ftp.gnu.org}, but it |
|
141 is often very busy. A list of sites that mirror the software on |
|
142 @url{ftp.gnu.org} is available by anonymous ftp from |
|
143 @url{ftp://ftp.gnu.org/pub/gnu/GNUinfo/FTP}. |
|
144 |
|
145 If you don't have a Fortran compiler, or if your Fortran compiler |
|
146 doesn't work like the traditional Unix f77, you will need to have the |
|
147 Fortran to C translator @code{f2c}. You can get @code{f2c} from any |
|
148 number of anonymous ftp archives. The most recent version of @code{f2c} |
|
149 is always available from @url{netlib.att.com}. |
|
150 |
|
151 On an otherwise idle Pentium 133 running Linux, it will take somewhere |
|
152 between 1-1/2 to 3 hours to compile everything, depending on whether you |
|
153 are building shared libraries. You will need about 100 megabytes of disk |
|
154 storage to work with (considerably less if you don't compile with debugging |
|
155 symbols). To do that, use the command |
|
156 |
|
157 @example |
|
158 make CFLAGS=-O CXXFLAGS=-O LDFLAGS= |
|
159 @end example |
|
160 |
|
161 @noindent |
|
162 instead of just @samp{make}. |
|
163 |
|
164 @item |
|
165 If you encounter errors while compiling Octave, first check the list of |
|
166 known problems below to see if there is a workaround or solution for |
|
167 your problem. If not, |
|
168 @ifclear INSTALLONLY |
|
169 see @ref{Trouble}, |
|
170 @end ifclear |
|
171 @ifset INSTALLONLY |
|
172 see the file BUGS |
|
173 @end ifset |
|
174 for information about how to report bugs. |
|
175 |
|
176 @item |
|
177 Once you have successfully compiled Octave, run @samp{make install}. |
|
178 |
|
179 This will install a copy of octave, its libraries, and its documentation |
|
180 in the destination directory. As distributed, Octave is installed in |
|
181 the following directories. In the table below, @var{prefix} defaults to |
|
182 @file{/usr/local}, @var{version} stands for the current version number |
|
183 of the interpreter, and @var{arch} is the type of computer on which |
|
184 Octave is installed (for example, @samp{i586-unknown-gnu}). |
|
185 |
|
186 @table @file |
|
187 @item @var{prefix}/bin |
|
188 Octave and other binaries that people will want to run directly. |
|
189 |
|
190 @item @var{prefix}/lib |
|
191 Libraries like libcruft.a and liboctave.a. |
|
192 |
|
193 @item @var{prefix}/share |
|
194 Architecture-independent data files. |
|
195 |
|
196 @item @var{prefix}/include/octave |
|
197 Include files distributed with Octave. |
|
198 |
|
199 @item @var{prefix}/man/man1 |
|
200 Unix-style man pages describing Octave. |
|
201 |
|
202 @item @var{prefix}/info |
|
203 Info files describing Octave. |
|
204 |
|
205 @item @var{prefix}/share/octave/@var{version}/m |
|
206 Function files distributed with Octave. This includes the Octave |
|
207 version, so that multiple versions of Octave may be installed at the |
|
208 same time. |
|
209 |
|
210 @item @var{prefix}/lib/octave/@var{version}/exec/@var{arch} |
|
211 Executables to be run by Octave rather than the user. |
|
212 |
|
213 @item @var{prefix}/lib/octave/@var{version}/oct/@var{arch} |
|
214 Object files that will be dynamically loaded. |
|
215 |
|
216 @item @var{prefix}/share/octave/@var{version}/imagelib |
|
217 Image files that are distributed with Octave. |
|
218 @end table |
|
219 @end itemize |
|
220 |
|
221 @menu |
|
222 * Installation Problems:: |
|
223 @end menu |
|
224 |
4167
|
225 @node Installation Problems |
3294
|
226 @appendixsec Installation Problems |
|
227 |
|
228 This section contains a list of problems (and some apparent problems |
|
229 that don't really mean anything is wrong) that may show up during |
|
230 installation of Octave. |
|
231 |
|
232 @itemize @bullet |
|
233 @item |
|
234 On some SCO systems, @code{info} fails to compile if |
|
235 @code{HAVE_TERMIOS_H} is defined int @file{config.h}. Simply removing |
|
236 the definition from @file{info/config.h} should allow it to compile. |
|
237 |
|
238 @item |
|
239 If @code{configure} finds @code{dlopen}, @code{dlsym}, @code{dlclose}, |
|
240 and @code{dlerror}, but not the header file @file{dlfcn.h}, you need to |
|
241 find the source for the header file and install it in the directory |
|
242 @file{usr/include}. This is reportedly a problem with Slackware 3.1. |
|
243 For Linux/GNU systems, the source for @file{dlfcn.h} is in the |
|
244 @code{ldso} package. |
|
245 |
|
246 @item |
|
247 Building @file{.oct} files doesn't work. |
|
248 |
|
249 You should probably have a shared version of @code{libstdc++}. A patch |
|
250 is needed to build shared versions of version 2.7.2 of @code{libstdc++} |
|
251 on the HP-PA architecture. You can find the patch at |
|
252 @url{ftp://ftp.cygnus.com/pub/g++/libg++-2.7.2-hppa-gcc-fix}. |
|
253 |
|
254 @item |
3464
|
255 On some alpha systems there may be a problem with the @code{libdxml} |
|
256 library, resulting in floating point errors and/or segmentation faults in |
|
257 the linear algebra routines called by Octave. If you encounter such |
|
258 problems, then you should modify the configure script so that |
|
259 @code{SPECIAL_MATH_LIB} is not set to @code{-ldxml}. |
|
260 |
|
261 @item |
3294
|
262 On FreeBSD systems Octave may hang while initializing some internal |
|
263 constants. The fix appears to be to use |
|
264 |
|
265 @example |
|
266 options GPL_MATH_EMULATE |
|
267 @end example |
|
268 |
|
269 @noindent |
|
270 rather than |
|
271 |
|
272 @example |
|
273 options MATH_EMULATE |
|
274 @end example |
|
275 |
|
276 @noindent |
|
277 in the kernel configuration files (typically found in the directory |
|
278 @file{/sys/i386/conf}. After making this change, you'll need to rebuild |
|
279 the kernel, install it, and reboot. |
|
280 |
|
281 @item |
|
282 If you encounter errors like |
|
283 |
|
284 @smallexample |
|
285 @group |
|
286 passing `void (*)()' as argument 2 of |
|
287 `octave_set_signal_handler(int, void (*)(int))' |
|
288 @end group |
|
289 @end smallexample |
|
290 |
|
291 @noindent |
|
292 or |
|
293 |
|
294 @smallexample |
|
295 warning: ANSI C++ prohibits conversion from `(int)' to `(...)' |
|
296 @end smallexample |
|
297 |
|
298 @noindent |
|
299 while compiling @file{sighandlers.cc}, you may need to edit some files |
|
300 in the @code{gcc} include subdirectory to add proper prototypes for functions |
|
301 there. For example, Ultrix 4.2 needs proper declarations for the |
|
302 @code{signal} function and the @code{SIG_IGN} macro in the file |
|
303 @file{signal.h}. |
|
304 |
|
305 On some systems the @code{SIG_IGN} macro is defined to be something like |
|
306 this: |
|
307 |
|
308 @example |
|
309 #define SIG_IGN (void (*)())1 |
|
310 @end example |
|
311 |
|
312 @noindent |
|
313 when it should really be something like: |
|
314 |
|
315 @example |
|
316 #define SIG_IGN (void (*)(int))1 |
|
317 @end example |
|
318 |
|
319 @noindent |
|
320 to match the prototype declaration for the @code{signal} function. This |
|
321 change should also be made for the @code{SIG_DFL} and @code{SIG_ERR} |
|
322 symbols. It may be necessary to change the definitions in |
|
323 @file{sys/signal.h} as well. |
|
324 |
|
325 The @code{gcc} @code{fixincludes} and @code{fixproto} scripts should |
|
326 probably fix these problems when @code{gcc} installs its modified set of |
|
327 header files, but I don't think that's been done yet. |
|
328 |
|
329 @strong{You should not change the files in @file{/usr/include}}. You |
|
330 can find the @code{gcc} include directory tree by running the command |
|
331 |
|
332 @example |
|
333 gcc -print-libgcc-file-name |
|
334 @end example |
|
335 |
|
336 @noindent |
|
337 The directory of @code{gcc} include files normally begins in the same directory |
|
338 that contains the file @file{libgcc.a}. |
|
339 |
|
340 @item |
|
341 Some of the Fortran subroutines may fail to compile with older versions |
|
342 of the Sun Fortran compiler. If you get errors like |
|
343 |
|
344 @smallexample |
|
345 zgemm.f: |
|
346 zgemm: |
|
347 warning: unexpected parent of complex expression subtree |
|
348 zgemm.f, line 245: warning: unexpected parent of complex |
|
349 expression subtree |
|
350 warning: unexpected parent of complex expression subtree |
|
351 zgemm.f, line 304: warning: unexpected parent of complex |
|
352 expression subtree |
|
353 warning: unexpected parent of complex expression subtree |
|
354 zgemm.f, line 327: warning: unexpected parent of complex |
|
355 expression subtree |
|
356 pcc_binval: missing IR_CONV in complex op |
|
357 make[2]: *** [zgemm.o] Error 1 |
|
358 @end smallexample |
|
359 |
|
360 @noindent |
|
361 when compiling the Fortran subroutines in the @file{libcruft} |
|
362 subdirectory, you should either upgrade your compiler or try compiling |
|
363 with optimization turned off. |
|
364 |
|
365 @item |
|
366 On NeXT systems, if you get errors like this: |
|
367 |
|
368 @example |
|
369 /usr/tmp/cc007458.s:unknown:Undefined local symbol LBB7656 |
|
370 /usr/tmp/cc007458.s:unknown:Undefined local symbol LBE7656 |
|
371 @end example |
|
372 |
|
373 @noindent |
|
374 when compiling @file{Array.cc} and @file{Matrix.cc}, try recompiling |
|
375 these files without @code{-g}. |
|
376 |
|
377 @item |
|
378 Some people have reported that calls to shell_cmd and the pager do not |
|
379 work on SunOS systems. This is apparently due to having |
|
380 @code{G_HAVE_SYS_WAIT} defined to be 0 instead of 1 when compiling |
|
381 @code{libg++}. |
|
382 |
|
383 @item |
|
384 On NeXT systems, linking to @file{libsys_s.a} may fail to resolve the |
|
385 following functions |
|
386 |
|
387 @example |
|
388 _tcgetattr |
|
389 _tcsetattr |
|
390 _tcflow |
|
391 @end example |
|
392 |
|
393 @noindent |
|
394 which are part of @file{libposix.a}. Unfortunately, linking Octave with |
|
395 @code{-posix} results in the following undefined symbols. |
|
396 |
|
397 @example |
|
398 .destructors_used |
|
399 .constructors_used |
|
400 _objc_msgSend |
|
401 _NXGetDefaultValue |
|
402 _NXRegisterDefaults |
|
403 .objc_class_name_NXStringTable |
|
404 .objc_class_name_NXBundle |
|
405 @end example |
|
406 |
|
407 One kluge around this problem is to extract @file{termios.o} from |
|
408 @file{libposix.a}, put it in Octave's @file{src} directory, and add it |
|
409 to the list of files to link together in the makefile. Suggestions for |
|
410 better ways to solve this problem are welcome! |
|
411 |
|
412 @item |
|
413 If Octave crashes immediately with a floating point exception, it is |
|
414 likely that it is failing to initialize the IEEE floating point values |
|
415 for infinity and NaN. |
|
416 |
|
417 If your system actually does support IEEE arithmetic, you should be able |
|
418 to fix this problem by modifying the function @code{octave_ieee_init} in |
|
419 the file @file{lo-ieee.cc} to correctly initialize Octave's internal |
|
420 infinity and NaN variables. |
|
421 |
|
422 If your system does not support IEEE arithmetic but Octave's configure |
|
423 script incorrectly determined that it does, you can work around the |
|
424 problem by editing the file @file{config.h} to not define |
|
425 @code{HAVE_ISINF}, @code{HAVE_FINITE}, and @code{HAVE_ISNAN}. |
|
426 |
|
427 In any case, please report this as a bug since it might be possible to |
|
428 modify Octave's configuration script to automatically determine the |
|
429 proper thing to do. |
|
430 |
|
431 @end itemize |