CPAN cc vs. gcc

Discussion in 'Perl Misc' started by Mike Hunter, Feb 6, 2004.

  1. Mike Hunter

    Mike Hunter Guest

    I have a sun box I'd like to build cpan packages on. Uname -a tells me it is
    using solaris "5.9"....I have gcc installed on the machine, but `cc` seems
    to be just a shell script that does nothing.

    For whatever reason, cpan seems to want to try to build c files with cc
    instead of gcc. I tried symlinking cc to gcc, but that didn't work. Where
    can I tell cpan to use gcc instead of cc?

    Thanks,

    Mike
    Mike Hunter, Feb 6, 2004
    #1
    1. Advertising

  2. On Fri, 06 Feb 2004 16:25:43 +0000, Mike Hunter wrote:

    > I have a sun box I'd like to build cpan packages on. Uname -a tells me it is
    > using solaris "5.9"....I have gcc installed on the machine, but `cc` seems
    > to be just a shell script that does nothing.
    >
    > For whatever reason, cpan seems to want to try to build c files with cc
    > instead of gcc. I tried symlinking cc to gcc, but that didn't work. Where
    > can I tell cpan to use gcc instead of cc?


    Just a stab in the dark ....
    the issue isn't with what compiler you're using - it's the 'make' you're
    using. On the Sun boxes at work, I have to use gmake versus make (for
    us, it's under /opt/sfw/bin, but it may be different for you).

    I found out that the GNU make will use the GNU compiler - and the 'make'
    setting is in 'o conf' in CPAN. A simpile 'which gmake' and 'gmake
    --version' will verify this for you.

    I'm hoping that does it for you.

    --
    Jim

    Copyright notice: all code written by the author in this post is
    released under the GPL. http://www.gnu.org/licenses/gpl.txt
    for more information.

    a fortune quote ...
    November, n.: The eleventh twelfth of a weariness. -- Ambrose
    Bierce, "The Devil's Dictionary"
    James Willmore, Feb 6, 2004
    #2
    1. Advertising

  3. Mike Hunter

    Mothra Guest

    Mike Hunter wrote:
    > For whatever reason, cpan seems to want to try to build c files with
    > cc instead of gcc. I tried symlinking cc to gcc, but that didn't
    > work. Where can I tell cpan to use gcc instead of cc?
    >

    export CC=gcc

    Hope this helps

    Mothra
    Mothra, Feb 6, 2004
    #3
  4. Mike Hunter

    Tony Curtis Guest

    >> On Fri, 06 Feb 2004 11:50:33 -0500,
    >> James Willmore <> said:


    > Just a stab in the dark .... the issue isn't with what
    > compiler you're using - it's the 'make' you're using. On
    > the Sun boxes at work, I have to use gmake versus make (for
    > us, it's under /opt/sfw/bin, but it may be different for
    > you).


    > I found out that the GNU make will use the GNU compiler -
    > and the 'make' setting is in 'o conf' in CPAN. A simpile
    > 'which gmake' and 'gmake --version' will verify this for
    > you.


    I think you're conflating experiences where gcc is the default
    compiler available with how make invokes commands.

    The OP has discovered that

    a) Solaris comes with no compiler

    http://www.science.uva.nl/pub/solaris/solaris2.html#q6.1

    b) the perl that comes with Solaris was compiled with Forte cc
    ("perldoc Config").

    Some people have reported that building modules with gcc for
    the pre-installed perl works fine, but since that perl tends
    to be a bit behind the curve, others prefer to install their
    own up-to-date perl, with whatever compiler suite they have
    locally (so that CPAN and perl agree on the compiler
    settings). You also don't run the risk of breaking how
    Solaris uses its /usr/perl5 version.

    http://www.science.uva.nl/pub/solaris/solaris2.html#q3.75

    hth
    t
    Tony Curtis, Feb 6, 2004
    #4
  5. On Fri, 06 Feb 2004 11:07:59 -0600, Tony Curtis wrote:

    >>> On Fri, 06 Feb 2004 11:50:33 -0500,
    >>> James Willmore <> said:

    >
    >> Just a stab in the dark .... the issue isn't with what compiler you're
    >> using - it's the 'make' you're using. On the Sun boxes at work, I have
    >> to use gmake versus make (for us, it's under /opt/sfw/bin, but it may
    >> be different for you).

    >
    >> I found out that the GNU make will use the GNU compiler - and the
    >> 'make' setting is in 'o conf' in CPAN. A simpile 'which gmake' and
    >> 'gmake --version' will verify this for you.

    >
    > I think you're conflating experiences where gcc is the default compiler
    > available with how make invokes commands.
    >
    > The OP has discovered that
    >
    > a) Solaris comes with no compiler
    >
    > http://www.science.uva.nl/pub/solaris/solaris2.html#q6.1


    The OP just got done saying he had an issue with the compiler he wanted to
    use. So, he *does* have a compiler. He have two flavors on the boxes at
    work - Sun's development kit has one and so do the GNU freeware packages.
    Looks like he does as well - otherwise, he would not have posted to begin
    with :)


    > b) the perl that comes with Solaris was compiled with Forte cc
    > ("perldoc Config").
    >
    > Some people have reported that building modules with gcc for the
    > pre-installed perl works fine, but since that perl tends to be a bit
    > behind the curve, others prefer to install their own up-to-date perl,
    > with whatever compiler suite they have locally (so that CPAN and perl
    > agree on the compiler settings). You also don't run the risk of
    > breaking how Solaris uses its /usr/perl5 version.
    >
    > http://www.science.uva.nl/pub/solaris/solaris2.html#q3.75


    I agree that the OP *should* check to see which compiler was used to
    install Perl. I presume he used the GNU compiler and built his own (since
    he *does* have a compiler).

    In any event - I have installed modules on Sun boxes using the GNU
    compiler. And I have not seen any adverse side effects in doing so. And
    using GNU's make solved the compiler issue - since the deveolpment kit's
    make will want to use the development kit's compiler by default.

    What was your point of your post?

    --
    Jim

    Copyright notice: all code written by the author in this post is
    released under the GPL. http://www.gnu.org/licenses/gpl.txt
    for more information.

    a fortune quote ...
    Sauron is alive in Argentina!
    James Willmore, Feb 6, 2004
    #5
  6. Mike Hunter

    Tony Curtis Guest

    >> On Fri, 06 Feb 2004 12:31:07 -0500,
    >> James Willmore <> said:


    > The OP just got done saying he had an issue with the
    > compiler he wanted to use. So, he *does* have a compiler.
    > He have two flavors on the boxes at work - Sun's development
    > kit has one and so do the GNU freeware packages. Looks like
    > he does as well - otherwise, he would not have posted to
    > begin with :)


    No he doesn't, he said cc was a dummy shell script. Solaris
    does not come with a compiler.

    > effects in doing so. And using GNU's make solved the
    > compiler issue - since the deveolpment kit's make will want
    > to use the development kit's compiler by default.


    make doesn't care what the compiler is.
    Tony Curtis, Feb 6, 2004
    #6
  7. Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com> wrote in message news:<>...
    > >> On Fri, 06 Feb 2004 12:31:07 -0500,
    > >> James Willmore <> said:

    >
    > > The OP just got done saying he had an issue with the
    > > compiler he wanted to use. So, he *does* have a compiler.
    > > He have two flavors on the boxes at work - Sun's development
    > > kit has one and so do the GNU freeware packages. Looks like
    > > he does as well - otherwise, he would not have posted to
    > > begin with :)

    >
    > No he doesn't, he said cc was a dummy shell script. Solaris
    > does not come with a compiler.


    Opps! You're right. Reading *is* fundemental - and something I
    should have done more of. Sorry :-(

    Jim
    jwillmore _at_ adelphia _dot_ net
    James Willmore, Feb 6, 2004
    #7
  8. Mike Hunter

    Tony Curtis Guest

    >> On 6 Feb 2004 14:41:45 -0800,
    >> (James Willmore) said:


    > Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com> wrote in
    > message news:<>...
    >> >> On Fri, 06 Feb 2004 12:31:07 -0500, >> James Willmore

    >> <> said:
    >>
    >> > The OP just got done saying he had an issue with the >

    >> compiler he wanted to use. So, he *does* have a compiler.
    >> > He have two flavors on the boxes at work - Sun's

    >> development > kit has one and so do the GNU freeware
    >> packages. Looks like > he does as well - otherwise, he
    >> would not have posted to > begin with :)
    >>
    >> No he doesn't, he said cc was a dummy shell script.
    >> Solaris does not come with a compiler.


    > Opps! You're right. Reading *is* fundemental - and
    > something I should have done more of. Sorry :-(


    Fridays, eh? :)

    Anyway, this whole thing is drifting inexorably away from
    being on-topic...

    t
    Tony Curtis, Feb 6, 2004
    #8
  9. Mike Hunter

    Mike Hunter Guest

    On Fri, 6 Feb 2004 08:51:13 -0800, Mothra wrote:
    > Mike Hunter wrote:
    > > For whatever reason, cpan seems to want to try to build c files with
    > > cc instead of gcc. I tried symlinking cc to gcc, but that didn't
    > > work. Where can I tell cpan to use gcc instead of cc?
    > >

    > export CC=gcc
    >


    Unfortunately, that won't work:

    perl -MCPAN -e 'install Digest::MD5'
    ..
    ..
    ..
    cc: unrecognized option `-KPIC'
    cc: language depend not recognized
    cc: MD5.c: linker input file unused because linking not done

    What's happening is that the config files are structured to build with cc, but
    I need to change that to gcc.

    I tried hacking cc to gcc in /usr/perl5/5.6.1/lib/sun4-solaris-64int/Config.pm, but that didn't work either.

    Any other thoughts? Rebuild perl from source?

    The OT
    Mike Hunter, Feb 6, 2004
    #9
  10. Mike Hunter

    Tintin Guest

    "Mike Hunter" <> wrote in message
    news:...
    > I have a sun box I'd like to build cpan packages on. Uname -a tells me it

    is
    > using solaris "5.9"....


    Actually, SunOS 5.9 or Solaris 9

    >I have gcc installed on the machine, but `cc` seems
    > to be just a shell script that does nothing.


    Well, it does do something. It tells you there is no compiler installed.

    >
    > For whatever reason, cpan seems to want to try to build c files with cc
    > instead of gcc. I tried symlinking cc to gcc, but that didn't work.

    Where
    > can I tell cpan to use gcc instead of cc?


    Try either changing the order of your PATH setting to move /usr/ucb to the
    end, or better still, just link /usr/ucb/cc to /usr/local/bin/gcc
    Tintin, Feb 7, 2004
    #10
  11. Mike Hunter

    Ben Morrow Guest

    wrote:
    > On Fri, 6 Feb 2004 08:51:13 -0800, Mothra wrote:
    > > export CC=gcc

    >
    > Unfortunately, that won't work:
    >
    > perl -MCPAN -e 'install Digest::MD5'
    > .
    > .
    > .
    > cc: unrecognized option `-KPIC'
    > cc: language depend not recognized
    > cc: MD5.c: linker input file unused because linking not done
    >
    > What's happening is that the config files are structured to build
    > with cc, but I need to change that to gcc.
    >
    > I tried hacking cc to gcc in
    > /usr/perl5/5.6.1/lib/sun4-solaris-64int/Config.pm, but that didn't
    > work either.
    >
    > Any other thoughts? Rebuild perl from source?


    Always the best option IMHO. Build perl on the machine it will be
    running on, with the compiler you intend to build extensions
    with. Much less hassle.

    Ben

    --
    don't get my sympathy hanging out the 15th floor. you've changed the locks 3
    times, he still comes reeling though the door, and soon he'll get to you, teach
    you how to get to purest hell. you do it to yourself and that's what really
    hurts is you do it to yourself just you, you and noone else *
    Ben Morrow, Feb 7, 2004
    #11
  12. Mike Hunter

    Mike Hunter Guest

    On Sat, 7 Feb 2004 21:45:47 +0000 (UTC), Ben Morrow wrote:
    >
    > wrote:
    > > On Fri, 6 Feb 2004 08:51:13 -0800, Mothra wrote:
    > > > export CC=gcc

    > >
    > > Unfortunately, that won't work:
    > >
    > > perl -MCPAN -e 'install Digest::MD5'
    > > .
    > > .
    > > .
    > > cc: unrecognized option `-KPIC'
    > > cc: language depend not recognized
    > > cc: MD5.c: linker input file unused because linking not done
    > >
    > > What's happening is that the config files are structured to build
    > > with cc, but I need to change that to gcc.
    > >
    > > I tried hacking cc to gcc in
    > > /usr/perl5/5.6.1/lib/sun4-solaris-64int/Config.pm, but that didn't
    > > work either.
    > >
    > > Any other thoughts? Rebuild perl from source?

    >
    > Always the best option IMHO. Build perl on the machine it will be
    > running on, with the compiler you intend to build extensions
    > with. Much less hassle.


    I did this and things are working. Thanks everybody for the help.

    Mike
    Mike Hunter, Feb 9, 2004
    #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. carl d.
    Replies:
    1
    Views:
    376
    A. Sinan Unur
    May 10, 2005
  2. Replies:
    5
    Views:
    186
    Randy Kobes
    Oct 12, 2005
  3. Ben Bullock
    Replies:
    12
    Views:
    271
    Ben Bullock
    Jul 8, 2008
  4. SVCitian
    Replies:
    1
    Views:
    924
    SVCitian
    Oct 22, 2010
  5. PerlFAQ Server
    Replies:
    0
    Views:
    156
    PerlFAQ Server
    Jan 24, 2011
Loading...

Share This Page