How to install and call the sun compiler instead of GCC?

P

Pablo Suarez

In all my previous C++ projects I used the gcc as compiler.

For some reasons I want to try out the Sun compiler instead.
How can I install and use this compiler instead?

Is the Sun C++ compiler pre-installed on Linux resp. Solaris?

How can I call him?

Pablo
 
K

kasthurirangan.balaji

In all my previous C++ projects I used the gcc as compiler.

For some reasons I want to try out the Sun compiler instead.
How can I install and use this compiler instead?

Is the Sun C++ compiler pre-installed on Linux resp. Solaris?

How can I call him?

Pablo

I highly doubt that - sun compiler on a linux box. But the reverse is
possible - having both sun c++ and g++ compiler on the same sun box.
You may refer the compilers using the absolute path. For example, your
sun compiler could be at /usr/SUNWSpro/bin/CC and your g++ could be
at /usr/local/bin/g++. You may ask your admin to install g++ for you
in the sun box. In all the cases(atleast what i have seen), g++ could
be on any box(sun,aix..) but the reverse isn't possible.

Thanks,
Balaji.
 
H

HelloLinux

What I want know is why do you like to try sun conpiler on a linux
system?


In all my previous C++ projects I used the gcc as compiler.

For some reasons I want to try out the Sun compiler instead.
How can I install and use this compiler instead?

Is the Sun C++ compiler pre-installed on Linux resp. Solaris?

How can I call him?

Pablo

sun
 
I

Ian Collins

HelloLinux said:
What I want know is why do you like to try sun conpiler on a linux
system?
Because it works? Some of us prefer the same tools on more than one
platform.
 
I

Ian Collins

Pablo said:
In all my previous C++ projects I used the gcc as compiler.

For some reasons I want to try out the Sun compiler instead.
How can I install and use this compiler instead?
Try comp.unix.solaris.

Hint - run the installer.
 
J

James Kanze

In all my previous C++ projects I used the gcc as compiler.
For some reasons I want to try out the Sun compiler instead.
How can I install and use this compiler instead?
Is the Sun C++ compiler pre-installed on Linux resp. Solaris?

No C++ compilers are "pre-installed" under Solaris. As far as I
know, most Linux distributions do include a version of g++, but
none (again as far as I know) include Sun CC. For corporate
use, I'd contact Sun for the C++ compiler for both platforms.
(The product name is actually Sun Studio 12, and it includes C,
C++ and Fortran.) I think a free version is also available, but
I've not experimented with it. For g++ for Solaris, I find it
easy enough to build myself from the downloaded sources, but Sun
used to make precompiled versions available as well. (Sun also
has a version of gcc 4.2.0 available which will use the Sun
optimizer.)
How can I call him?

Under Solaris, you invoke g++ with the command "g++", and Sun
C++ with the command "CC". Provided your $PATH is set
correctly, of course. But you'll still need to look at the
docs; neither compiler is really usable with just the default
options, and you'll need to work out which options are best for
your situation.
 
J

James Kanze

Because it works? Some of us prefer the same tools on more
than one platform.

Or multiple tools on each box. It's always useful to compile
your code with several different compilers, and test it in
several different environments.

At least on a Sparc, Sun optimizes better than gcc; it's quite
possible that this is true as well for a PC.
 
I

Ian Collins

James said:
No C++ compilers are "pre-installed" under Solaris.

gcc is.
For corporate
use, I'd contact Sun for the C++ compiler for both platforms.
(The product name is actually Sun Studio 12, and it includes C,
C++ and Fortran.) I think a free version is also available, but
I've not experimented with it.

There is only one version, the free one.
 
J

James Kanze


It didn't use to be:).
There is only one version, the free one.

I'm sure you can pay for it as well. (I don't handle that end
of things here, so I don't know all the details. I do know that
there is a free version for Linux, but it doesn't work with
Linux 2.6, only Linux 2.4. Which doesn't say much for Linux'
maturity.)
 
I

Ian Collins

James said:
I'm sure you can pay for it as well. (I don't handle that end
of things here, so I don't know all the details. I do know that
there is a free version for Linux, but it doesn't work with
Linux 2.6, only Linux 2.4. Which doesn't say much for Linux'
maturity.)
You can opt to pay for support, the product is free. I'm not aware of
any restriction to Linux 2.4.
 
S

sk_usenet

Pablo Suarez said:
In all my previous C++ projects I used the gcc as compiler.

For some reasons I want to try out the Sun compiler instead.
How can I install and use this compiler instead?

Is the Sun C++ compiler pre-installed on Linux resp. Solaris?

Your question is off-topic on this newsgroup. You should try some platform
dedicated to your platform to ask the question.
How can I call him?
How do you call "him" :)? Through a Makefile probably? If yes, then you
know where to put the change.
 
J

James Kanze

You can opt to pay for support, the product is free. I'm not
aware of any restriction to Linux 2.4.

The compiler works fine under later versions. The 64 bit linker
won't load its dynamic libraries correctly, however, which means
that it won't run. And of course, there's not much point in
compiling code if you cannot link it. (The problem may be
limited to the 64 bit version, but I don't have any 32 bit
system around to test it on.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top