PostgreSQL 9.5 build

IRIX and IRIX software discussion including open source and commerical offerings.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
uunix
Donor
Donor
Posts: 1808
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

PostgreSQL 9.5 build

Unread postby uunix » Thu Jan 21, 2016 12:06 pm

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!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------

User avatar
dexter1
Moderator
Moderator
Posts: 2743
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: PostgreSQL 9.5 build

Unread postby dexter1 » Thu Jan 21, 2016 3:48 pm

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:

User avatar
uunix
Donor
Donor
Posts: 1808
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

Re: PostgreSQL 9.5 build

Unread postby uunix » Thu Jan 21, 2016 4:35 pm

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!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------

User avatar
dexter1
Moderator
Moderator
Posts: 2743
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: PostgreSQL 9.5 build

Unread postby dexter1 » Thu Jan 21, 2016 11:39 pm

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:

User avatar
foetz
Moderator
Moderator
Posts: 6575
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: PostgreSQL 9.5 build

Unread postby foetz » Fri Jan 22, 2016 8:05 am

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.

User avatar
uunix
Donor
Donor
Posts: 1808
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

Re: PostgreSQL 9.5 build

Unread postby uunix » Fri Jan 22, 2016 12:32 pm

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!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------

User avatar
foetz
Moderator
Moderator
Posts: 6575
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: PostgreSQL 9.5 build

Unread postby foetz » Fri Jan 22, 2016 3:08 pm

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.

User avatar
uunix
Donor
Donor
Posts: 1808
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

Re: PostgreSQL 9.5 build

Unread postby uunix » Sat Jan 23, 2016 6:26 am

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!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------

User avatar
foetz
Moderator
Moderator
Posts: 6575
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: PostgreSQL 9.5 build

Unread postby foetz » Sat Jan 23, 2016 9:48 am

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

User avatar
uunix
Donor
Donor
Posts: 1808
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

Re: PostgreSQL 9.5 build

Unread postby uunix » Sat Jan 23, 2016 2:23 pm

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!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------


Return to “IRIX and Software”

Who is online

Users browsing this forum: No registered users and 1 guest