Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hello, i'm trying to install Devel::Pragma, which is a dependency for the precious Method::Signatures. It doesn't work and i have investigated for several hours already, and think i have figured out precisely why it doesn't work, but don't know how to fix it. Can you help me?

I'm using Perl 5.14.2, and Cygwin 1.7.17 in Windows XP.

Here is what i get when i "make" :

rm -f blib/arch/auto/Devel/Pragma/Pragma.dll g++-4 --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl +,--enable-auto-image-base -L/usr/local/lib -fstack-protector Pragma.o + -o blib/arch/auto/Devel/Pragma/Pragma.dll \ /usr/lib/perl5/5.14/i686-cygwin-threads-64int/CORE/cygperl5_14.dll - +L/usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto/B/Hooks +/OP/Check -lCheck -L/usr/lib/perl5/site_perl/5.14/i686-cygwin-threads +-64int/auto/B/Hooks/OP/Annotation \ Pragma.o: In function `devel_pragma_check_require': /cygdrive/c/Dropbox/.cpan/build/Devel-Pragma-0.54-3TGXm_/Pragma.xs:103 +: undefined reference to `_op_annotation_new' Pragma.o: In function `XS_Devel__Pragma_END': /cygdrive/c/Dropbox/.cpan/build/Devel-Pragma-0.54-3TGXm_/Pragma.xs:314 +: undefined reference to `_op_annotation_group_free' Pragma.o: In function `devel_pragma_require': /cygdrive/c/Dropbox/.cpan/build/Devel-Pragma-0.54-3TGXm_/Pragma.xs:135 +: undefined reference to `_op_annotation_get' Pragma.o: In function `boot_Devel__Pragma': /cygdrive/c/Dropbox/.cpan/build/Devel-Pragma-0.54-3TGXm_/Pragma.xs:308 +: undefined reference to `_op_annotation_group_new' collect2: ld returned 1 exit status Makefile:485: recipe for target `blib/arch/auto/Devel/Pragma/Pragma.dl +l' failed make: *** [blib/arch/auto/Devel/Pragma/Pragma.dll] Error 1
The hook_op_annotation.h file is not found by g++ : all the functions that are not found by Pragma.xs are in this file. hook_op_annotation.h is part of B:Hooks::OP::Annotation. And i have checked: it is the only file in this module, which defines the functions that Pragma.xs needs.

So, what do do from there? Here is my plan :
0. Trying to cheat
1. Either Devel::Pragma is not looking in the right place.
2. Or hook_op_annotation.h is not in the right place.

0. Trying to cheat

I have copied hook_op_annotation.h to a directory in my PATH ( C:/Cygwin/bin/ ), but it fails identically. I have put it in the lib/ folder of %HOME%/.cpan/build/Devel-Pragma-0.54-3TGXm_/, which didn't work either. But it teaches us something :
A. maybe "g++" doesn't look into the PATH (which would be very surprizing)
B. maybe that hook_op_annotation.h needs to be within the B:Hooks::OP::Annotation module in order for the functions to be found. I can't imagine how, but i don't know anything about XS after all.
C. any other possibility that i missed?

1. Devel::Pragma is not looking in the right place

The "make" log tells us that when Devel::Pragma's "make" runs g++, it looks (-L option) into these too directories:

/usr/local/lib /usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto/B/Hooks/O +P/Annotation
Because i am running in Cygwin, /usr is equivalent to C:/Cygwin/usr. I tried to put a simple text file in this directory, and to read it through the path '/usr/local/bin/file.txt', and it worked, so it's not an issue with Cygwin's paths system.

I have tried to copy the hook_op_annotation.h file into /usr/local/lib/, but it didn't work. Which would confirm that it needs to be within the B:Hooks::OP::Annotation module to work (option B earlier).

Then, what about the other directory :

/usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto/B/Hooks/O +P/Annotation
It doesn't exist.
In fact, that is not true : it exists in
/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto/B/Hooks/OP/An +notation

which is strange, as the log of the B::Hooks::OP::Annotation installation says that it's installing in /usr/lib/perl5, and /lib/perl5 is never mentionned in this log (see after the tests, the line starting with "Installing"):

Building and testing B-Hooks-OP-Annotation-0.44 cp hook_op_annotation.h blib/arch/B/Hooks/OP/Annotation/Install/hook_o +p_annotation.h cp lib/B/Hooks/OP/Annotation.pm blib/lib/B/Hooks/OP/Annotation.pm cp Files.pm blib/arch/B/Hooks/OP/Annotation/Install/Files.pm /usr/bin/perl.exe /usr/lib/perl5/5.14/ExtUtils/xsubpp -typemap /usr/l +ib/perl5/5.14/ExtUtils/typemap Annotation.xs > Annotation.xsc && mv +Annotation.xsc Annotation.c gcc-4 -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-strict-al +iasing -pipe -fstack-protector -DUSEIMPORTLIB -O3 -Wall -W -DVERSI +ON=\"0.44\" -DXS_VERSION=\"0.44\" "-I/usr/lib/perl5/5.14/i686-cygwi +n-threads-64int/CORE" Annotation.c Running Mkbootstrap for B::Hooks::OP::Annotation () chmod 644 Annotation.bs rm -f blib/arch/auto/B/Hooks/OP/Annotation/Annotation.dll g++-4 --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl +,--enable-auto-image-base -L/usr/local/lib -fstack-protector Annotati +on.o -o blib/arch/auto/B/Hooks/OP/Annotation/Annotation.dll \ /usr/lib/perl5/5.14/i686-cygwin-threads-64int/CORE/cygperl5_14.dll + \ chmod 755 blib/arch/auto/B/Hooks/OP/Annotation/Annotation.dll cp Annotation.bs blib/arch/auto/B/Hooks/OP/Annotation/Annotation.bs chmod 644 blib/arch/auto/B/Hooks/OP/Annotation/Annotation.bs Manifying blib/man3/B.Hooks.OP.Annotation.3pm PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "te +st_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01use.t .. ok t/pod.t .... ok All tests successful. Files=2, Tests=3, 3 wallclock secs ( 0.20 usr 0.36 sys + 0.82 cusr + 1.11 csys = 2.49 CPU) Result: PASS Files found in blib/arch: installing files in blib/lib into architectu +re dependent library tree Installing /usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/aut +o/B/Hooks/OP/Annotation/Annotation.dll Appending installation info to /usr/lib/perl5/5.14/i686-cygwin-threads +-64int/perllocal.pod -> OK Successfully reinstalled B-Hooks-OP-Annotation-0.44 1 distribution installed

This seems to indicate that the problem occured during the installation of B::Hooks::OP::Annotation: it wasn't installed in the right place, and i don't know why. In the Makefile of B::Hooks::OP::Annotation, "/lib" is never present without "usr" before it, except in one place:

INST_LIB = blib/lib
which seems normal : i found it in many other Makefiles.

And, the problem must be Cygwin specific: it doesn't happen in Linux, otherwise Devel::Pragma wouldn't install in Linux either.

One hint.
In Cygwin, the perl script (perl.exe) is NOT in /usr/bin/ like in Linux : it is in /bin/ (equivalent to C:/Cygwin/bin/). And the perl modules are installed in /bin/lib/perl5.

So, could it be that Cygwin installs modules in a different place than Linux, and that this is the sole reason why Devel::Pragma doesn't find B::Hooks::OP::Annotation?

* PS : I tried to cheat one last time, copying the content of

/usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto/B/
into
/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto/B/
but it didn't work either.

* PPS : I found this node Devel::Declare for cygwin; "undefined reference to '_hook_op_check'", which indicates a (fixed) similar problem with Devel::Declare. I was able to install Devel::Declare in Cygwin, so it's not the same problem. And i checked: i have the latest version of ExtUtils::Depends. But the problem could be there too...

I have also tried to delete manually the /lib/perl5/site_perl/i686-cygwin-threads-64int/auto/B/Hook/ folder and reinstall the three modules that were in there. It didn't fix my problem.


In reply to Investigating Devel::Pragma's broken install on Cygwin, need help to fix it. ExtUtils::Depends possibly guilty?? by mascip

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 00:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found