Thread: Solaris install - "cannot compute sizeof (off_t)" error - readline issue?
I'm trying to install postgres 8.4.5 on Solaris 10 (Sun): ./configure --prefix=/app/postgres-8.4.5 \ --with-libs=/app/usr/local/lib \ --with-includes=/app/usr/local/include (lib & include specified because I have readline installed in a non-standard location. Yay.) This fails with this error: checking size of off_t... configure: error: cannot compute sizeof (off_t) The config.log contains this (I'm not sure how much to include here): conftest.c:71: warning: left shift count >= width of type conftest.c:71: warning: left shift count >= width of type conftest.c:73: error: size of array `off_t_is_large' is negative ...and this interesting tidbit, which I just discovered: ld.so.1: conftest: fatal: libreadline.so.5: open failed: No such file or directory Per alvherre's suggestion on irc, I tried this: ./configure --prefix=/app/postgres-8.4.5 \ --with-libs=/app/usr/local/lib \ --with-includes=/app/usr/local/include \ --disable-largefile It failed with the same command-line error message as above. config.log contains the same error about readline: ld.so.1: conftest: fatal: libreadline.so.5: open failed: No such file or directory The only seemingly-relevant thing I found on google was this: http://www.xinotes.org/notes/note/747/ I don't have the right privs on this server to try that solution, so I tried running configure --without-readline JFK, and that was successful. But I really want readline. ;) Any ideas what the problem is? Thanks! gabrielle
Re: Solaris install - "cannot compute sizeof (off_t)" error - readline issue?
From
Gary Chambers
Date:
Gabrielle, > I'm trying to install postgres 8.4.5 on Solaris 10 (Sun): > ./configure --prefix=/app/postgres-8.4.5 \ > --with-libs=/app/usr/local/lib \ > --with-includes=/app/usr/local/include First and foremost, I would highly recommend that you use the Sun compiler to build it. Jignesh Shah had (prior to his departure from the once-great Sun Microsystems) written a couple of informative articles that provided the most effective options to use depending on your architecture. Google his name and postgresql and I'm fairly certain you'll get some good hits. I believe he's working for VMware, so if you're on an x86 system, he may have even more up-to-date information building with the Sun compiler. It's been many months since I've had to deal with compiling software on Solaris, but IIRC I had to pass a few options in CFLAGS before calling configure. I also had a completely clean environment (i.e. very minimal PATH, no LD_LIBRARY_PATH). In the case of LD_LIBRARY_PATH, check the output of crle to see if the admins have added anything to the system runtime link path. Try: CC=/your/path/to/suncc CFLAGS="-I/your/non-standard/include -L/your/non-standard/lib -R/your/non-standard/lib ..." \ ./configure ... -- Gary Chambers /* Nothing fancy and nothing Microsoft! */
Re: Solaris install - "cannot compute sizeof (off_t)" error - readline issue?
From
John R Pierce
Date:
On 10/22/10 11:15 AM, gabrielle wrote: > I'm trying to install postgres 8.4.5 on Solaris 10 (Sun): > ./configure --prefix=/app/postgres-8.4.5 \ > --with-libs=/app/usr/local/lib \ > --with-includes=/app/usr/local/include > > (lib& include specified because I have readline installed in a > non-standard location. Yay.) > > This fails with this error: > checking size of off_t... configure: error: cannot compute sizeof (off_t) I got that error building on a unix platform that was missing some library or another, the actual error had *nothing* to do with off_t, rather, the off_t test module failed on this library load. in fact it may have been readline. here's what *I* used to compile on solaris x86 with readline... first, I built this in my old account, in $HOME/src I untarred zlib 1.2.5, readline 6.1, and postgres 8.4.5 i compiled zlib and readline first, telling it to put the target in $HOME as I only used the static link libraries to reduce dependencies for my compiled postgres... I specifically built readline and zlib as static (.a) libraries only, not as shared (.so) libraries. then, to compile postgres, I used this ./configure.. CC=/opt/SUNWspro/bin/cc CFLAGS="-xarch=amd64" ./configure --prefix=/opt/pgsql-84 --with-libs=$HOME/lib \ --with-includes=$HOME/include and then ran gmake && gmake check && su "gmake install" gmake is in /usr/sfw/bin ... I also had /usr/ccs/bin in my path but I'm not sure this is important or not (ld is in there) note, I'm using Sun Studio 11 (Sun cc 5.8) here. Sun-err-Oracle Studio 12 works just fine, too.
> First and foremost, I would highly recommend that you use the Sun > compiler to build it. ... > Try: > CC=/your/path/to/suncc CFLAGS="-I/your/non-standard/include > -L/your/non-standard/lib -R/your/non-standard/lib ..." \ > ./configure ... This did the trick! Thank you *very* much. (Sorry for the delayed reply - I had to get the compiler installed on this machine [it's not mine] and then I was at PgWest all last week.) gabrielle