Discussion:
needing to change default compiler?
(too old to reply)
Christopher Howard
2013-01-16 00:29:34 UTC
Permalink
Hi. I'm not even going to pretend to be a Perl programmer (I used it years
ago once.) However, I am trying to use CPAN to install a newer version of
the DBI module, because the application I am trying to run needs a newer
version than the one installed on the system (I have no admin privileges).
From inside the CPAN shell, I attempted 'install DBI', but eventual the
build fails with:

code:
--------
/usr/bin/perl /usr/lib/perl5/5.10.0/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.10.0/ExtUtils/typemap -typemap typemap Perl.xs > Perl.xsc
&& mv Perl.xsc Perl.c
cc -c -D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -DDEBUGGING
-fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
-funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe
-DVERSION=\"1.623\" -DXS_VERSION=\"1.623\" -fPIC
"-I/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/CORE" -W -Wall
-Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare
-Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter Perl.c
pgcc-Error-Unknown switch: -fno-strict-aliasing
pgcc-Error-Unknown switch: -pipe
pgcc-Error-Unknown switch: -fmessage-length=0
pgcc-Error-Unknown switch: -Wall
pgcc-Error-Unknown switch: -fstack-protector
pgcc-Error-Unknown switch: -funwind-tables
pgcc-Error-Unknown switch: -fasynchronous-unwind-tables
pgcc-Error-Unknown switch: -Wall
pgcc-Error-Unknown switch: -pipe
pgcc-Error-Unknown switch: -W
pgcc-Error-Unknown switch: -Wall
pgcc-Error-Unknown switch: -Wpointer-arith
pgcc-Error-Unknown switch: -Wbad-function-cast
pgcc-Error-Unknown switch: -Wno-comment
pgcc-Error-Unknown switch: -Wno-sign-compare
pgcc-Error-Unknown switch: -Wno-cast-qual
pgcc-Error-Unknown switch: -Wmissing-noreturn
pgcc-Error-Unknown switch: -Wno-unused-parameter
make: *** [Perl.o] Error 1
TIMB/DBI-1.623.tar.gz
/usr/bin/make -- NOT OK
Warning (usually harmless): 'YAML' not installed, will not store persistent
state
Prepending /u1/uaf/cmhoward2/.cpan/build/Test-Simple-0.98-qIMiFo/blib/arch
/u1/uaf/cmhoward2/.cpan/build/Test-Simple-0.98-qIMiFo/blib/lib
/u1/uaf/cmhoward2/.cpan/build/ExtUtils-MakeMaker-6.64-V7EmM3/blib/arch
/u1/uaf/cmhoward2/.cpan/build/ExtUtils-MakeMaker-6.64-V7EmM3/blib/lib to
PERL5LIB for 'test'
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
MSCHWERN/ExtUtils-MakeMaker-6.64.tar.gz : install NO
MSCHWERN/Test-Simple-0.98.tar.gz : install NO
TIMB/DBI-1.623.tar.gz : make NO
--------

It seems that "pgcc" does not recognize these switches, so why is cpan
using pgcc instead of gcc? If this is the problem, how do I change CPAN's
default compiler?

I am working on a SUSE Linux system with Perl 5.10. The CPAN shell version
seems to be 1.9205.
Andreas Koenig
2013-01-16 04:39:36 UTC
Permalink
Post by Christopher Howard
From inside the CPAN shell, I attempted 'install DBI', but eventual the
Try it from outside the CPAN shell. The CPAN shell does nothing but wrap
the usual incantation:

perl Makefile.PL
make
make test
make install

I do not expect that this will work better but it makes it more obvious
where you have to tweak things: with parameters to 'perl Makefile.PL'.
You will find the ExtUtils::MakeMaker documentation indispensable. When
your default compiler is not the right one you will most probably need
more than one such parameter. For a start I'd try

perl Makefile.PL CC=yourcc

Good luck,
--
andreas
Loading...