Subject: Installation / Linux

From: [email-masked] (Karl Eichwalder )
Date: Wed, 24 Nov 93 1:40:08 MET

hi !

i've tried to install postgres 4.0.1, taking the archive which is available on
the the known Linux-servers (tsx-11, sunsite); in this archive your will find a
config.mk.linux.

my configuration:
~~~~~~~~~~~~~~~~~
hardeware nothing special: 486DX33, 16mb ram, 8514/A, wd8013.

software: Linux v0.99pl13q, gcc 2.4.5, and the libs, which are provided from
Slackware 1.10.

now the problems;
~~~~~~~~~~~~~~~~~
it isn't possible for me to compile the programm. preparing the stuff as 
written in the `Postgres Installation Instructions - 4.0.1' (user
postgres, tcsh, ln -s ~/postgres /usr/postgres, moveme.src) and starting the
compilation inside the emacs, i receive some error messages:

$ /usr/bin/cb: No such file or directory
$ cpp: output pipe has been closed

until now i've nowhere found a `cb' for LinuX; so i've just eleminated this
command in `Gen_accessors.sh'; it seems to work so far.

but there are other problems:

$ Executing 'Make everything'...
$ make[1]: Entering directory `/mnt/data/pub/postgres'
$ linking headers
$ generating plannodes.gen
$ ...
$ creating inh.c
$ compiling lib/Gen/inh.c
$ inh.c:37: `T_' undeclared here (not in a function)
$ inh.c:37: initializer element for `_NodeInfo.ni_parent' is not constant
$ make[1]: *** [/mnt/data/pub/postgres/obj.linux/lib/Gen/inh.o] Error 1
$ make[1]: Leaving directory `/mnt/data/pub/postgres'
$ done
$ make[1]: Entering directory `/mnt/data/pub/postgres'

some warnings are following...perhaps not important.

unfortunatly i'm not a C guru. --- how can i convince my compiler to accept
the code?

and in the end it isn't possible to build postgres :-( of course.

hope, someone will help me. - thx.

please excuse my bad english...

-- 
|Karl Eichwalder			|kleio-Projekt
[email-masked]			|MPI fuer Geschichte Goettingen
|					|
|GWDG					|Gesellschaft fuer wissenschaftliche
|					|Datenverarbeitung - Goettingen

---

From: Kai Petzke <[email-masked]>
Date: Wed, 24 Nov 1993 14:41:42 +0100 (MET)

> the the known Linux-servers (tsx-11, sunsite); in this archive your will find a

Postgres is even available at the ftp server of your site: ftp.gwdg.de,
directory /pub/linux/linux2/databases/postgres.

> $ cpp: output pipe has been closed

A cb program (which takes C text as input and formats it while
piping it through) seems not to be available for Linux.  But it
might be in the future, so, instead of deleting the reference to
cb, I included the following hint in postgres.README:

	If you don't have cb ("beautifies" C programmes - does nothing but
	change the spacing of its input), make it a shell script with the
	single line: cat

> $ make[1]: Entering directory `/mnt/data/pub/postgres'

This problem arises again and again.  It is caused by Linux distributions,
which contain outdated binaries.  Typically, awk and sed are the problems.
Again, an excerpt from postgres.README:

	You need tcsh, a pwd executable, the getopt command, Berkeley Yacc,
	flex, cb, and bug-fixed versions of awk (2.14 or newer) and sed
	(1.13 or newer). You can find out awk's version with "awk -V" or
	"awk -W version". If you get an error message as answer, you are
	very likely to have an old version ... Check "sed -V" as well.

For several people before you, this fixed this particular problem.

But thank you for being specific about your compile errors - many
people forget to include the output of the failed compile.

Kai Petzke
[email-masked]

---

From: [email-masked] (Karl Eichwalder )
Date: Wed, 24 Nov 93 21:35:11 MET

thx for answering

> directory /pub/linux/linux2/databases/postgres.

i've taken it from there of course; but i thought it might be helpfull for you to know, that this archive came from sunsite resp. tsx-11 (gwdg.de is a mirror site).

> cb, I included the following hint in postgres.README:

a better solution (source code unchanged).

> 	flex, cb, and bug-fixed versions of awk (2.14 or newer)

indeed, i have been using gawk 2.13p2...

...wasn't possible for me to compile gawk 2.15.x...

so now i'm using gawk 2.14A (tsx-11 --- also available on the mirror site gwdg.de, of course). --- :-)))

and sed 2.03.

> For several people before you, this fixed this particular problem.

seem to work (still are lot of warnings) but:

$ compiling storage/file/fd.c
$ fd.c: In function `AssertLruRoom':
$ fd.c:382: `OPEN_MAX' undeclared (first use this function)
$ fd.c:382: (Each undeclared identifier is reported only once
$ fd.c:382: for each function it appears in.)
$ fd.c: In function `fileNameOpenFile':
$ fd.c:539: `OPEN_MAX' undeclared (first use this function)
$ fd.c: In function `AllocateFile':
$ fd.c:800: `OPEN_MAX' undeclared (first use this function)
$ make[1]: *** [/mnt/data/pub/postgres/obj.linux/storage/file/fd.o] Error 1
$ make[1]: Leaving directory `/mnt/data/pub/postgres'
$ done

the first `Error', that occur :-( what is to do now?

BTW i'm missing `make clean' ;-) --- is there something simular?

---

From: [email-masked] (Kai Petzke)
Date: Thu, 25 Nov 93 0:47:26 MET

I CC: - ed my last reply to Karl Eichwalder also to the postgres
mailing list, but something apparently went wrong.  Let me have
another try, that anybody can see my reply - it is not very
interesting for non Linux people, though:

Hi,

> i've taken it from there of course; but i thought it might be helpfull for you to know, that this archive came from sunsite resp. tsx-11 (gwdg.de is a mirror site).

Ok, ok, it was not a flame.  Luckily, all the postgres for Linux versions
on the various ftp servers around are identical.

> $ make[1]: Leaving directory `/mnt/data/pub/postgres'

The problem is the macro MAXFILES, which is defined as:

	#define MAXFILES	(NOFILE - RESERVE_FOR_LD)

in storage/file/fd.c.

NOFILE is defined in /usr/include/sys/param.h or <sys/param.h>:

	#define NOFILE		OPEN_MAX

OPEN_MAX is be defined in <linux/limits.h> (kernel 99p13r):

	#define OPEN_MAX	256

It is the maximum number of open file descripters a process may have.

At least with my include files, the following happens:

<sys/param.h> includes <limits.h>.  <limits.h> then includes <posix1_lim.h>,
but only if __USE_POSIX is set, which includes <linux/limits.h>.

This is likely to be a bug with the header files.

Quick and dirty recovery: include

	#include <linux/limits.h>

near the top of /usr/include/sys/param.h.

Kai