IRIX and Software

PostgreSQL 9.5 build

Tonight I'd like to start a quest to build PostgreSQL 9.5 (latest) on IRIX.

Apart from the fact it may be a task and half, MIPSpro won't cope, need a new GCC or another million reasons.. to save me re-inventing the wheel or attempting something that will never work, does anyone have any experience or knowledge that this is a brick wall?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Start with getting the development environment set up. I'm not sure you have built on IRIX before. If not, well, first time for everything :) You need development foundation and development libraries, and gcc-4.7 from nekoware. If you have MIPSPro 7.4.x try that as well, although getting C++ code built with it these days is a real pain.

Get build tools like gmake to facilitate the build environment. Use nekoware tar or similar which can unpack a compressed tar ball. Sometimes you need to try out several different versions, which is why it's good to have a tar which supports gzip and bzip2.

Then simply start configuring and making.
Make notes of environment variables: put them in a script. Many configure script look for environment flags like CC CFLAGS LDFLAGS AR and more of that. Set them with 'setenv CFLAGS "-O2 -mips4"'

Capture gmake output to a file with 'gmake >& log &' and inspect the log file if the make fails.
If compile fails because of a problem in the code, inspect the offending code, make a copy of the code with a fixed extension like '.save' and try to make improvements and recompile. By doing it this way, you can build a patch file later by making diff's from the files which have a .save extenion.

I know, it's more of a general guideline, but i hope it helps.

Make that Mips sweat!
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP: :O200: :O2000: :Onyx2:
Thanks dexter, I've compiled a few things in the past on IRIX but I've never tried to break new boundaries.

So far, first issue was no template (it hasn't been ported to your platform), so I just went through a few of the templates already there and all failed at the same point.. unsafe threading (not sure it is a template thing?).
So a fairly successful configure was ./configure --with-template=hpux --disable-thread-safety. Maybe, I do need a template for IRIX, but will see.
I'm not sure what the impact of this will be later on. Anyway..
So at that point I was able to do a make, but noticed loads of errors regarding c99 headers.. so I guess MIPSpro is out the question. My gcc is 3.4.6, so I'm just going to install 4.7.1 and start the ball rolling again.

I'll keep you informed of my journey.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Working from a supported configuration is your best bet. I usually take old sun configurations because of the endianness: old SPARC processors are bigendian, like MIPS.

There is a c99 compiler with MIPSPro, just 'setenv CC c99' and you're good. Don't forget setting CFLAGS: 'setenv CFLAGS -signed' for instance worked for getting xcircuit to run correctly.

Let us know what problems you encounter.
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP: :O200: :O2000: :Onyx2:
uunix wrote: Tonight I'd like to start a quest to build PostgreSQL 9.5 (latest) on IRIX.

don't. it's the first 9.5 release and it's never wise to jump on the first release of whatever software.

anyway i've built 9.4.1 ( viewtopic.php?p=7376282#p7376282 ) with mipspro last year. a few quirks aside there were no significant problems. the issues i ran into were caused by irix in general and not mipspro so gcc wouldn't have made a difference there.
r-a-c.de
foetz wrote:
uunix wrote: Tonight I'd like to start a quest to build PostgreSQL 9.5 (latest) on IRIX.

don't. it's the first 9.5 release and it's never wise to jump on the first release of whatever software.

anyway i've built 9.4.1 ( viewtopic.php?p=7376282#p7376282 ) with mipspro last year. a few quirks aside there were no significant problems. the issues i ran into were caused by irix in general and not mipspro so gcc wouldn't have made a difference there.

That's perfect foetz and you're right about avoiding first builds, but to be honest I thought if I can build the latest, then earlier releases should be do-able also. I didn't think it had been done and I see you have done a lot of work on other stuff. I never even knew that directory existed.

Did you run into the Thread-Safe issue? if you did, did you disable it or sort it and if you did disable it, did you get racing threads?

Nice one though, many many thanks. :D
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
uunix wrote: I thought if I can build the latest, then earlier releases should be do-able also.

unfortunately that's naive :P
different versions means different code and there're many ways to break things hehe. sometimes the old version had something that caused problems which is fixed in the new one but just as well vice versa ...

I didn't think it had been done and I see you have done a lot of work on other stuff. I never even knew that directory existed.

iirc i started sharing stuff here in 2004

Did you run into the Thread-Safe issue? if you did, did you disable it or sort it and if you did disable it, did you get racing threads?

oh sorry, the only thing i remember is changing the mmap stuff to use /dev/zero since irix has no anonymous pages

Nice one though, many many thanks. :D

my pleasure, grab whatever you like. everything is mipspro with reasonable configure options and max. compiler options. the few gcc builds i made have "gcc" in their name.
r-a-c.de
Once again, thanks foets, you have saved me loads of time, although I may still look at doing it myself in the future just for the experience, but for now, 9.4.x is perfect.

Now saying that, once everything is in place and I have initialized the DB with initdb I then cannot start it using pg_ctl (cannot successfully map libpq.so.5) which points to libpq.so.5.7

The database starts fine with postgres -D /foo/bar/data and I can connect etc remotely no problem.

So I copied libpq.so.5 over the existing link and get a different message... unresolvable symbol in ./pg_ctl: PQping not as harsh as the original message and it's at least finding it. So then I copied libpq.so.5.7 to libpq.so.5 and get the same message.

It's a pain not having pg_ctl but certainly not the end of the world.

Interestingly I searched this site for libpq.so.5 and got 60292 results.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
uunix wrote: I may still look at doing it myself in the future just for the experience

oh of course, practice never hurts :-)

So I copied libpq.so.5 over the existing link and get a different message... unresolvable symbol in ./pg_ctl: PQping not as harsh as the original message and it's at least finding it. So then I copied libpq.so.5.7 to libpq.so.5 and get the same message.

usually it's a much better idea to link instead of copy. anyway, as always, just make sure the pgsql libs are in your LD_LIBRARYN32_PATH and the symbols problems should be dealt with. that aside, all my stuff expects to be in /usr/local so in case you have it somewhere else move it there.
i always disable rpaths where possible to avoid forcing specific locations and other problems but sometimes some parts of a program store the build prefix somewhere anyway and expect the stuff to be there
r-a-c.de
foetz wrote: just make sure the pgsql libs are in your LD_LIBRARYN32_PATH and the symbols problems should be dealt with.


Sorted :D
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo: