Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: How to link to OpenCV goodies for PERL5

by hbm (Hermit)
on Jun 09, 2013 at 18:53 UTC ( [id://1037949]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to link to OpenCV goodies for PERL5
in thread How to link to OpenCV goodies for PERL5

When you install modules with CPAN, the source is first downloaded to your .cpan directory - should be in the home directory of whatever account you installed with.

  1. 'find' or 'locate' the source (under the author)
  2. Change to that directory
  3. /path/to/perl Makefile.PL
  4. make > make.log 2>&1

Hopefully make.log will then get you closer to the root cause.

  • Comment on Re^3: How to link to OpenCV goodies for PERL5

Replies are listed 'Best First'.
Re^4: How to link to OpenCV goodies for PERL5
by freddythunder (Novice) on Jun 10, 2013 at 02:59 UTC

    Thank you for your help. I did what you said and here is what was outputted into make.log:

    freddythunder@tacofever:~/cpan/objdetectsrc$ more make.log cp lib/Image/ObjectDetect.pm blib/lib/Image/ObjectDetect.pm cp lib/Image/ObjectDetect.xs blib/lib/Image/ObjectDetect.xs /usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/shar +e/perl/5.14/ExtUtils/typemap ObjectDetect.xs > ObjectDetect.xsc && m +v ObjectDetect. xsc ObjectDetect.c cc -c -I/usr/local/include/opencv -I/usr/local/include -Isrc -I/usr +/local/include/opencv -I/usr/local/include -O2 -g -DVERSION=\"0.1 +2\" -DXS_VERSIO N=\"0.12\" -fPIC "-I/usr/lib/perl/5.14/CORE" ObjectDetect.c Running Mkbootstrap for Image::ObjectDetect () chmod 644 ObjectDetect.bs rm -f blib/arch/auto/Image/ObjectDetect/ObjectDetect.so cc -shared -L/usr/local/lib -fstack-protector ObjectDetect.o -o blib +/arch/auto/Image/ObjectDetect/ObjectDetect.so \ \ chmod 755 blib/arch/auto/Image/ObjectDetect/ObjectDetect.so cp ObjectDetect.bs blib/arch/auto/Image/ObjectDetect/ObjectDetect.bs chmod 644 blib/arch/auto/Image/ObjectDetect/ObjectDetect.bs Manifying blib/man3/Image::ObjectDetect.3pm

    I also had read somewhere about 'make test' which I remember the output of that happening before (but I don't remember at what point) but the test fails:

    freddythunder@tacofever:~/cpan/objdetectsrc$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/00_compile.t .. 1/2 # Failed test 'use Image::ObjectDetect;' # at t/00_compile.t line 7. # Tried to use 'Image::ObjectDetect'. # Error: Can't load '/home/freddythunder/cpan/objdetectsrc/blib/a +rch/auto/Image/ObjectDetect/ObjectDetect.so' for module Image::Object +Detect: /home/freddythunder/cpan/objdetectsrc/blib/arch/auto/Image/Ob +jectDetect/ObjectDetect.so: undefined symbol: cvHaarDetectObjects at +/usr/lib/perl/5.14/DynaLoader.pm line 184. # at /home/freddythunder/cpan/objdetectsrc/blib/lib/Image/ObjectDetec +t.pm line 19 # BEGIN failed--compilation aborted at /home/freddythunder/cpan/objdet +ectsrc/blib/lib/Image/ObjectDetect.pm line 19. # Compilation failed in require at (eval 4) line 2. # BEGIN failed--compilation aborted at (eval 4) line 2. # Failed test 'Image::ObjectDetect->can('xs_detect')' # at t/00_compile.t line 8. # Image::ObjectDetect->can('xs_detect') failed # Looks like you failed 2 tests of 2. t/00_compile.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/2 subtests t/01_detect.t ... Can't load '/home/freddythunder/cpan/objdetectsrc/bl +ib/arch/auto/Image/ObjectDetect/ObjectDetect.so' for module Image::Ob +jectDetect: /home/freddythunder/cpan/objdetectsrc/blib/arch/auto/Imag +e/ObjectDetect/ObjectDetect.so: undefined symbol: cvHaarDetectObjects + at /usr/lib/perl/5.14/DynaLoader.pm line 184. at /home/freddythunder/cpan/objdetectsrc/blib/lib/Image/ObjectDetect. +pm line 19 BEGIN failed--compilation aborted at /home/freddythunder/cpan/objdetec +tsrc/blib/lib/Image/ObjectDetect.pm line 19. Compilation failed in require at t/01_detect.t line 5. BEGIN failed--compilation aborted at t/01_detect.t line 5. t/01_detect.t ... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Test Summary Report ------------------- t/00_compile.t (Wstat: 512 Tests: 2 Failed: 2) Failed tests: 1-2 Non-zero exit status: 2 t/01_detect.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=2, Tests=2, 0 wallclock secs ( 0.09 usr 0.02 sys + 0.14 cusr + 0.04 csys = 0.29 CPU) Result: FAIL Failed 2/2 test programs. 2/2 subtests failed. make: *** [test_dynamic] Error 255

      What do you get as output of pkg-config opencv --libs

      It seems suspicious that your make log lacks some form of -lopencv or libopencv.a or some such

      seems odd that you'd have ...include/opencv but no libopencv

        freddythunder@tacofever:~$ pkg-config opencv --libs /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.s +o /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2 +d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.s +o /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgpro +c.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.s +o /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdet +ect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_sti +tching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopen +cv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_v +ideostab.so

        Funny you should mention that, that is what I found on stack overflow I have to put that in the g++ commands to compile. Even though it is working maybe I did the initial opencv compile wrong...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1037949]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found