bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-glpk] build failure glpk-4.16 on solaris


From: Boris Wirtz
Subject: Re: [Bug-glpk] build failure glpk-4.16 on solaris
Date: Wed, 6 Jun 2007 20:25:53 +0400

On Wed, 6 Jun 2007, Andrew Makhorin wrote:

> > apparently there is a type conflict in glpk-4.16 with the solaris
> > type system in respect to the ulong_t type.
>
> > The solaris manual describes (and "sys/types.h" defines) :
>
> > <solaris manual>
>
> >   32-bit Solaris
> >      The data types listed below are defined in <sys/types.h> for
> >      32-bit Solaris.
>
> > [...]
>
> >      typedef    unsigned long     ulong_t;
>
> > [...]
>
> > </solaris manual>
>
> > This obviously clashes with glplib.h :
>
> > <glplib.h>
>
> > #define ulong_t               _glp_lib_ulong_t
>
> > </glplib.h>
>
> > and leads to a compile error.
>
> > After substituting ulong_t with some other string throughout the
> > glpk sources, glpk compiles fine.
>
> Thank you for your bug report.
>
> Probably using the standard type name was not a good idea. I will
> replace it by another name to fix the bug.
>
> Nevertheless, the name ulong_t is replaced by _glp_lib_ulong_t with
> the #define directive *below* its definition in the standard header,
> so in the preprocessed code there must be no datatype named ulong_t
> in the glplib.h header. I think this is a compiler quirk.
>
> Could you please send me the compiler diagnostics?

The problem occurs if you #include <sys/types> directly or indirectly after
#include "glplib.h". Then the compiler tries to use _glp_lib_ulong_t for
its own system calls, which obviously cannot work.
This occurs in the glpk sources only in glplib08.c, and indeed after
exchanging the order of #include <time.h> and #include "glplib.h"
glpk compiles properly.
Nevertheless this is of course a fix of the symptoms not the illness ;)

Boris Wirtz


Relevant compiler message excerpts :

[...]

/bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I..
/include    -g -O2 -MT glplib08.lo -MD -MP -MF .deps/glplib08.Tpo -c -o glplib08
.lo glplib08.c
 gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -MT glplib08.lo -MD -MP -MF .d
eps/glplib08.Tpo -c glplib08.c  -fPIC -DPIC -o .libs/glplib08.o
In file included from /usr/include/time.h:22,
                 from glplib08.c:30:
/pkg/5.8/soft/gcc-3.4.6/run/default/sparc_sun_solaris2.8/bin/../lib/gcc/sparc-su
n-solaris2.8/3.4.6/include/sys/types.h:96: error: conflicting types for '_glp_li
b_ulong_t'
../include/glplib.h:49: error: previous declaration of '_glp_lib_ulong_t' was he
re
glplib08.c:66: error: conflicting types for '_glp_lib_xtime'
../include/glplib.h:230: error: previous declaration of '_glp_lib_xtime' was her
e
glplib08.c:66: error: conflicting types for '_glp_lib_xtime'
../include/glplib.h:230: error: previous declaration of '_glp_lib_xtime' was her
e

[...]

glplib08.c: At top level:
glplib08.c:84: error: conflicting types for '_glp_lib_xdifftime'
../include/glplib.h:234: error: previous declaration of '_glp_lib_xdifftime' was
 here
glplib08.c:84: error: conflicting types for '_glp_lib_xdifftime'
../include/glplib.h:234: error: previous declaration of '_glp_lib_xdifftime' 
was here

[...]







reply via email to

[Prev in Thread] Current Thread [Next in Thread]