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

Discussion in 'C++' started by Pablo Suarez, May 17, 2008.

  1. Pablo Suarez

    Pablo Suarez Guest

    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
     
    Pablo Suarez, May 17, 2008
    #1
    1. Advertising

  2. Pablo Suarez

    Guest

    On May 17, 10:13 am, (Pablo Suarez) wrote:
    > 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.
     
    , May 17, 2008
    #2
    1. Advertising

  3. Pablo Suarez

    HelloLinux Guest

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


    On May 17, 11:13 pm, (Pablo Suarez) wrote:
    > 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
     
    HelloLinux, May 17, 2008
    #3
  4. Pablo Suarez

    Ian Collins Guest

    HelloLinux wrote:
    > 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.

    --
    Ian Collins.
     
    Ian Collins, May 17, 2008
    #4
  5. Pablo Suarez

    Ian Collins Guest

    Pablo Suarez wrote:
    > 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.

    --
    Ian Collins.
     
    Ian Collins, May 17, 2008
    #5
  6. Pablo Suarez

    James Kanze Guest

    On 17 mai, 17:13, (Pablo Suarez) wrote:
    > 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.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, May 18, 2008
    #6
  7. Pablo Suarez

    James Kanze Guest

    On 17 mai, 22:39, Ian Collins <> wrote:
    > HelloLinux wrote:
    > > 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.


    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.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, May 18, 2008
    #7
  8. Pablo Suarez

    Ian Collins Guest

    [OT] Re: How to install and call the sun compiler instead of GCC?

    James Kanze wrote:
    > On 17 mai, 17:13, (Pablo Suarez) wrote:
    >> 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.


    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.

    --
    Ian Collins.
     
    Ian Collins, May 18, 2008
    #8
  9. Pablo Suarez

    James Kanze Guest

    On May 18, 9:54 pm, Ian Collins <> wrote:
    > James Kanze wrote:
    > > On 17 mai, 17:13, (Pablo Suarez) wrote:
    > >> 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.


    > gcc is.


    It didn't use to be:).

    > > 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.


    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.)

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, May 19, 2008
    #9
  10. Pablo Suarez

    Ian Collins Guest

    James Kanze wrote:
    > On May 18, 9:54 pm, Ian Collins <> wrote:
    >
    >> 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.)
    >

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

    --
    Ian Collins.
     
    Ian Collins, May 19, 2008
    #10
  11. Pablo Suarez

    sk_usenet Guest

    "Pablo Suarez" <> wrote in message
    > 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.

    --
    http://techytalk.googlepages.com
     
    sk_usenet, May 19, 2008
    #11
  12. Pablo Suarez

    James Kanze Guest

    On May 19, 11:56 am, Ian Collins <> wrote:
    > James Kanze wrote:
    > > On May 18, 9:54 pm, Ian Collins <> wrote:


    > >> 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.)


    > 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.)

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, May 20, 2008
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joan MacEachern
    Replies:
    0
    Views:
    328
    Joan MacEachern
    Oct 1, 2003
  2. Joan MacEachern
    Replies:
    0
    Views:
    351
    Joan MacEachern
    Oct 22, 2003
  3. Replies:
    0
    Views:
    2,885
  4. Dave
    Replies:
    16
    Views:
    590
  5. Replies:
    1
    Views:
    282
Loading...

Share This Page