2602
|
1 Since July 1996, most work on Octave has been done using a Linux |
|
2 system, and a number of people who regularly test Octave snapshot |
|
3 releases also primarily use Linux systems. |
2593
|
4 |
2596
|
5 However, I have recently started to receive a significant number of |
|
6 reports from people who say that they can't compile or run Octave on |
2602
|
7 Linux systems. In nearly every case, the problem has turned out |
2596
|
8 to be that the compilers or libraries have not been installed |
|
9 properly. I suspect that this often results from a botched upgrade, |
|
10 or from attempting to install the compilers from the standard source |
|
11 distributions. But in some cases, the cause has been a buggy Linux |
2597
|
12 distribution. Many of these problems go unnoticed because much of the |
|
13 software for Linux is written in C, not C++. |
2593
|
14 |
2596
|
15 Octave compiles, but it won't run |
|
16 --------------------------------- |
|
17 |
|
18 If you can compile Octave, but it crashes with a segmentation fault |
|
19 right away, you probably have incompatible versions of libc and libg++ |
|
20 installed, or you have a version of the dynamic loader, ld.so, that is |
|
21 incompatible with your versions of the libraries, or both. |
2593
|
22 |
|
23 On my development system, I am using the following software: |
|
24 |
|
25 * Linux kernel 2.0.6 |
|
26 * gcc/g++ 2.7.2 |
2608
|
27 * g77 0.5.18 |
2593
|
28 * libg++/libstdc++ 2.7.1.0 |
|
29 * libm 5.0.5 |
|
30 * libc 5.2.18 |
|
31 * libncurses 3.0 |
|
32 * ld.so 1.7.14 |
2608
|
33 * binutils 2.6 |
2593
|
34 |
|
35 I know from experience that the versions listed above seem to work |
2596
|
36 well together. But if you have a newer version of the kernel, you may |
|
37 need a newer version of the C library. I don't have time to keep up |
|
38 with all the various library versions (life is much too short for |
|
39 that), nor do I know which combinations are supposed to work together. |
|
40 That sort of information should be clearly stated in the release notes |
|
41 for the libraries. If it is not, please ask the maintainers of the |
|
42 libraries to clarify the documentation. |
|
43 |
|
44 Octave won't even compile |
|
45 ------------------------- |
2593
|
46 |
|
47 If you can't compile Octave, you should first check to see that your |
|
48 compiler and header files are properly installed. Do you have |
|
49 multiple versions of the g++ include files on your system? Are you |
2596
|
50 sure that your copy of g++ is finding the right set? You can find out |
|
51 by compiling a simple C++ program with -v: |
|
52 |
|
53 bash$ cat foo.cc |
|
54 #include <iostream.h> |
|
55 int main (void} { cerr << "yo\n"; return 0; } |
|
56 |
|
57 bash$ g++ -v foo.cc |
|
58 gcc -v foo.cc -lg++ -lstdc++ -lm |
|
59 Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2/specs |
|
60 gcc version 2.7.2 |
|
61 /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -lang-c++ -v -undef ... |
|
62 #include "..." search starts here: |
|
63 #include <...> search starts here: |
|
64 /usr/lib/g++-include |
|
65 /usr/local/include |
|
66 /usr/i486-linux/include |
|
67 /usr/lib/gcc-lib/i486-linux/2.7.2/include |
|
68 /usr/include |
|
69 End of search list. |
|
70 ... |
|
71 |
2597
|
72 If the location of the correct set of include files is not listed in |
|
73 the search path, then you might be able to fix that with a symbolic |
|
74 link. However, if your version of libg++ was not compiled with your |
|
75 current version of gcc, you are likely to run into more trouble. |
2596
|
76 |
2598
|
77 The linker can't find -lieee |
|
78 ---------------------------- |
|
79 |
|
80 This can happen because your libraries don't match your version of |
|
81 gcc. Some recent Linux distributions don't include a libieee.a file |
|
82 because IEEE support is now the default and the library is no longer |
|
83 needed, but the gcc specs file still adds -lieee to the linker command |
|
84 if gcc is invoked with the -mieeefp flag. I believe that you should |
|
85 be able to fix this by editing the gcc specs file. In it, you should |
|
86 find something like this: |
|
87 |
|
88 %{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \ |
|
89 %{!ggdb:-lc} %{ggdb:-lg}} |
|
90 |
|
91 changing it to |
|
92 |
|
93 %{!shared: %{p:-lgmon} %{pg:-lgmon} %{!ggdb:-lc} %{ggdb:-lg}} |
|
94 |
|
95 should keep gcc from adding -lieee to the link command. You can find |
|
96 the location of the specs file by running the command gcc -v. |
|
97 |
2601
|
98 If you can't edit the gcc specs file for some reason, another solution |
|
99 that should work is to create an empty libieee.a file in the Octave |
|
100 src directory using the command: |
|
101 |
|
102 ar cq libieee.a |
|
103 |
2608
|
104 NOTE: you should fix this problem (either by editing the specs file or |
|
105 by creating the library) *before* running configure and compiling |
|
106 Octave. Otherwise, configure may incorrectly determine that your |
|
107 system doesn't have support for some IEEE math functions. |
|
108 |
2598
|
109 My system doesn't have g77 |
|
110 -------------------------- |
|
111 |
|
112 A binary release of g77 that should work with gcc 2.7.2 is available |
|
113 from sunsite.unc.edu in the directory /pub/Linux/devel/lang/fortran. |
|
114 There is also a Debian package for g77. |
|
115 |
2600
|
116 Problems with g77 on Debian 1.2 systems (and possibly others) |
|
117 ------------------------------------------------------------- |
|
118 |
|
119 The location of the compiler binaries has changed, so the g77 0.5.18 |
|
120 package can not be used without modification. The problem is that the |
|
121 Debian package was built for gcc 2.7.2 and not 2.7.2.1 and the f771 |
|
122 backend is installed in the wrong directory. |
|
123 |
|
124 Version 0.5.19 of g77 has just been released. A fixed Debian package |
|
125 may be made available soon. Until then, you can make things work by |
|
126 copying f771 and libf2c.a from /usr/lib/gcc-lib/i486-linux/2.7.2 to |
|
127 /usr/lib/gcc-lib/i486-linux/2.7.2.1. |
|
128 |
2596
|
129 Upgrading your compiler and libraries |
|
130 ------------------------------------- |
|
131 |
2598
|
132 Installing libg++ on a Linux system is not as simple as it should be, |
|
133 because libg++ shares some basic I/O code with the Linux C library, |
|
134 and they must be compatible. You should get and read the release |
|
135 notes for the compiler and libraries. |
|
136 |
2601
|
137 If you decide to install versions of the libraries that are older (or |
|
138 newer) than the ones you already have, you should follow the |
|
139 directions in the release notes very carefully. |
|
140 |
|
141 |
2598
|
142 If you have comments or suggestions for this document, please contact |
|
143 bug-octave@bevo.che.wisc.edu. |
2593
|
144 |
|
145 John W. Eaton |
|
146 jwe@bevo.che.wisc.edu |
|
147 University of Wisconsin-Madison |
|
148 Department of Chemical Engineering |
|
149 |
2608
|
150 Wed Jan 15 20:04:54 1997 |