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

Problem compiling ns-2.1b6-current on solaris 2.6



Hi,

I downloaded ns-2.1b6-current from the surrey mirror - one of my sim
scripts was giving problems with ns-2.1b5 and I thought I'd check if it
was a problem with the simulator which may have been fixed (probably a
little bit arrogant - my code buggy? never!).

I thought that seeing as it takes me 10mins to compile 2.1b5, that it
would only take me a few mins to compile and check 2.1b6. However, as you
can guess, this turned out not to be the case.

The configure script ran fine, and generated the appropriate output. I ran
make but it bombed out straight away with the following error:

In file included from random.h:41,
                 from random.cc:40:
config.h:58: conflicting types for `typedef signed char int8_t'
/usr/include/sys/int_types.h:62: previous declaration as `typedef char
int8_t'
make: *** [random.o] Error 1

I'm using solaris 2.6 and gcc 2.95

I did a bit of investigation work, and found that, as the error suggests,
there is a conflict in type definitions - the type int8_t is defined
twice and in (slightly) conflicting ways. 

The system header file /usr/include/types/int_types.h defines it as a
char, and config.h defines it as a signed char. I looked up the help on
gcc and found that gcc considers signed char, unsigned char, and char as
different types, even though char must be either signed or unsigned -
hence the error.

My workaround was to comment out the offending line in config.h and ensure
that the -fsigned-char flag was set on compilation, to ensure that the
'typedef char int8_t' in the system header file was equivalent to 'typedef
signed char int8_t'.

This workaround is not very elegant - it enabled me to compile the s/w,
and all the tests ran correctly bar the wireless gridkeeper one, which
caused a core dump. It would probably be better to modify either the
configure process or the software, but I don't know how to do this - the
source files imep/imep.cc and imep/dest_queue.cc appear to be the only
files that use this data type. Since these weren't present in the 2.1b5
release, this problem did not arise. I'm sure it's a reasonably standard
problem with the autoconf process, since the data type int8_t seems to be
standard system data type which could vary from system to system.

Hope this helps someone compile under solaris or solve the problem.

Sean.

-----
Sean Murphy,			Email: [email protected]
Teltec Ireland,			Phone: +353-1-7045080
DCU, Dublin 9,			Fax:   +353-1-7045092
Ireland.