DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Previous Next Contents

37. FAQ Linux-PostgreSQL - Compiling PostgreSQL

=====================================================

Frequently Asked Questions (FAQ) for PostgresSQL V6.0 Linux Specific TO BE READ IN CONJUNCTION WITH THE NORMAL FAQ

=====================================================

last updated: Wed Jan 29 20:16:00 GMT 1997

current maintainer: Andrew C.R. Martin ( martin@biochem.ucl.ac.uk)

original author: Andrew C.R. Martin ( martin@biochem.ucl.ac.uk)

37.1 What changes do I need to make to src/Makefile.global or src/Makefile.custom?

These changes are most easily made by running the customize shell script in the src directory which will write a Makefile.custom for you.

If you do it by hand, you *must* set the following variable: PORTNAME= linux

You will also need to change the following to match your own installation: POSTGRESDIR

If you switch on the USE_TCL option, you will need to set these: TCL_INCDIR= TCL_LIBDIR= TCL_LIB= TK_INCDIR= TK_LIBDIR= TK_LIB= X11_INCDIR= X11_LIBDIR= X11_LIB=

On my Slackware3.0 system, these are: TCL_INCDIR= /usr/include/tcl TCL_LIBDIR= /usr/lib TCL_LIB= -ltcl TK_INCDIR= /usr/include/tcl TK_LIBDIR= /usr/lib TK_LIB= -ltk X11_INCDIR= /usr/include/X11 X11_LIBDIR= /usr/X386/lib X11_LIB= -lX11

You may also make any other changes you need as documented in the INSTALL file and in Makefile.global

37.2 Why do I get problems with missing libreadline?

Linux systems generally don't come with the GNU readline library installed. Either ensure you do not activate the readline options in src/Makefile.global or src/Makefile.custom or install the GNU readline library.

Note that Debian Linux (like FreeBSD) does come with readline installed.

37.3 REDHAT Why do I get problems with missing libdl and dlfcn.h?

The libdl library is used for dynamic linking of user-supplied functions at run-time. For some reason this library was missed out from the Redhat distribution. It seems that the latest Redhat 4.0 (Colgate) fixes this.

RedHat now have a new ld.so RPM package on their FTP site. Simply grab:

ftp://ftp.redhat.com/pub/redhat/devel/i386/RedHat/RPMS/ld.so-1.7.14-4.i386.rpm

Install the RPM file in the usual way and off you go!

There has been one report of a corrupted system resulting from programs accessing these libraries while updating them (not altogether surprising). Consequently it is a good idea to reboot the system before installing the new libraries and to have as little running as possible during this upgrade. Going into single-user mode is probably a good idea!

If you want to do it the hard way, you can obtain the library and the header file from:

ftp://tsx-11.mit.edu/pub/linux/packages/GCC/ld.so-1.7.14.tar.gz

Alternatively, you may find precompiled binaries in distributions/debian/buzz/binary-i386/base/ld.so-1.7.14-4.deb on the same site, or follow the instructions given for question 1.2 for correcting the same error with early releases of Slackware 3.1. Don't use this method unless you know what you are doing!

37.4 SLACKWARE 3.1 Why do I get problems with missing libdl and dlfcn.h?

See the answer to question 1.3. Slackware up to version 3.0 was supplied with this library and include file and they seem to be back in again in the latest versions of 3.1, but the early 3.1 releases (before 9th September 1996) had them missing and many CD-ROM versions will have been pressed from the first 3.1 releases.

There has been one report of a corrupted system resulting from programs accessing these libraries while updating them (not altogether surprising). Consequently it is a good idea to reboot the system before installing the new libraries and to have as little running as possible during this upgrade. Going into single-user mode is probably a good idea!

The easiest fix is to obtain the file ldso.tgz from the a4 disk of a more recent Slackware 3.1 distribution and unpack this file from the root (/) directory, then do

sh install/doinst.sh

to complete the installation. Follow this with

ldconfig

If you want to install manually, you must first install the file dlfcn.h in /usr/include.

Second, install the file libdl.so.1.7.14 (or whatever the latest release is) in /lib, then do:

cd /lib ln -sf libdl.so.1.7.14 libdl.so.1 ln -sf libdl.so.1 libdl.so

On some systems (depending on your GCC configuration) it may be necessary to do:

cd /usr/lib ln -sf /lib/libdl.so .

Finally

ldconfig

37.5 My compile of the backend dies complaining about the include file dlfcn.h missing

See the answer to question 1.3/1.4. Don't forget that if you are using an a.out system you must first have installed the dld package (which is not supplied with most a.out systems) to have dlfcn.h at all. See Question 1.11.

37.6 GCC complains about an ignored option -fpic

Earlier versions of GCC accepted either -fpic or -fPIC. It appears that more recent versions (V2.7.2?) require -fPIC. If you are using an ELF version of Linux, this can safely be ignored as -fPIC is the default.

You can correct this by editing src/Makefile.global and changing CFLAGS_SL

37.7 I get warnings of the form warning- cast from pointer to integer of different size

These were seen in earlier versions of Postgres95 and could safely be ignored. PostgreSQL V6.0 should compile with no warnings except those related to system header files (which can also be safely ignored).

37.8 SuSE-Linux 4.2 Where is curses and termcap?

SuSE-Linux has ncurses but not curses. Set the value of CURSES_LIB in src/Makefile.custom to -lncurses (or do this through the customize script).

SuSE-Linux has the termcap library is in /usr/lib/termcap instead of in /usr/lib. If you have a problem, you need to add the following line to src/Makefile.custom:

LDADD_BE+= -L/usr/lib/termcap

You may need to edit src/bin/psql/Makefile and comment out the change: ifeq ($(PORTNAME), linux) LD_ADD+= -ltermcap to: ifeq ($(PORTNAME), linux) LD_ADD+=

37.9 Why do I get problems with ld.so?

If you get problems with ld.so, another library required under ELF for dynamic loading, then you have messed up your installation or (more likely) upgrade of Linux.

See the answers to Question 1.3/1.4. You may need to install ld.so.x.y.z in /lib and run ldconfig.

The most recent stable release of the ld package is 1.7.14 At the time of writing, 1.8.x versions of ld are experimental.

37.10 Why do I get `yy_flush_buffer undefined' errors?

This isn't really Linux specific, but is common on older Linux installations. You must have a recent version of flex (2.5.2 or later) to compile PostgreSQL. Note that flex 2.5.3 has a bug: see Question 3.4.

37.11 How do I compile PostgreSQL on an a.out system?

First, you must install the dld library. This may be obtained from Sunsite as: Linux/libs/dld.3.2.7.tar.gz

Second, add the following line to src/Makefile.custom: LINUX_ELF= (or use the customize script)

37.12 Why does make fail with - yacc -d /disk2/PostgreSQL/src/backend/parser/gram.y make- /usr/bin/make- cannot execute binary file

This was a problem in earlier versions of Postgres95. The default for PostgreSQL is to use bison -y rather than yacc.

yacc is generally implemented as a script which invokes bison -y For some reason (certain versions of make? certain versions of bash?) make is unable to execute this script file.

To correct this, simply edit src/mk/port/postgres.mk.linux and, at the end of the file, change: # YACC = bison -y to YACC = bison -y

37.13 What are the references in X11_LIB to libsocket and libnsl in src/Makefile.global?

This was a problem in 1.08 (they are Sun Solaris specific). It is fixed in 1.09 and 6.0

37.14 DEBIAN Where is libtermcap?

Debian Linux comes without the termcap library and uses ncurses (which uses terminfo instead). There is no need to change the CURSES_LIB variable in src/bin/psql/Makefile since Debian provides a link from libncurses to libcurses (unlike SuSE-Linux --- see Question 1.8).

You may need to edit src/bin/psql/Makefile and comment out the change: ifeq ($(PORTNAME), linux) LD_ADD+= -ltermcap to: ifeq ($(PORTNAME), linux) LD_ADD+=


Previous Next Contents