Operating System - HP-UX
1745921 Members
4347 Online
108723 Solutions
New Discussion юеВ

ANSI C / Perl /gcc Problem

 
SOLVED
Go to solution
Kalin Evtimov
Regular Advisor

ANSI C / Perl /gcc Problem

Hello!
I have a general Problem with HP-UX. I want to install webminstats for monitoring the System.It uses RRDtool. But, I cannot compile RRDtool with the standard Perl that comes with HP-UX, because it requires ANSI C Compiler, and I don't have it. So, I installed another Perl distribution, that used gcc for compiling and that worked, BUT, webmin uses my standard Perl. So, I made the conclusion, that I have to compile RRDtool with the standard Perl. Is there any way for making it work with gcc and not ANSI C? Thank you.
14 REPLIES 14
H.Merijn Brand (procura
Honored Contributor
Solution

Re: ANSI C / Perl /gcc Problem

Do you have admin rights?

If so, just move the standard perl out of the way, and symlink to the new one

Assuming HP's perl is in /usr/bin, and the new gcc one in /opt/perl, change accordingly

# cd /usr/bin
# mv perl perl.hp
# ln -s /opt/perl/bin/perl perl

Done

I don't know RDD or webmintools, but if you can change the $PATH for those tools, for example by making a shell wrapper round the startup script(s), you could set the $PATH to have the perl you need be found before the perl you want to avoid

so assuming rdd starts from /usr/local/bin/rdd

# cd /usr/local/bin
# mv rdd rdd.org
# cat >rdd <#!/bin/sh
export PATH=/opt/perl/bin:$PATH
exec /usr/local/bin/rdd.org $@
EOF
# chmod 755 rdd

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: ANSI C / Perl /gcc Problem

But I nedd the standard Perl for running webmin. Is it going to work after I move the standard perl out of the way, and symlink to the new one?

I think there is a bug in this standard Perl, because trying to compile rrdtools with it brings me:
Running Mkbootstrap for RRDs ()
chmod 644 RRDs.bs
rm -f blib/arch/auto/RRDs/RRDs.so
LD_RUN_PATH="" /usr/bin/ld -b +vnocompatwarnings -L/usr/lib/hpux64 RRDs.o -L../src/.libs/ -lrrd_private -lm -o blib/arch/auto/RRDs/RRDs.so
ld: Can't find library or mismatched ABI for -lrrd_private
Fatal error.
*** Error exit code 1

Stop.
H.Merijn Brand (procura
Honored Contributor

Re: ANSI C / Perl /gcc Problem

There you are (trying to) mix 64bit and 32bit libraries and objects (mismatched ABI). You can't.

In case the webadmin tool *requires* the other version, you have to leave it there, and go for my second solution.

Yes, it *is* possible to mix HP C-ANSI-C perl and GNU gcc objects or vice versa, but it isn't /easy/.

Just out of curiousity, what are the two builds coming from? What is the output of:

lt09:/home/merijn 138 > perl -v ; perl -V:cc -V:config_args -V:cf_email -V:osname -V:osvers

This is perl, v5.8.6 built for i686-linux-64int
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2004, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

cc='cc';
config_args='-Uusedevel -Uversiononly -Duse64bitint -des';
cf_email='h.m.brand@hccnet.nl';
osname='linux';
osvers='2.6.11.4-20a-default';
lt09:/home/merijn 139 >

for both versions of perl

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: ANSI C / Perl /gcc Problem

Here for my standard Perl:


This is perl, v5.8.3 built for IA64.ARCHREV_0-thread-multi-LP64
(with 8 registered patches, see perl -V for more detail)

Copyright 1987-2003, Larry Wall

Binary build 809 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Jan 19 2005 10:07:33

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

cc='cc';
config_args='-ders -Dcc=cc -Accflags=-DNO_HASH_SEED -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Duse64bitall -Dd_attribut=undef -Dd_u32align=define -Doptimize=-fast +DSitanium2 +Ofltacc=strict -Duselargefiles -Dinc_version_list=5.8.2/$archname 5.8.2 5.8.1/$archname 5.8.1 5.8.0/$archname 5.8.0 -Duseshrplib -Dprefix=/opt/perl_64 -Dcf_by=ActiveState -Dcf_email=support@ActiveState.com';
cf_email='support@ActiveState.com';
___________________________________________________________
And here for the other one:

This is perl, v5.8.6 built for IA64.ARCHREV_0

Copyright 1987-2004, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

cc='gcc';
config_args='-d -e -Dcc=gcc -Ui_dbm -Ui_db -Dprefix=/usr/local useposix=true';
cf_email='root@valhalla.cis';
osname='hpux';
osvers='11.23';
Kalin Evtimov
Regular Advisor

Re: ANSI C / Perl /gcc Problem

I think that it is not possible to mix 32 and 64 bit mode. There are two Perl-Modules in the rrdtools source dir, called RRDr and RRDs. I compile RRDr without any problem, but when I try to compile RRDs, then comes the whole bla-bla that I posted before..
H.Merijn Brand (procura
Honored Contributor

Re: ANSI C / Perl /gcc Problem

I *know* that it is not possible to mix 32 and 64 bit mode. On pa-risc.

The first perl you posted is not a `standard' HP perl. It's the ActiveState build of Perl. It's a 64bit threads enabled perl optimized for Itanium2, probably built with HP's cc (looking at the ccflags).

The second perl you posted is a 32bit non-threaded quasi-standard build Perl, built with GNU gcc.

From this I see that you are on Itanium, and I don't know if 32bit and 64bit are ruling eachother out as rigid as on pa-risc, but I'd sure try not to mix.

Deducing from the complete conversation, you were trying to build rdd with the ActivePerl, which doesn't work.

So, why not start from scratch with the rdd stuff, and set your $PATH to find the second perl first

# cd /your/path/to/rdd-1.2.3
# export PATH=/usr/local/bin:$PATH

# perl Makefile.PL
or
# configure --prefix=/usr/local --disable-nls

# make
# make test
or
# make check

# make install

Can you tell us more about the way rdd configures?

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: ANSI C / Perl /gcc Problem

I already compiled RRDtools with the gcc-Perl and it works. The point is, that webmin uses the ActiveState Perl and needs also a Perl Module called RRDs. The RRDs.pm is in the rrdtools source dir:
/mnt/tmp/rrdtools-1.0.49

I try:
/mnt/tmp/rrdtools-1.0.49/perl Makefile.PL
and then
/mnt/tmp/rrdtools-1.0.49/make test
as described in README

Then comes the error msg from above.

- - -
Exactly the same when trying to compile rrdtools with the ActiveState Perl, because it tries to compile the RRDs module.
- - -
I think to remove everything and then to compile one perl with gcc compiler, and not installing perl from depot, then install webmin, and then compile rrdtools with the same perl. Otherwise - great mess.

Thank you for helping me, should I tell you whether I made this work?
________________
For RRDtool see:
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/compiling.html
H.Merijn Brand (procura
Honored Contributor

Re: ANSI C / Perl /gcc Problem

Ahhhhhhhhh. Now I get it.
You cannot build modules in the perl(2) environment and use them in the other perl(1) environment.

The procedure for you is

# perl Makefile.PL
# vi Makefile

* change all CFLAGS that only apply to HP's C to be in gcc style

# make
# make test
# make install

What you could do if you don't know about CFLAGS, is post the generated Makefile here, and have us here at the forum change it for you (don't forget about your points)

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: ANSI C / Perl /gcc Problem

I don't know how to change the file. I'll be glad to learn how. I have attached the file, because it is pretty long.