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