freddo411 has asked for the wisdom of the Perl Monks concerning the following question:

Trying to compile and install a number of different CPAN modules. Many, of course, compile and install nicely. However a number fail to compile and give a error message like:

CPAN.pm: Going to build J/JS/JSTOWE/TermReadKey-2.21.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Term::ReadKey cp ReadKey.pm blib/lib/Term/ReadKey.pm AutoSplitting blib/lib/Term/ReadKey.pm (blib/lib/auto/Term/ReadKey) /usr/local/bin/perl -I/usr/local/lib/perl5/5.00503 genchars.pl Writing termio/termios section of cchars.h... Done. Checking for sgtty... Sgtty found. Checking sgtty... ltchars structure found. Checking symbols t_rprntc (REPRINT) found in ltchars t_dsuspc (DSUSPEND) found in ltchars t_werasc (ERASEWORD) found in ltchars t_flushc (DISCARD) found in ltchars t_lnextc (QUOTENEXT) found in ltchars t_suspc (SUSPEND) found in ltchars Writing sgtty section of cchars.h... Done. /usr/local/bin/perl /usr/local/lib/perl5/5.00503/ExtUtils/xsubpp -nopr +ototypes -typemap /usr/local/lib/perl5/5.00503/ExtUtils/typemap Read +Key.xs > ReadKey.xsc && mv ReadKey.xsc ReadKey.c make: *** No rule to make target `/usr/local/lib/perl5/5.00503/sun4-so +laris/CORE/opnames.h', needed by `ReadKey.o'. Stop.

I super searched for this but to no avail. Google gives only two hits each on different platforms. I'm on Solaris 2.8, perl 5.005.03, using GCC 3.2.2 Why do some modules look for opnames.h? Why don't I have this in my perl install?

Replies are listed 'Best First'.
Re: Module compile problem
by rob_au (Abbot) on May 16, 2003 at 02:29 UTC
    I've come across this exact same problem on the Solaris platform (Solaris 2.8, perl 5.005.03, gcc 2.95.2) quite regularly when compiling modules with C elements. The cause of this which I was able to determine was the use of an updated ExtUtils::MakeMaker package being employed from my own module install tree when running perl Makefile.PL - When I removed my module install tree from @INC, more specifically PERL5LIB, the make and install went perfectly.

     

    perl -le 'print+unpack("N",pack("B32","00000000000000000100000001011010"))'

      Hi, Did you permanently remove PERL5LIB from @INC or only did this for the install? How did you accomplish the removal? Edit the Makefile.PL? Do I need to rollback the version of MakeMaker to more generally fix this problem?
Re: Module compile problem
by pzbagel (Chaplain) on May 16, 2003 at 00:45 UTC

    Also, since you mention you are on Solaris, is your perl install the package that SUN provides(SUNWpl5u)? That version of perl is built with the SUN C Compiler and perl generally wants you to build modules with the same compiler it was built with. Some modules may not build if you then attempt to use gcc to build the modules.You may have to build perl from scratch with gcc and then build and compile modules.

    The version of perl at sunfreeware.com may be compiled with gcc. Anyone out there know whether the version from sunfreeware.com(SMCperl) is compiled with the Sun native C compiler or gcc?

    HTH

    UPDATE

    Here I go answering my own question again, or rather Steven @ Sunfreeware answers it. The perl 5.8.0 package on sunfreeware is built with gcc. So that may be the way to go.

      I considered this. I had the same problem when I was using the bundled perl 5.005.03 from the Sun distribution. At that time I was using Sun's cc and recieved the same error.

      Consequently, I downloaded the source for 5.005.03 and compiled that with GCC, then did the modules with GCC. Same problem.

      I'm going to attempt to mess with the MakeMaker Module as described below to see if that helps.

      Cheers

      --Fred

Re: Module compile problem
by diotalevi (Canon) on May 15, 2003 at 23:20 UTC

    Perhaps those modules are poorly behaved and expect that you built your perl install from scratch. I took a peek at my opnames.h from bleedperl (its newer than 5.8.0) and copied the header here. You might want to download a copy of perl source from http://www.cpan.org/src/5.0/perl5.005_03.tar.gz, run the opcode.pl script and copy the generated opnames.h file out to the /usr/local/lib/perl5/5.00503/sun4-solaris/CORE/ directory.

    * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * This file is built by opcode.pl from its data. Any changes made h +ere * will be lost! */
      For the perl 5.005.03 distribution, opcode.pl creates an output file opcode.h . As far as I can tell, this distribution doesn't make opnames.h when compiled from scratch.

      I would like to understand why the modules look for opnames.h

        I see - opnames.h was introduced in 5.6.something. I suppose this just means that your module should have a "require 5.6.0" statement so its clear that you can't use it with your version of perl.

        I downloaded the module source and noticed that opnames.c is not referenced there. I tend to agree wit h the other poster who pegged the problem on ExtUtils::MakeMaker.