compile gcc/g++ code with Sun CC shipped on Sun Studio 12 (linux)

Hola:

I have a large super multi-threaded program which compiles and works fine in FC5 (and up), I want to compile it with sun cc to see if it really runs faster and eventually being able to compile for Solaris to see if we can gain more execution speed (ultimately try it on a multi-core SPARC).

I have solved a few issues like different location for some includes (i.e. hash_map), also the fact the compiler complains about this not being correct:

class A {

private:

int p1;

public:

static const double UNSET= -9999999999999997.9999998;

}

But now I'm confronted with the issue that sun cc seems to not have "round(double)"

# man round

ROUND(3)Linux Programmer抯 ManualROUND(3)

NAME

round, roundf, roundl - round to nearest integer, away from zero

SYNOPSIS

#include <math.h>

double round(double x);

What should I do in this case ?

Is there a resource I can go and check of the general things I have to adjust to make a gcc -> sun cc port ?

Thanks.

[1080 byte] By [jamonea] at [2007-11-27 7:50:31]
# 1

> But now I'm confronted with the issue that sun cc

> seems to not have "round(double)"

> # man round

> ROUND(3)Linux Programmer抯 Manual

>ROUND(3)

> d, roundf, roundl - round to nearest integer, away

> from zero

> SYNOPSIS

>#include <math.h>

> double round(double x);

>

> What should I do in this case ?

Link with libm by adding -lm to the link flags? You did not show the error. gcc seems to use a built-in for this which is why you did not need -lm with gcc.

> Is there a resource I can go and check of the general

> things I have to adjust to make a gcc -> sun cc port

http://www.genunix.org/wiki/index.php/Sun_and_GCC_Compiler_Portability

You are welcome to add some content based on your experience...

Marc_Glissea at 2007-7-12 19:31:32 > top of Java-index,Development Tools,Solaris and Linux Development Tools...