sunmath.h for Linux

In porting C++ code from Solaris 9 to Redhat EL 4, using the sun studioexpress package compiler - I get problems when it comes to including the sunmath.h. Is there any replacement for that on Linux? Thanks,Mark
[231 byte] By [mark6] at [2007-11-26 10:43:54]
# 1

Hi

libsunmath.a is there, but no header. The Solaris version includes <floatingpoint.h> which doesn't exist on Linux. You could try using (and modifying as necessary) sunmath.h from a Solaris system, if you have access to one.

Alternatively, don't include sunmath.h (or only withing a "#if defined/#endif"), and explicity declare any funtions in libsunmath.h that you use.

E.g.,

#if defined(SOLARIS)

#include <sunmath.h>

#else

extern long double acosl(long double);

extern long double asinl(long double);

extern long double atanl(long double);

#endif

Paul

Paul_Floyd at 2007-7-7 2:55:53 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

> Is there any replacement for that on Linux?

Most of the **functionality** can be replaced with that of C99 libm.

That is what we did when porting compiler itself.

A tiny bit of this functionality was easier to bringover from Solaris, but this tiny bit was not worth of exposing to users as separate user library/header.

> libsunmath.a is there, but no header.

It is a compiler-supporting library, which is not intended for user's use. Hence no header there. See above for explanation.

If we see a huge demand from Linux crowd on Solaris functionality that we (SunStudio) own we might consider doing a sort of Solaris-on-Linux-support library subproject. Right now we see no real justification for doing it.

regards,

__Fedor.

SFV at 2007-7-7 2:55:53 > top of Java-index,Development Tools,Solaris and Linux Development Tools...