1823058 Members
3183 Online
109645 Solutions
New Discussion юеВ

PERL Install issue

 
SOLVED
Go to solution
Scott_130
Occasional Advisor

PERL Install issue

Currently we have a version of C compiler that came with our HP Version(B.11.11) so I would imagine it is fairly up-to-date. I downloaded the newest stable release from perl and am trying to install it. The error I am getting is this:

Use which C compiler? [cc]
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C pr
oduct; ignored.
(Bundled) cc: "try.c", line 1: error 1705: Function prototypes are an ANSI feat
ure.
Uh-oh, the C compiler 'cc' doesn't seem to be working.
Configure[3773]: gcc: not found.
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C pr
oduct; ignored.
(Bundled) cc: "try.c", line 1: error 1705: Function prototypes are an ANSI feat
ure.
Uh-oh, the C compiler 'cc' doesn't seem to be working.
You need to find a working C compiler.

HOWEVER,

I know the compiler is good b/c it is being used. Also, $PATH contains the proper paths to the compiler.

Any thoughts would be greatly appreciated.

Thanks

Scott
12 REPLIES 12
A. Clay Stephenson
Acclaimed Contributor

Re: PERL Install issue

You don't have a prayer using the bundled C compiler becausxe it only speaks K&R C and Perl is written in ANSI C. You can download and install gcc or use HP's ANSI C or aC++ compiler.

Unless you have a compelling reason to compile Perl, you can use the readily available binary ports.

If indeed you do have a configured ANSI/C compiler then /usr/bin/cc should be symbolically linked to /opt/ansic/bin/cc but the warnings you are getting indicate that the bundled c compiler is being invoked.
If it ain't broke, I can fix that.
Scott_130
Occasional Advisor

Re: PERL Install issue

We have a gcc compiler installed and running but it seems to want to use the HP bundles C compiler. Can you tell me how to re-direct this in the makefile or config.sh.

Thanks

Scott
A. Clay Stephenson
Acclaimed Contributor

Re: PERL Install issue

I'm doing this from memory but when you run the 'configure' script, you are prompted for a compiler. Respond with 'gcc' (you make need to use the full path).

Plan B: Edit your existing makefiles replacing cc with gcc but you will probably then have to change some compiler options as well.
If it ain't broke, I can fix that.
H.Merijn Brand (procura
Honored Contributor

Re: PERL Install issue

Plan A. Use the following command

# sh ./Configure -Dcc=gcc -des

Plan B. Use my precompiled version from https://www.beepz.com/personal/merijn or http://www.cmve.net/~merijn

Plan C. Buy the C-ANSI-C compiler. It outperforms gcc by 25%, so if you have more than only perl to compile, or you need high performance perl, it's worth thinking about.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor
Solution

Re: PERL Install issue

Clay, your plan B is too complicated (and unreliable). If you want to go for plan B, start with changing config.sh (cc=gcc) before you make which will cause all the makefiles to be recreated, but again, this is dangerous, because the Configure process uses the chosen C compiler to change a lot of things. look in hints/hpux.sh to see where dragons live.

-Dcc=gcc is the way to go (you /can/ use the full path)
Enjoy, Have FUN! H.Merijn
Scott_130
Occasional Advisor

Re: PERL Install issue

Thanks for the responses.

I went ahead and installed a 64-bit gcc compiler from the HP site and installed it through swinstall.

Then i re-ran the perl Configure as:

sh Configure -Dcc=gcc

And I get this error:

-----------------------------
Configure[2933]: gcc: not found. You need to find a working C compiler.
-----------------------------

Is it a problem that it is 64 bit? Also, I added the path of gcc compiler which is /usr/local/pa20_64/bin
A. Clay Stephenson
Acclaimed Contributor

Re: PERL Install issue

Well, that depends upon whether or not your platform supports 64-bit code. My first step would be to compile a very baby C program using gcc. Something as simple as

int main(void)
{
(void) printf("Hello World\n");
return(0);
}

gcc baby.c -o baby

and then see if baby executes. If so you have a working gcc.



If it ain't broke, I can fix that.
Scott_130
Occasional Advisor

Re: PERL Install issue

Well I think I am making progress as I was able to get Perl installed (I used another method)

I am trying now to load modules onto the box and I got an error when loading the first (Date::Calc)

# perl -MDate::Calc -e 1
Can't load '/usr/local/lib/perl5/site_perl/5.8.0/PA-RISC2.0/auto/Date/Calc/Calc.sl' for mod
ule Date::Calc: Exec format error at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DynaLoader.pm li
ne 229.
at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted

I'm so close. Any thoughts?
Bill Hassell
Honored Contributor

Re: PERL Install issue

The PATH to cc is probably incorrect. If you loaded the (extra cost) ANSI C compiler, it will NOT be located in /usr/bin. But since /usr/bin is early in the $PATH variable, you are getting the K&R compiler. The install process should have put /opt/ansic/bin near the front of the PATH.

First, check if you have the ANSI C compiler with swlist -l bundle If you do, there are a couple of choices:

- rename /usr/bin/cc to /usr/bin/cc-k&r and make sure that the ANSI compiler's path (in /opt/ansic/bin) is present. Check /etc/PATH to be sure that everyone sees this path.

- rename /usr/bin/cc to /usr/bin/cc and create a symlink to the ANSI compiler using ln -s /opt/ansic/bin/cc /usr/bin/cc

Perl 5 is available ready to install and run from www.software.hp.com


Bill Hassell, sysadmin
H.Merijn Brand (procura
Honored Contributor

Re: PERL Install issue

First question: *WHY* do you need a 64bit perl??? There are still a truckload of modules on CPAN that don't work with 64bit perls (or are not threadsafe for that matter).

Unless you want to link 64bit objects later - like DBD-Oracle to 64bit ports - it is unlikely that you need 64bit perl.

FYI 64bit perl is 14% slower than 32bit perl accross the line.

Have you tried my precompiled perl from https://www.beepz.com/personal/merijn/ or http://www.cmve.net/~merijn/ ? It comes with a lot of precompiled modules.

If you still want to try yourself, be sure that the PATH to gcc is in you $PATH (either add it in /etc/PATH or add it to $PATH in your ~/.tcshrc, ~/.profile, or whatever shell initializing file you have)
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: PERL Install issue

Are you by any chance related to "Pamela R.Schulz" ? She's just posted the same question in the perlbug database.
Enjoy, Have FUN! H.Merijn
Scott_130
Occasional Advisor

Re: PERL Install issue

Well, I finaly got it.

First, the 64-bit I was referring to was the gcc compiler, not PERL. I removed the gcc compiler and installed a 32-bit version and had no problems. I just assumed that the 64 bit compiler was backwards compatible. After installing the 32-bit compiler I was able to add DBI and other modules. Thanks to everyfor there help on this issue.

Note*** I am not related to Pamela