SGI: Development

Postgresql info

I've been trying to get postgresql working on IRIX. It compiles successfully with MIPSPRO, but it comes up with a variety of errors, with the end result being that initdb will not complete. With version 9.1.9, it fails due to a syntax error in the sql commands to init the template database. With 9.0.9, it has a problem with one of the .so files. I didn't try to build a 9.2, because the last time I tried to do this, I had the syntax error problem with all of the 9.2 versions I tried.

However, all is not lost. If one uses the version of gcc off the sgi freeware distro, it works perfectly (or at least version 9.2.4 does (just use CC=gcc for gcc(assuming that /usr/freeware/bin is on your path) and LIBS="-lpthread"(this allows it to pass the thread safety test, which fails unless this is declared)). (I'm sure it will also work with the nekoware gcc, but I was feeling lazy, and I just wanted click and go convenience) So, the point of this post is if you are compiling a modern postgresql, and are tearing your hair out, and cursing at the computer, the problem isn't the code, it's the compiler.

What's going wrong? I'm guessing that since MIPSPRO has better optimization, that is causing the problem. Now, I'm not a computer engineer (nor do I play one on TV) but that would be my best guess as to a problem. If anyone wants to take a look, and chime in with a fix, go ahead. But, I feel that just using gcc is a good enough work around.

_________________
SGI: :Fuel: IBM: OpenPower 710; RS/6000 7046-B50 DEC: VaxStation 4000/90; Personal Workstation 500AU; Dec 3000/500; DECSERVER 200/MC
Back when I wanted it, I grabbed the latest Postgres in nekoware and used that and it worked just fine.
nekoware is mostly built with MIPS Pro due to issues mentioned in the wiki (possibly more than once).

Its not so much about optimization but a minor incompatibility between gcc and MIPS Pro code when mixed. gcc probably can do better optimizations by now.

R.

_________________
死の神はりんごだけ食べる

開いた括弧は必ず閉じる -- あるプログラマー

:Tezro: :Tezro: :Onyx2R: :Onyx2RE: :Onyx2: :O3x04R: :O3x0: :O200: :Octane: :Octane2: :O2: :O2: :Indigo2IMP: :PI: :PI: :1600SW: :1600SW: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x Mac, 3 x SUN, Alpha DS20E, Alpha 800 5/550, 3 x RS/6000, Amiga 4000 VideoToaster, Amiga4000 -030, 733MHz Sam440 AmigaOS 4.1 update 1. Tandem Himalaya S-Series Nonstop S72000 ServerNet.

Sold: :Indy: :Indy: :Indy: :Indigo:

Cortex ---> http://www.facebook.com/pages/Cortex-th ... 11?sk=info
Minnie ---> http://www.facebook.com/pages/Minnie-th ... 02?sk=info
Book ----> http://pymblesoftware.com/book/
Github ---> https://github.com/pymblesoftware
Visit http://www.pymblesoftware.com
Search for "Pymble", "InstaElf", "CryWhy" or "Cricket Score Sheet" in the iPad App store or search for "Pymble" or "CryWhy" in the iPhone App store.
The nekoware postgresql is 8-something (I think) and works great. I used it for several years (even updated once or twice) with a variety of applications that were used on a daily bassis by a group of ten or twenty people. I also compiled (MIPSPro) a newer version of postgresql a few times and that worked also but wasn't really worth the effort. Everything worked the same, what the heck ..

About "modern", kind of funny that you'd be happy with a totally antique compiler (gcc has been considerably improved over the years) while struggling to get a "modern" version of a program that hasn't changed much. Up to you, but fifty cents says the nekoware 8-something postgresql kicks ass over your 9-something compiled with an antique gcc.

Plus all the caveats which Pymble just mentioned ... it's probably fun but most likely you're just bringing yourself grief.

_________________
waiting for flight 1203 ...
This is an experimental setup, I wanted to see if it worked, before I installed the nekoware compiler. I'm also experimenting with replication, so the version has to be the same major version as the one on my main IBM server for it to work.

_________________
SGI: :Fuel: IBM: OpenPower 710; RS/6000 7046-B50 DEC: VaxStation 4000/90; Personal Workstation 500AU; Dec 3000/500; DECSERVER 200/MC
andarm16 wrote:
This is an experimental setup, I wanted to see if it worked, before I installed the nekoware compiler. I'm also experimenting with replication, so the version has to be the same major version as the one on my main IBM server for it to work.

A caveat : you can't safely share libraries between MIPSPro binaries and gcc binaries. So using the rest of nekoware with a gcc postgresql is going to be a less than salutary situation. At the very least you will want to also compile the libraries which postgresql requires with gcc - krb5, libiconv, libxml2, openssl, readline, zlib. Then you can't safely use those with any other nekoware applications. Those are pretty common libraries.

So if you don't want to use any other nekoware, go for it. (Or you could do a static postgresql.)

Generally, on Irix, you want to avoid gcc. This has been discussed to death elsewhere here.

_________________
waiting for flight 1203 ...
hamei wrote:
andarm16 wrote:
This is an experimental setup, I wanted to see if it worked, before I installed the nekoware compiler. I'm also experimenting with replication, so the version has to be the same major version as the one on my main IBM server for it to work.

A caveat : you can't safely share libraries between MIPSPro binaries and gcc binaries. So using the rest of nekoware with a gcc postgresql is going to be a less than salutary situation. At the very least you will want to also compile the libraries which postgresql requires with gcc - krb5, libiconv, libxml2, openssl, readline, zlib. Then you can't safely use those with any other nekoware applications. Those are pretty common libraries.

So if you don't want to use any other nekoware, go for it. (Or you could do a static postgresql.)

Generally, on Irix, you want to avoid gcc. This has been discussed to death elsewhere here.


I've recompiled it with the 4.7.1 included in Nekoware, and It seems to work. I do have mixed gcc and nekoware but, as the purpose of this is solely to serve as a toy, seems to work is good enough for me. I might clone the /data directory from my GCC compiled postgres, and try it with a mipspro compiled version, but since initdb was failing with a syntax error, mipspro might be breaking the postgres parser.

I only posted this here as a kind of howto, if anyone else wanted a similar environment, they'd have a place to look for instructions

_________________
SGI: :Fuel: IBM: OpenPower 710; RS/6000 7046-B50 DEC: VaxStation 4000/90; Personal Workstation 500AU; Dec 3000/500; DECSERVER 200/MC
andarm16 wrote:
I only posted this here as a kind of howto, if anyone else wanted a similar environment, they'd have a place to look for instructions


We also have a wiki.

R.

_________________
死の神はりんごだけ食べる

開いた括弧は必ず閉じる -- あるプログラマー

:Tezro: :Tezro: :Onyx2R: :Onyx2RE: :Onyx2: :O3x04R: :O3x0: :O200: :Octane: :Octane2: :O2: :O2: :Indigo2IMP: :PI: :PI: :1600SW: :1600SW: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x Mac, 3 x SUN, Alpha DS20E, Alpha 800 5/550, 3 x RS/6000, Amiga 4000 VideoToaster, Amiga4000 -030, 733MHz Sam440 AmigaOS 4.1 update 1. Tandem Himalaya S-Series Nonstop S72000 ServerNet.

Sold: :Indy: :Indy: :Indy: :Indigo:

Cortex ---> http://www.facebook.com/pages/Cortex-th ... 11?sk=info
Minnie ---> http://www.facebook.com/pages/Minnie-th ... 02?sk=info
Book ----> http://pymblesoftware.com/book/
Github ---> https://github.com/pymblesoftware
Visit http://www.pymblesoftware.com
Search for "Pymble", "InstaElf", "CryWhy" or "Cricket Score Sheet" in the iPad App store or search for "Pymble" or "CryWhy" in the iPhone App store.
andarm16 wrote:
I only posted this here as a kind of howto, if anyone else wanted a similar environment, they'd have a place to look for instructions

Thank you for the effort and information but the reality of the situation is, it would be a lot more helpful to get postgresql 9 running in a nekoware environment. A howto of mixing gcc applications with MIPSPro applications is a how that one doesn't want to to. Seriously.

_________________
waiting for flight 1203 ...
hamei wrote:
A caveat : you can't safely share libraries between MIPSPro binaries and gcc binaries.

This is true only for C++ code, you can mix C code without any problems, so:

MIPSpro C program + GCC C libraries = ok
MIPSpro C++ program + GCC C libraries = ok
GCC C++ program + MIPSpro C libraries = ok
MIPSPro C++ program + GCC C++ libraries = not ok
GCC C++ program + MIPSpro C++ libraries = not ok

This is because MIPSpro and GCC use different function naming for C++ code, but the naming of C functions is the same.

The optimizer in GCC 4.7.1 is at least as good as the one in MIPSpro (and actually substantially better on some numerical code I tried it on, YMMV), so there's really nothing bad about compiling a C library with GCC anymore :)

There were incompatibilities with passing structures smaller than 16 bytes, but that was in GCC 3.3, which is ancient. I haven't experienced this problem with 4.7.1.
ShadeOfBlue wrote:
This is true only for C++ code, you can mix C code without any problems, so:

MIPSpro C program + GCC C libraries = ok
MIPSpro C++ program + GCC C libraries = ok
GCC C++ program + MIPSpro C libraries = ok
MIPSPro C++ program + GCC C++ libraries = not ok
GCC C++ program + MIPSpro C++ libraries = not ok

Thanks for the clarification, Shade ... for me, it's simple rules for simple minds : don't mix the two :P

Doesn't much matter in this case tho, looks like the commuuuuuunity got its greasy paws into Postgresql 9.2.4 ->
Code:
checking thread safety of required library functions... no
configure: error: thread test program failed
This platform is not thread-safe.  Check the file 'config.log' or compile
and run src/test/thread/thread_test for the exact reason.
Use --disable-thread-safety to disable thread safety.

Oh right, I forgot that Irix isn't thread-safe.

Code:
cc-1020 cc: ERROR File = informix.c, Line = 97
The identifier "CDECIMALTYPE" is undefined.

if (risnull(CDECIMALTYPE, (char *) arg1) || risnull(CDECIMALTYPE, (char *) arg2))
^

cc-1020 cc: ERROR File = informix.c, Line = 138
The identifier "CDECIMALTYPE" is undefined.

rsetnull(CDECIMALTYPE, (char *) result);
^

cc-1020 cc: ERROR File = informix.c, Line = 204
The identifier "CDECIMALTYPE" is undefined.

rsetnull(CDECIMALTYPE, (char *) np);
^

cc-1020 cc: ERROR File = informix.c, Line = 205
The identifier "CSTRINGTYPE" is undefined.

if (risnull(CSTRINGTYPE, cp))
^

cc-1020 cc: ERROR File = informix.c, Line = 251
The identifier "CDECIMALTYPE" is undefined.

rsetnull(CDECIMALTYPE, (char *) np);
^

cc-1020 cc: ERROR File = informix.c, Line = 252
The identifier "CDOUBLETYPE" is undefined.

if (risnull(CDOUBLETYPE, (char *) &dbl))
^

cc-1020 cc: ERROR File = informix.c, Line = 273
The identifier "CDECIMALTYPE" is undefined.

rsetnull(CDECIMALTYPE, (char *) np);
^

cc-1020 cc: ERROR File = informix.c, Line = 274
The identifier "CINTTYPE" is undefined.

if (risnull(CINTTYPE, (char *) &in))
^

cc-1020 cc: ERROR File = informix.c, Line = 295
The identifier "CDECIMALTYPE" is undefined.

rsetnull(CDECIMALTYPE, (char *) np);
^

cc-1020 cc: ERROR File = informix.c, Line = 296
The identifier "CLONGTYPE" is undefined.

if (risnull(CLONGTYPE, (char *) &lng))
^

cc-1020 cc: ERROR File = informix.c, Line = 387
The identifier "CSTRINGTYPE" is undefined.

rsetnull(CSTRINGTYPE, (char *) cp);
^

cc-1020 cc: ERROR File = informix.c, Line = 388
The identifier "CDECIMALTYPE" is undefined.

if (risnull(CDECIMALTYPE, (char *) np))
^

12 errors detected in the compilation of "informix.c".


Stupid fucks ... there goes PostgreSQL, down the toilet. Use whatever you like to build it, andarm16, it's garbage now anyhow. Irix "isn't thread-safe" ... I'm surprised those idiots can remember to breathe.

_________________
waiting for flight 1203 ...
hamei wrote:
[
Doesn't much matter in this case tho, looks like the commuuuuuunity got its greasy paws into Postgresql 9.2.4 ->
Code:
checking thread safety of required library functions... no
configure: error: thread test program failed
This platform is not thread-safe.  Check the file 'config.log' or compile
and run src/test/thread/thread_test for the exact reason.
Use --disable-thread-safety to disable thread safety.

Oh right, I forgot that Irix isn't thread-safe.


They probably just failed at implementing the test. Maybe there's just a -lpthread missing or at the wrong place in the command line. It's almost as if they knew that would happen, seeing that they appear to have spent more time with that verbose error message than the test itself..

Since we're talking about C++ libraries: Has anyone considered writing a simple program that re-links a gcc c++ library with the symbols just re-mangled MIPSPro-style? Maybe it's even possible to have the symbols available in both mangling styles in the same library.
canavan wrote:
They probably just failed

There. Fixed that for you.

Fucking idiots is what they are. If this were Tuxcart or a little utility to draw ascii art or some cute thing to play a sound when you click the dumpster, okay. But a "robust, capable, scalable, reliable database server" and the fools can't even get the most elementary steps right ? They don't bother to test for anything beyond three varieties of their beloved home-made crap yet call it "cross-platform" ? Irix is not thread-safe ? What a crock.

I don't care if it's a Lamborghini, if both front wheels fall off leaving the driveway all that fine Corinthian leather inside is pointless. This project is now officially a P.o.S.

Another one bites the dust :(

_________________
waiting for flight 1203 ...