Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Compiling Perl modules on AIX using gcc instead of cc_r?

Reply
Thread Tools

Compiling Perl modules on AIX using gcc instead of cc_r?

 
 
Chris
Guest
Posts: n/a
 
      06-28-2005
Anyone know of a way to compile C in Perl modules that require C using
gcc instead of cc_r under AIX (5.2)? I've installed gcc on our AIX
box, but Config for Perl is still pointing to cc_r (eg. $Config{cc} =
'cc_r'). Just changing the config option for the C compiler doesn't
help since cc_r C flags are being passed to gcc instead of gcc flags.

Wondering if anyone has worked through this before. I'm surprised to
find nothing that matches this problem on Google. (Plenty of people
trying to compile Perl itself using gcc, but not trying to compile C
code for module support with the Perl installation on AIX that IBM
created, obviously with cc_r...)

Thanks!
-ceo

 
Reply With Quote
 
 
 
 
Sisyphus
Guest
Posts: n/a
 
      06-29-2005

"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Anyone know of a way to compile C in Perl modules that require C using
> gcc instead of cc_r under AIX (5.2)? I've installed gcc on our AIX
> box, but Config for Perl is still pointing to cc_r (eg. $Config{cc} =
> 'cc_r'). Just changing the config option for the C compiler doesn't
> help since cc_r C flags are being passed to gcc instead of gcc flags.


Yes, you need to change them too and there are probably other things that
need to be changed, too - eg ldflags, libpth, cpp, cpprun, cppstdin. There's
a module on cpan called ExtUtils::FakeConfig that does the job (but probably
only for Win32) - it enables use of MinGW (gcc) compiler with a perl built
using Microsoft's Visual Studio compiler. In all, it rewrites about 30
Config.pm values, though in your case I would expect (without really
knowing) the number of required rewrites to be a little less.
ExtUtils::FakeConfig creates a Config file called Confg_m.pm that contains
the rewritten values. The original Config.pm remains untouched, and perl -V
reports what it has always reported in the past. If you want to use the
"rewritten" values, you run (eg):
perl -MConfig_m Makefile.PL

Perhaps it may be of use in "showing the way" to a solution for you.
However, you'll need to know (or find out) what the appropriate values for
gcc are. If you have access to a machine that has a gcc-built perl on it,
then that could be very useful.

>
> Wondering if anyone has worked through this before. I'm surprised to
> find nothing that matches this problem on Google. (Plenty of people
> trying to compile Perl itself using gcc, but not trying to compile C
> code for module support with the Perl installation on AIX that IBM
> created, obviously with cc_r...)
>


You may well find it's simpler to build perl with gcc, rather than modify
the Config values. That way you automatically get the correct Config values
without even having to think about it.

If you create a module to do the job, then you should consider putting it on
cpan - perhaps ExtUtils::FakeConfig_AIX

Cheers,
Rob


 
Reply With Quote
 
 
 
 
Chris
Guest
Posts: n/a
 
      06-29-2005
Sisyphus wrote:
> "Chris" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> > Anyone know of a way to compile C in Perl modules that require C using
> > gcc instead of cc_r under AIX (5.2)? I've installed gcc on our AIX
> > box, but Config for Perl is still pointing to cc_r (eg. $Config{cc} =
> > 'cc_r'). Just changing the config option for the C compiler doesn't
> > help since cc_r C flags are being passed to gcc instead of gcc flags.

>
> Yes, you need to change them too and there are probably other things that
> need to be changed, too - eg ldflags, libpth, cpp, cpprun, cppstdin.


Errr... One option that I considered and played with but got tedious
real fast. Everyone wants the easy way, but sometimes, it ain't there.
I was hoping though.

> There's
> a module on cpan called ExtUtils::FakeConfig that does the job (but probably
> only for Win32) - it enables use of MinGW (gcc) compiler with a perl built
> using Microsoft's Visual Studio compiler. In all, it rewrites about 30
> Config.pm values, though in your case I would expect (without really
> knowing) the number of required rewrites to be a little less.
> ExtUtils::FakeConfig creates a Config file called Confg_m.pm that contains
> the rewritten values. The original Config.pm remains untouched, and perl -V
> reports what it has always reported in the past. If you want to use the
> "rewritten" values, you run (eg):
> perl -MConfig_m Makefile.PL


This could be helpful in performing the net effect of the above.

> Perhaps it may be of use in "showing the way" to a solution for you.
> However, you'll need to know (or find out) what the appropriate values for
> gcc are. If you have access to a machine that has a gcc-built perl on it,
> then that could be very useful.


Well, yeah, I was hoping for something along those lines. If it was
quick. Like "Yeah, set CCFLAGS to ____ and CCLDFLAGS to _____ and
LDFLAGS to _____ and you should be set."

> >
> > Wondering if anyone has worked through this before. I'm surprised to
> > find nothing that matches this problem on Google. (Plenty of people
> > trying to compile Perl itself using gcc, but not trying to compile C
> > code for module support with the Perl installation on AIX that IBM
> > created, obviously with cc_r...)
> >

>
> You may well find it's simpler to build perl with gcc, rather than modify
> the Config values. That way you automatically get the correct Config values
> without even having to think about it.


Another thing I worked on as well under the same premise as you
present. Building under AIX using gcc isn't quite so straightforward
however as articles I *did* find explained as well as from experience
this afternoon. cc_r -q qualifiers still were being passed to gcc as
well as other library type settings not being found. It's not simple,
but I had this same notion.

> If you create a module to do the job, then you should consider putting it on
> cpan - perhaps ExtUtils::FakeConfig_AIX


Will do. Thanks for confirming my worst fears on this effort...!


-ceo

 
Reply With Quote
 
Sisyphus
Guest
Posts: n/a
 
      06-29-2005

"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

>
> Will do. Thanks for confirming my worst fears on this effort...!
>
>


It could get worse - I neglected to mention the possibility that your
existing libperl58.a (or whatever it happens to be) might be incompatible
with gcc, in which case you're also confronted with the prospect of creating
a new (compatible) libperl58.a. ExtUtils::FakeConfig performs such a feat on
Win32. It creates a suitable import lib in the CORE folder from the
exisiting perl58.dll (shared lib).

Cheers,
Rob


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error compiling ruby under AIX 5.3 with GCC during the make phase Victor Reyes Ruby 3 05-03-2008 09:49 PM
problems compiling perl 586 on AIX 5.2. ML4 using xlc_r compiler henk1529@hotmail.com Perl Misc 0 06-02-2005 03:24 PM
Compiling Perl GD on AIX 4.3.3 PWGSC/TPSGC Perl Misc 1 05-31-2004 08:03 PM
problem compiling perl source on AIX 5.1.0.0 using GCC marko sarunac Perl 0 11-17-2003 07:21 PM



Advertisments