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 |
2647
|
44 Please note that I am NOT recommending that everyone running Linux and |
|
45 using Octave should install the same versions of the libraries and |
|
46 compilers that I have. I am simply saying that the versions listed |
|
47 above work for me. Other version combinations may also work, but I |
|
48 don't have time to map out all the possibilities... |
2621
|
49 |
2663
|
50 Craig Earls <cpearls@ziplink.net> reports that the order of installing |
|
51 libc and lig++ is important. If libg++ is installed *first*, Octave |
|
52 will work, but if the libraries are installed in the reverse orfer, |
|
53 Octave fails. The conflict apparently arises because libc and libg++ |
|
54 shared libraries both use libio, however no one seems to be able to |
|
55 provide a clear explanation of exactly what is happening. |
|
56 |
2596
|
57 Octave won't even compile |
|
58 ------------------------- |
2593
|
59 |
|
60 If you can't compile Octave, you should first check to see that your |
|
61 compiler and header files are properly installed. Do you have |
|
62 multiple versions of the g++ include files on your system? Are you |
2596
|
63 sure that your copy of g++ is finding the right set? You can find out |
|
64 by compiling a simple C++ program with -v: |
|
65 |
|
66 bash$ cat foo.cc |
|
67 #include <iostream.h> |
2663
|
68 int main (void) { cerr << "yo\n"; return 0; } |
2596
|
69 |
|
70 bash$ g++ -v foo.cc |
|
71 gcc -v foo.cc -lg++ -lstdc++ -lm |
|
72 Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2/specs |
|
73 gcc version 2.7.2 |
|
74 /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -lang-c++ -v -undef ... |
|
75 #include "..." search starts here: |
|
76 #include <...> search starts here: |
|
77 /usr/lib/g++-include |
|
78 /usr/local/include |
|
79 /usr/i486-linux/include |
|
80 /usr/lib/gcc-lib/i486-linux/2.7.2/include |
|
81 /usr/include |
|
82 End of search list. |
|
83 ... |
|
84 |
2597
|
85 If the location of the correct set of include files is not listed in |
|
86 the search path, then you might be able to fix that with a symbolic |
|
87 link. However, if your version of libg++ was not compiled with your |
|
88 current version of gcc, you are likely to run into more trouble. |
2596
|
89 |
2598
|
90 The linker can't find -lieee |
|
91 ---------------------------- |
|
92 |
|
93 This can happen because your libraries don't match your version of |
|
94 gcc. Some recent Linux distributions don't include a libieee.a file |
|
95 because IEEE support is now the default and the library is no longer |
|
96 needed, but the gcc specs file still adds -lieee to the linker command |
|
97 if gcc is invoked with the -mieeefp flag. I believe that you should |
|
98 be able to fix this by editing the gcc specs file. In it, you should |
|
99 find something like this: |
|
100 |
|
101 %{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \ |
|
102 %{!ggdb:-lc} %{ggdb:-lg}} |
|
103 |
|
104 changing it to |
|
105 |
|
106 %{!shared: %{p:-lgmon} %{pg:-lgmon} %{!ggdb:-lc} %{ggdb:-lg}} |
|
107 |
|
108 should keep gcc from adding -lieee to the link command. You can find |
|
109 the location of the specs file by running the command gcc -v. |
|
110 |
2601
|
111 If you can't edit the gcc specs file for some reason, another solution |
|
112 that should work is to create an empty libieee.a file in the Octave |
|
113 src directory using the command: |
|
114 |
|
115 ar cq libieee.a |
|
116 |
2608
|
117 NOTE: you should fix this problem (either by editing the specs file or |
|
118 by creating the library) *before* running configure and compiling |
|
119 Octave. Otherwise, configure may incorrectly determine that your |
|
120 system doesn't have support for some IEEE math functions. |
|
121 |
2598
|
122 My system doesn't have g77 |
|
123 -------------------------- |
|
124 |
|
125 A binary release of g77 that should work with gcc 2.7.2 is available |
|
126 from sunsite.unc.edu in the directory /pub/Linux/devel/lang/fortran. |
|
127 There is also a Debian package for g77. |
|
128 |
2600
|
129 Problems with g77 on Debian 1.2 systems (and possibly others) |
|
130 ------------------------------------------------------------- |
|
131 |
|
132 The location of the compiler binaries has changed, so the g77 0.5.18 |
|
133 package can not be used without modification. The problem is that the |
|
134 Debian package was built for gcc 2.7.2 and not 2.7.2.1 and the f771 |
|
135 backend is installed in the wrong directory. |
|
136 |
|
137 Version 0.5.19 of g77 has just been released. A fixed Debian package |
|
138 may be made available soon. Until then, you can make things work by |
|
139 copying f771 and libf2c.a from /usr/lib/gcc-lib/i486-linux/2.7.2 to |
|
140 /usr/lib/gcc-lib/i486-linux/2.7.2.1. |
|
141 |
2596
|
142 Upgrading your compiler and libraries |
|
143 ------------------------------------- |
|
144 |
2598
|
145 Installing libg++ on a Linux system is not as simple as it should be, |
|
146 because libg++ shares some basic I/O code with the Linux C library, |
|
147 and they must be compatible. You should get and read the release |
|
148 notes for the compiler and libraries. |
|
149 |
2601
|
150 If you decide to install versions of the libraries that are older (or |
|
151 newer) than the ones you already have, you should follow the |
|
152 directions in the release notes very carefully. |
|
153 |
2993
|
154 I/O in dynamically loaded .oct files doesn't work |
|
155 ------------------------------------------------- |
|
156 |
|
157 If Octave prints things like `%.-1e' instead of numbers when you use a |
|
158 dynamically linked .oct file, you probably need to create shared |
|
159 versions of the Octave libraries. To do that, configure Octave with |
|
160 --enable-shared. |
|
161 |
2601
|
162 |
2598
|
163 If you have comments or suggestions for this document, please contact |
|
164 bug-octave@bevo.che.wisc.edu. |
2593
|
165 |
|
166 John W. Eaton |
|
167 jwe@bevo.che.wisc.edu |
|
168 University of Wisconsin-Madison |
|
169 Department of Chemical Engineering |
|
170 |
2993
|
171 Mon May 19 23:13:35 1997 |