Обсуждение: Installation on SGI IRIX 6.5.10

Поиск
Список
Период
Сортировка

Installation on SGI IRIX 6.5.10

От
"G. Anthony Reina"
Дата:
In addition to my RedHat 6.2 server, I'm installing Postgres 7.1.1 on an
SGI O2 (IRIX 6.5.10). The configure works, but the 'gmake all' fails
when it tries to compile 'xact.c':

cc-1521 cc: WARNING File = /usr/include/setjmp.h, Line = 26 A nonstandard preprocessing directive is used.
 #ident "$Revision: 1.36 $"  ^

cc-1070 cc: ERROR File = xact.c, Line = 696 The indicated type is incomplete.
                       struct timeval delay;                                      ^

1 error detected in the compilation of "xact.c".
gmake[4]: *** [xact.o] Error 2
gmake[4]: Leaving directory
`/usr/src/postgresql-7.1.1/src/backend/access/transam'
gmake[3]: *** [transam-recursive] Error 2
gmake[3]: Leaving directory
`/usr/src/postgresql-7.1.1/src/backend/access'
gmake[2]: *** [access-recursive] Error 2
gmake[2]: Leaving directory `/usr/src/postgresql-7.1.1/src/backend'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/src/postgresql-7.1.1/src'
gmake: *** [all] Error 2
o21.nsi.edu:postgres::/usr/src/postgresql-7.1.1 >

I'm using the SGI MIPSPro 7.1 C compiler. I haven't had any problems
like this when compiling previous versions of Postgres. If necessary, I
could try to get gcc instead of the MIPSPro compiler, but I wonder if
the xact.c definition for timeval could be modified to pass on my
machine.

Thanks.
-Tony




Re: Installation on SGI IRIX 6.5.10

От
Tom Lane
Дата:
"G. Anthony Reina" <reina@nsi.edu> writes:
> In addition to my RedHat 6.2 server, I'm installing Postgres 7.1.1 on an
> SGI O2 (IRIX 6.5.10). The configure works, but the 'gmake all' fails
> when it tries to compile 'xact.c':

> cc-1521 cc: WARNING File = /usr/include/setjmp.h, Line = 26
>   A nonstandard preprocessing directive is used.

>   #ident "$Revision: 1.36 $"
>    ^

That looks like IRIX's own fault.  If their compiler doesn't like their
own <setjmp.h>, it's their issue to resolve ...

> cc-1070 cc: ERROR File = xact.c, Line = 696
>   The indicated type is incomplete.

>                         struct timeval delay;
>                                        ^

Hm.  Which system header file defines struct timeval on IRIX?
I'd expect <time.h> or <sys/time.h>, but maybe they keep it
someplace unusual.
        regards, tom lane


Re: Installation on SGI IRIX 6.5.10

От
"G. Anthony Reina"
Дата:
Tom Lane wrote:

> > cc-1070 cc: ERROR File = xact.c, Line = 696
> >   The indicated type is incomplete.
>
> >                         struct timeval delay;
> >                                        ^
>
> Hm.  Which system header file defines struct timeval on IRIX?
> I'd expect <time.h> or <sys/time.h>, but maybe they keep it
> someplace unusual.

In /usr/include/sys/time.h:

#if _XOPEN4UX || defined(_BSD_TYPES) || defined(_BSD_COMPAT)
/** Structure returned by gettimeofday(2) system call,* and used in other calls.* Note this is also defined in
sys/resource.h*/
#ifndef _TIMEVAL_T
#define _TIMEVAL_T
struct timeval {
#if _MIPS_SZLONG == 64__int32_t :32;
#endiftime_t tv_sec;  /* seconds */long tv_usec; /* and microseconds */
};


-Tony




Re: Installation on SGI IRIX 6.5.10

От
Tom Lane
Дата:
"G. Anthony Reina" <reina@nsi.edu> writes:
> Tom Lane wrote:
>> Hm.  Which system header file defines struct timeval on IRIX?
>> I'd expect <time.h> or <sys/time.h>, but maybe they keep it
>> someplace unusual.

> In /usr/include/sys/time.h:

> #if _XOPEN4UX || defined(_BSD_TYPES) || defined(_BSD_COMPAT)

Next thought is that maybe none of these control symbols are defined
by default --- could you look into that possibility?  Perhaps some
compiler switches or #defines are needed to get IRIX to allow
"struct timeval"?
        regards, tom lane


Re: Installation on SGI IRIX 6.5.10

От
"G. Anthony Reina"
Дата:
Tom Lane wrote:

> Evidently IRIX also considers strdup() to be nonstandard :-(
>
> It's hard to believe that SGI is quite this braindead.  I think there is
> something broken about configure on your setup.  Can't tell what from
> here --- suggest you call in some IRIX gurus.
>

Yep. So goes SGI. I can't figure out why this error is showing up. When I
looked at the man page for strdup:

char *strdup (const char *s1);

which is how it looks to be used in async.c. I simply added a specific
type-cast:

notifyName = (char *) strdup(relname);

and it compiled async.c fine (of course, now I'll have to go through some
of the other files that also have strdup and change them).

I'm going to see if the SGI technical support considers this a bug or not.

-Tony






Re: Installation on SGI IRIX 6.5.10

От
"G. Anthony Reina"
Дата:
Tom Lane wrote:

> > #if _XOPEN4UX || defined(_BSD_TYPES) || defined(_BSD_COMPAT)
>
> Next thought is that maybe none of these control symbols are defined
> by default --- could you look into that possibility?  Perhaps some
> compiler switches or #defines are needed to get IRIX to allow
> "struct timeval"?
>

>                         regards, tom lane

In xact.c, I added:

#define _BSD_COMPAT 1

before

#include <sys/time.h>

It seems to get through that part of the compilation okay now. I'm not
sure if that will break anything else but it seems minor.

There's a new problem with async.c:

cc-1515 cc: ERROR File = async.c, Line = 172 A value of type "int" cannot be assigned to an entity of type "char
*".
               notifyName = strdup(relname);                          ^

1 error detected in the compilation of "async.c".
gmake[3]: *** [async.o] Error 2
gmake[3]: Leaving directory
`/usr/src/postgresql-7.1.1/src/backend/commands'
gmake[2]: *** [commands-recursive] Error 2
gmake[2]: Leaving directory `/usr/src/postgresql-7.1.1/src/backend'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/src/postgresql-7.1.1/src'
gmake: *** [all] Error 2

It looks like I just need to change the code to explicitly cast the
variable.

-Tony





Re: Installation on SGI IRIX 6.5.10

От
Tom Lane
Дата:
"G. Anthony Reina" <reina@nsi.edu> writes:
> There's a new problem with async.c:

> cc-1515 cc: ERROR File = async.c, Line = 172
>   A value of type "int" cannot be assigned to an entity of type "char
> *".

>                 notifyName = strdup(relname);
>                            ^

Evidently IRIX also considers strdup() to be nonstandard :-(

It's hard to believe that SGI is quite this braindead.  I think there is
something broken about configure on your setup.  Can't tell what from
here --- suggest you call in some IRIX gurus.
        regards, tom lane


Re: Installation on SGI IRIX 6.5.10

От
Tom Lane
Дата:
"G. Anthony Reina" <reina@nsi.edu> writes:
> which is how it looks to be used in async.c. I simply added a specific
> type-cast:

> notifyName = (char *) strdup(relname);

That absolutely should NOT be necessary; there should be a proper
extern declaration of strdup visible.  Perhaps it should be added
to include/port/irix5.h (cf port/nextstep.h).
        regards, tom lane


Re: Installation on SGI IRIX 6.5.10

От
"G. Anthony Reina"
Дата:
Tom Lane wrote:

>
> That absolutely should NOT be necessary; there should be a proper
> extern declaration of strdup visible.  Perhaps it should be added
> to include/port/irix5.h (cf port/nextstep.h).
>
>                         regards, tom lane

Just to make sure, I tried compiling on another SGI. Everything went fine
without any kludgy workarounds. It looks like somehow my compiler/OS has
some problems. I'm upgrading to the latest OS version and compiler version.

Thanks for the help.

-Tony