LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Perl CPAN: Changing the compiler (https://www.linuxquestions.org/questions/programming-9/perl-cpan-changing-the-compiler-4175445915/)

stateless 01-16-2013 01:53 PM

Perl CPAN: Changing the compiler
 
Hi. I have this annoying little hitch: I'm trying to use CPAN to install a Perl module I need onto a system on which I have no root privileges. However, the system has two C compilers: gcc annd pgcc. For reasons I do not understand, CPAN attempts to use pgcc instead of gcc, and of course all build attempts fail because pgcc does not recognize most of expected compiler switches. I need to tell CPAN to use gcc instead of pgcc, but I have no idea how to do this. There does not seem to be such and option listed with "o conf".

I know it is possible to set this if I do not use CPAN, and install manually, but this will be a real pain because I must then install the dependencies manually.

knudfl 01-16-2013 04:21 PM

Checking perl for compiler configuration :
$ perl -MConfig -e 'print "$Config{cc}\n"'
... The reply will most often be : gcc .

The most easy way of setting a specific compiler for perl, example :
$ mkdir $HOME/bin && cd bin/ && ln -s /usr/bin/gcc
... And then set $HOME first in your PATH :
PATH = $HOME/bin:$PATH

Ref. http://www.justskins.com/forums/prob...and-97843.html
( Google .. set CC cpan .. )

-

Sergei Steshenko 01-19-2013 11:11 AM

Quote:

Originally Posted by stateless (Post 4871627)
Hi. I have this annoying little hitch: I'm trying to use CPAN to install a Perl module I need onto a system on which I have no root privileges. However, the system has two C compilers: gcc annd pgcc. For reasons I do not understand, CPAN attempts to use pgcc instead of gcc, and of course all build attempts fail because pgcc does not recognize most of expected compiler switches. I need to tell CPAN to use gcc instead of pgcc, but I have no idea how to do this. There does not seem to be such and option listed with "o conf".

I know it is possible to set this if I do not use CPAN, and install manually, but this will be a real pain because I must then install the dependencies manually.

It's not CPAN. See http://perldoc.perl.org/Config.html , look for compiler there.


All times are GMT -5. The time now is 10:36 PM.