Hi Magnus,

Thanks for that. I always believed that the mcpu flag could enable a C
compiler to generate code that could use the extra instructions on the
newer CPUs - perhaps one day I'll get around to reading the
documentation ;)

Anyway, I've posted the compiled RH 7.3 postgresql-7.3.4 RPMs at
http://www.webbased.co.uk/mca/pgsql/. Andrew, if you are satisfied that
these work correctly on your RH7.3 install, there is no problem with
Lamar placing copies of them on the postgresql website for people to
download.


Cheers,

Mark.

---

Mark Cave-Ayland
Webbased Ltd.
Tamar Science Park
Derriford
Plymouth
PL6 8BX
England

Tel: +44 (0)1752 764445
Fax: +44 (0)1752 764446


This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender. You
should not copy it or use it for any purpose nor disclose or distribute
its contents to any other person.

> -----Original Message-----
> From: Magnus Naeslund(w) [mailto:mag@fbab.net] 
> Sent: 05 August 2003 10:59
> To: Mark Cave-Ayland
> Cc: 'Joe Conway'; 'Andrew Dunstan'; 'Lamar Owen'; 'Postgresql Hackers'
> Subject: Re: [HACKERS] problem with RH7.3 Pg7.3.4 binaries
> 
> 
> 
> Mark Cave-Ayland said:
> > Hi there,
> >
> > I have a RedHat 7.3 machine that can build the 7.3.4 RPMs 
> if required 
> > - it only contains RPMs from the vanilla CD or from 
> > updates.redhat.com. I've just done a test build and 
> everything seems 
> > OK except that the C compiler is passed the -mcpu=i686 flag - I'm 
> > guessing I need to somehow change this to i386 so it will binaries 
> > will run on actual i386 machines? Can someone point me in the right 
> > direction?
> >
> 
> The -mcpu flag doesn't do what you seems to think it does.
> It still generates i386 compatible code, but favours i686 
> processor timings etc.
> 
> >
> > Cheers,
> >
> > Mark.
> 
> 
> Magnus
> 



Tue, 5 Aug 2003 11:28:43 +0100
"Mark Cave-Ayland" <m.cave-ayland@webbased.co.uk>
Re: problem with RH7.3 Pg7.3.4 binaries
Will check later today.

Extract from man gcc:

       -mcpu=cpu-type
           Tune to cpu-type everything applicable about the generated code,
           except for the ABI and the set of available instructions.  The
           choices for cpu-type are i386, i486, i586, i686, pentium,
pentium-
           mmx, pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, k6-3,
           athlon, athlon-tbird, athlon-4, athlon-xp and athlon-mp.

           While picking a specific cpu-type will schedule things appropri-
           ately for that particular chip, the compiler will not generate
any
           code that does not run on the i386 without the -march=cpu-type
           option being used.  i586 is equivalent to pentium and i686 is
           equivalent to pentiumpro.  k6 and athlon are the AMD chips as
           opposed to the Intel ones.


cheers

andrew

----- Original Message ----- 
From: "Mark Cave-Ayland" <m.cave-ayland@webbased.co.uk>
To: <mag@fbab.net>
Cc: "'Joe Conway'" <mail@joeconway.com>; "'Andrew Dunstan'"
<andrew@dunslane.net>; "'Lamar Owen'" <lowen@pari.edu>; "'Postgresql
Hackers'" <pgsql-hackers@postgresql.org>
Sent: Tuesday, August 05, 2003 6:28 AM
Subject: Re: [HACKERS] problem with RH7.3 Pg7.3.4 binaries


> Hi Magnus,
>
> Thanks for that. I always believed that the mcpu flag could enable a C
> compiler to generate code that could use the extra instructions on the
> newer CPUs - perhaps one day I'll get around to reading the
> documentation ;)
>
> Anyway, I've posted the compiled RH 7.3 postgresql-7.3.4 RPMs at
> http://www.webbased.co.uk/mca/pgsql/. Andrew, if you are satisfied that
> these work correctly on your RH7.3 install, there is no problem with
> Lamar placing copies of them on the postgresql website for people to
> download.
>
>
> Cheers,
>
> Mark.
>
> ---
>
> Mark Cave-Ayland
> Webbased Ltd.
> Tamar Science Park
> Derriford
> Plymouth
> PL6 8BX
> England
>
> Tel: +44 (0)1752 764445
> Fax: +44 (0)1752 764446
>
>
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender. You
> should not copy it or use it for any purpose nor disclose or distribute
> its contents to any other person.
>
> > -----Original Message-----
> > From: Magnus Naeslund(w) [mailto:mag@fbab.net]
> > Sent: 05 August 2003 10:59
> > To: Mark Cave-Ayland
> > Cc: 'Joe Conway'; 'Andrew Dunstan'; 'Lamar Owen'; 'Postgresql Hackers'
> > Subject: Re: [HACKERS] problem with RH7.3 Pg7.3.4 binaries
> >
> >
> >
> > Mark Cave-Ayland said:
> > > Hi there,
> > >
> > > I have a RedHat 7.3 machine that can build the 7.3.4 RPMs
> > if required
> > > - it only contains RPMs from the vanilla CD or from
> > > updates.redhat.com. I've just done a test build and
> > everything seems
> > > OK except that the C compiler is passed the -mcpu=i686 flag - I'm
> > > guessing I need to somehow change this to i386 so it will binaries
> > > will run on actual i386 machines? Can someone point me in the right
> > > direction?
> > >
> >
> > The -mcpu flag doesn't do what you seems to think it does.
> > It still generates i386 compatible code, but favours i686
> > processor timings etc.
> >
> > >
> > > Cheers,
> > >
> > > Mark.
> >
> >
> > Magnus
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend


Tue, 5 Aug 2003 08:14:55 -0400
"Andrew Dunstan" <andrew@dunslane.net>
Re: problem with RH7.3 Pg7.3.4 binaries
On Tuesday 05 August 2003 08:14, Andrew Dunstan wrote:
> Will check later today.

When you do, let me know, so that I can post them.
-- 
Lamar Owen
Director of Information Technology
Pisgah Astronomical Research Institute

Tue, 5 Aug 2003 09:37:59 -0400
Lamar Owen <lowen@pari.edu>
Re: problem with RH7.3 Pg7.3.4 binaries

Seems to be OK. See below.

BTW, for those interested, following up a note from Joe Conway I 
discovered yesterday the Right Way (tm) to build RPMs (nothing Pg 
specific in this). Basically, you set up some rpm macros like this in 
~/.rpmmacros:
  %_topdir        %(echo ${HOME}/rpm)
  %_tmppath       %{_topdir}/tmp
  %packager       Your Name <yourusername@your.org>
and a directory tree something like this under your homedir:
  rpm
  rpm/BUILD
  rpm/RPMS
  rpm/RPMS/i386
  rpm/RPMS/i586
  rpm/RPMS/noarch
  rpm/SOURCES
  rpm/SPECS
  rpm/SRPMS
  rpm/tmp
adjusting the subdirs of RPMS appropriately.

now you can run
  rpmbuild -ba postgresql-7.3.4-1PGDG.src.rpm

and everything builds nicely (assuming your have the right stuff 
installed). No need to build as root (building as root is Evil) nor to 
install the source rpm before building.

Now having rescued the boat anchor \b\b\b\b\b\b\b old P1 box from the 
attic I need to find a new use for it .....

cheers

andrew
-------------------------



[root@face pgsql]# rpm -Fhv postgresql-*.rpm
Preparing...                ########################################### 
[100%]
   1:postgresql-docs        ########################################### 
[ 12%]
   2:postgresql-jdbc        ########################################### 
[ 25%]
   3:postgresql-libs        ########################################### 
[ 37%]
   4:postgresql             ########################################### 
[ 50%]
   5:postgresql-contrib     ########################################### 
[ 62%]
   6:postgresql-devel       ########################################### 
[ 75%]
   7:postgresql-server      ########################################### 
[ 87%]
   8:postgresql-pl          ########################################### 
[100%]
[root@face pgsql]# /etc/init.d/postgresql stop
                                                           [  OK  ]
[root@face pgsql]# /etc/init.d/postgresql start
Starting postgresql service:                               [  OK  ]
[root@face pgsql]# su - facedba -c "psql face"
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

face=# select version();
                             version                            
-----------------------------------------------------------------
 PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC 2.96
(1 row)

face=# \q
[root@face pgsql]#
-------------------------------------------------------
Lamar Owen wrote:

>On Tuesday 05 August 2003 08:14, Andrew Dunstan wrote:
>  
>
>>Will check later today.
>>    
>>
>
>When you do, let me know, so that I can post them.
>  
>



Tue, 05 Aug 2003 10:32:04 -0400
Andrew Dunstan <andrew@dunslane.net>
Re: problem with RH7.3 Pg7.3.4 binaries

BTW, the init file has this:

# chkconfig: - 85 15

I would modestly suggest changing this to something like 81 19. The 
reason - these are the same settinga as httpd, and I normally want Pg 
started up before the web server and shut down after the web server.

andrew


Andrew Dunstan wrote:

>
> Seems to be OK. See below.
>
> BTW, for those interested, following up a note from Joe Conway I 
> discovered yesterday the Right Way (tm) to build RPMs (nothing Pg 
> specific in this). Basically, you set up some rpm macros like this in 
> ~/.rpmmacros:
>  %_topdir        %(echo ${HOME}/rpm)
>  %_tmppath       %{_topdir}/tmp
>  %packager       Your Name <yourusername@your.org>
> and a directory tree something like this under your homedir:
>  rpm
>  rpm/BUILD
>  rpm/RPMS
>  rpm/RPMS/i386
>  rpm/RPMS/i586
>  rpm/RPMS/noarch
>  rpm/SOURCES
>  rpm/SPECS
>  rpm/SRPMS
>  rpm/tmp
> adjusting the subdirs of RPMS appropriately.
>
> now you can run
>  rpmbuild -ba postgresql-7.3.4-1PGDG.src.rpm
>
> and everything builds nicely (assuming your have the right stuff 
> installed). No need to build as root (building as root is Evil) nor to 
> install the source rpm before building.
>
> Now having rescued the boat anchor \b\b\b\b\b\b\b old P1 box from the 
> attic I need to find a new use for it .....
>
> cheers
>
> andrew
> -------------------------
>
>
>
> [root@face pgsql]# rpm -Fhv postgresql-*.rpm
> Preparing...                
> ########################################### [100%]
>   1:postgresql-docs        ########################################### 
> [ 12%]
>   2:postgresql-jdbc        ########################################### 
> [ 25%]
>   3:postgresql-libs        ########################################### 
> [ 37%]
>   4:postgresql             ########################################### 
> [ 50%]
>   5:postgresql-contrib     ########################################### 
> [ 62%]
>   6:postgresql-devel       ########################################### 
> [ 75%]
>   7:postgresql-server      ########################################### 
> [ 87%]
>   8:postgresql-pl          ########################################### 
> [100%]
> [root@face pgsql]# /etc/init.d/postgresql stop
>                                                           [  OK  ]
> [root@face pgsql]# /etc/init.d/postgresql start
> Starting postgresql service:                               [  OK  ]
> [root@face pgsql]# su - facedba -c "psql face"
> Welcome to psql 7.3.4, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>       \h for help with SQL commands
>       \? for help on internal slash commands
>       \g or terminate with semicolon to execute query
>       \q to quit
>
> face=# select version();
>                             version                            
> -----------------------------------------------------------------
> PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC 2.96
> (1 row)
>
> face=# \q
> [root@face pgsql]#
> -------------------------------------------------------
> Lamar Owen wrote:
>
>> On Tuesday 05 August 2003 08:14, Andrew Dunstan wrote:
>>  
>>
>>> Will check later today.
>>>   
>>
>>
>> When you do, let me know, so that I can post them.
>>  
>>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>



Tue, 05 Aug 2003 10:49:07 -0400
Andrew Dunstan <andrew@dunslane.net>
Re: problem with RH7.3 Pg7.3.4 binaries