Building Software Packages for Linux: Troubleshooting

prev-8720894 next-6371792 toc-6593122

If xmkmf and/or make succeeded without errors, you may proceed to the next section. However, in « real life », few things work right the first time. This is when your resourcefulness is put to the test.

4.1 Link Errors

  • Suppose make fails with a Link error: -lX11: No such file or directory, even after xmkmf has been invoked. This may mean that the imake file was not set up properly. Check the first part of the Makefile for lines such as:
    
    LIB=            -L/usr/X11/lib
    INCLUDE=        -I/usr/X11/include/X11
    LIBS=           -lX11 -lc -lm
    

    The -L and -I switches tell the compiler and linker where to look for the library and include files, respectively. In this example, the X11 libraries should be in the /usr/X11/lib directory, and the X11 include files should be in the /usr/X11/include/X11 directory. If this is incorrect for your machine, make the necessary changes to the Makefile and try the make again.

  • —————————————————————–
  • In a very few cases, running ldconfig as root may be the solution: # /etc/ldconfig -n /lib will update the shared library symbolic links. This should not be necessary under normal circumstances.
  • —————————————————————–
  • Yet another thing to try if xmkmf fails is the following script:
    
             make -DUseInstalled -I/usr/X386/lib/X11/config
    
  • —————————————————————–
  • Sometimes the source needs the older release X11R5 libraries to build. If you have the R5 libs in /usr/X11R6/lib (you were given the option of having them when first installing Linux), then you need only ensure that you have the links that the software needs to build. The R5 libs are named libX11.so.3.1.0, libXaw.so.3.1.0, and libXt.so.3.1.0. You generally need links, such as libX11.so.3 -> libX11.so.3.1.0. Possibly the software will also need a link of the form libX11.so -> libX11.so.3.1.0. Of course, to create a « missing » link, use the command ln -s libX11.so.3.1.0 libX11.so, as root.

4.2 Other Problems

  • An installed Perl or shell script gives you a No such file or directory error message. In this case, check the file permissions to make sure the file is executable and check the file header to ascertain whether the shell or program invoked by the script is in the place specified. For example, the scrip may begin with:
    
    #!/usr/local/bin/Perl
    

    If Perl is in fact installed in your /usr/bin directory instead of the /usr/local/bin one, then the script will not run. Edit and correct the script file header in such a case.

  • —————————————————————–
  • Some X11 software requires the Motif libraries to build. The standard Linux distributions do not have the Motif libraries installed, and at present Motif costs an extra $100-$200 (though the freeware Lesstif may also work in many cases). If you need Motif to build a certain package, but lack the Motif libraries, it may be possible to obtain statically linked binaries. Static linking incorporates the library routines in the binaries themselves. This results in much larger binary files, but the code will run even on systems lacking the libraries.

4.3 Where to go for more help

In my experience, about 25% of applications build « right out of the box ». Another 50% or so can be persuaded to build with an effort ranging from trivial to herculean. That still means a significant number of packages will not build no matter what. Even then, the Intel ELF and/or a.out binaries for these might possibly be found at Sunsite, the TSX-11 archive or other places. Perhaps the author of the software can supply the binaries compiled for your particular flavor of machine.

Note that if you obtain precompiled binaries, you will need to check for compatibility with your system:

  • The binaries must run on your hardware (i.e., Intel x86).
  • The binaries must be compatible with your kernel (i.e., a.out or ELF).

If all else fails, you may find help in the appropriate newsgroups, such as comp.os.linux.x or comp.os.linux.development. Once in a while, though, you are just plain out of luck, but hey, it was fun trying.

prev-8720894 next-6371792 toc-6593122

READ  Linux On Your Desktop: Multimedia LG #63