CPAN cc vs. gcc

M

Mike Hunter

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
 
J

James Willmore

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"
 
M

Mothra

Mike said:
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
 
T

Tony Curtis

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
 
J

James Willmore

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!
 
T

Tony Curtis

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

James Willmore

Tony Curtis said:
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
 
T

Tony Curtis

On 6 Feb 2004 14:41:45 -0800,
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
 
M

Mike Hunter

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
 
T

Tintin

Mike Hunter said:
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
 
B

Ben Morrow

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
 
M

Mike Hunter

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
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top