2593
|
1 Since July 1996, most work on Octave has been done using a |
2596
|
2 Linux/GNU system, and a number of people who regularly test Octave |
|
3 snapshot releases also primarily use Linux/GNU 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 |
|
7 Linux/GNU systems. In nearly every case, the problem has turned out |
|
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 |
|
27 * libg++/libstdc++ 2.7.1.0 |
|
28 * libm 5.0.5 |
|
29 * libc 5.2.18 |
|
30 * libncurses 3.0 |
|
31 * ld.so 1.7.14 |
|
32 |
|
33 I know from experience that the versions listed above seem to work |
2596
|
34 well together. But if you have a newer version of the kernel, you may |
|
35 need a newer version of the C library. I don't have time to keep up |
|
36 with all the various library versions (life is much too short for |
|
37 that), nor do I know which combinations are supposed to work together. |
|
38 That sort of information should be clearly stated in the release notes |
|
39 for the libraries. If it is not, please ask the maintainers of the |
|
40 libraries to clarify the documentation. |
|
41 |
|
42 Octave won't even compile |
|
43 ------------------------- |
2593
|
44 |
|
45 If you can't compile Octave, you should first check to see that your |
|
46 compiler and header files are properly installed. Do you have |
|
47 multiple versions of the g++ include files on your system? Are you |
2596
|
48 sure that your copy of g++ is finding the right set? You can find out |
|
49 by compiling a simple C++ program with -v: |
|
50 |
|
51 bash$ cat foo.cc |
|
52 #include <iostream.h> |
|
53 int main (void} { cerr << "yo\n"; return 0; } |
|
54 |
|
55 bash$ g++ -v foo.cc |
|
56 gcc -v foo.cc -lg++ -lstdc++ -lm |
|
57 Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2/specs |
|
58 gcc version 2.7.2 |
|
59 /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -lang-c++ -v -undef ... |
|
60 #include "..." search starts here: |
|
61 #include <...> search starts here: |
|
62 /usr/lib/g++-include |
|
63 /usr/local/include |
|
64 /usr/i486-linux/include |
|
65 /usr/lib/gcc-lib/i486-linux/2.7.2/include |
|
66 /usr/include |
|
67 End of search list. |
|
68 ... |
|
69 |
2597
|
70 If the location of the correct set of include files is not listed in |
|
71 the search path, then you might be able to fix that with a symbolic |
|
72 link. However, if your version of libg++ was not compiled with your |
|
73 current version of gcc, you are likely to run into more trouble. |
2596
|
74 |
2598
|
75 The linker can't find -lieee |
|
76 ---------------------------- |
|
77 |
|
78 This can happen because your libraries don't match your version of |
|
79 gcc. Some recent Linux distributions don't include a libieee.a file |
|
80 because IEEE support is now the default and the library is no longer |
|
81 needed, but the gcc specs file still adds -lieee to the linker command |
|
82 if gcc is invoked with the -mieeefp flag. I believe that you should |
|
83 be able to fix this by editing the gcc specs file. In it, you should |
|
84 find something like this: |
|
85 |
|
86 %{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \ |
|
87 %{!ggdb:-lc} %{ggdb:-lg}} |
|
88 |
|
89 changing it to |
|
90 |
|
91 %{!shared: %{p:-lgmon} %{pg:-lgmon} %{!ggdb:-lc} %{ggdb:-lg}} |
|
92 |
|
93 should keep gcc from adding -lieee to the link command. You can find |
|
94 the location of the specs file by running the command gcc -v. |
|
95 |
|
96 My system doesn't have g77 |
|
97 -------------------------- |
|
98 |
|
99 A binary release of g77 that should work with gcc 2.7.2 is available |
|
100 from sunsite.unc.edu in the directory /pub/Linux/devel/lang/fortran. |
|
101 There is also a Debian package for g77. |
|
102 |
2596
|
103 Upgrading your compiler and libraries |
|
104 ------------------------------------- |
|
105 |
2598
|
106 Installing libg++ on a Linux system is not as simple as it should be, |
|
107 because libg++ shares some basic I/O code with the Linux C library, |
|
108 and they must be compatible. You should get and read the release |
|
109 notes for the compiler and libraries. |
|
110 |
|
111 If you have comments or suggestions for this document, please contact |
|
112 bug-octave@bevo.che.wisc.edu. |
2593
|
113 |
|
114 John W. Eaton |
|
115 jwe@bevo.che.wisc.edu |
|
116 University of Wisconsin-Madison |
|
117 Department of Chemical Engineering |
|
118 |
2598
|
119 Tue Dec 17 13:24:52 1996 |