Menu

#42 ns2 installation on opensolaris intel pc

open
nobody
ns-2 (62)
5
2009-03-20
2009-03-20
EricN
No

Variable SOLARIS_MIN_MAX does not get set by ns-2.33 configuration script when ran on opensolaris.

So during make in ns-2.33 compilation fails with error message stating MIN and/or MAX not defined.

Looking at ns-2.33, configure file:

.................
;;
sparc-sun-solaris*)
if test $CC != gcc ; then
V_DEFINE="$V_DEFINE -D__FUNCTION__=__func__ -features=extension\
s"
fi
V_DEFINE="$V_DEFINE -D__svr4__ -DSOLARIS_MIN_MAX"
V_LIB="$V_LIB -ldl"
;;
.............

And looking at ns-2.33, config.h file:

#if defined(SOLARIS_MIN_MAX)
/* Macros for min/max. */
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif /* MIN */
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif /* MAX */
#endif

I conclude that configure does not detect opensolaris on intel box correctly and as a result SOLARIS_MIN_MAX does not get set and compilation errors result.

To the best of my knowledge neither MIN nor MAX are defined in opensolaris /usr/include.

To get ns-2.33 to compile, in config.h I just commented out the SOLARIS_MIN_MAX check to force the macros to be defined. This is not elegant but it gets me to use ns2 on opensolaris.

I installed from opensolaris package loader: all xlibg and xorg packages, gnu make (had to link make to gmake), autoconf and gcc.

My hardware is a dell dimension laptop.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB