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

Greetings Monks,

I can't figure out how to get Device::USB installed on my computer. I have tried two machines, a 64-bit with Ubuntu 6.06 and a 32-bit with Ubuntu 7.10. Both seem to fail in the same way.

I initially downloaded Device-USB-0.29.tar.gz and extracted the files. Then, from "README" I tried:
perl Makefile.PL
make
make test
make install

I got the error message:
Can't locate Inline/MakeMaker.pm in @INC
Compilation aborted at Makefile.PL line 3

Using "find" I was able to find:
/usr/share/perl/5.8.7/ExtUtils/MakeMaker.pm

I then tried adding "push @INC, "/usr/share/perl/5.8.7/ExtUtils" high in the Makefile.PL code.
This didn't do any good.

Next (possibly unwise) I copied MakeMaker.pm to one of the directories in @INC. This changed my error message to:
Undefined sukbroutine &main::WriteMakefile called at MakeFile.PL line 50

After some Googling I came across:
# perl -MCPAN -e shell
cpan> install Device::USB
Inside the cpan> prompt I also tried "install MakeMaker.pm" and "i /MakeMaker.pm/". None of these worked.

A message high in the CPAN response was to "try install Bundle::CPAN". I did this. It must have run for 20 or more minutes. After all of that (I don't know what all it did) there was no improvement in my problem.

The response when I tried the install at the cpan> prompt was:
Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation (v1.7601) ReadLine support available (try 'install Bundle::CPAN') CPAN: Storable loaded ok Going to read /home/bxxxx/.cpan/Metadata Database was generated on Sat, 01 Aug 2009 21:26:58 GMT Running install for module Device::USB Running make for G/GW/GWADEJ/Device-USB-0.29.tar.gz CPAN: Digest::MD5 loaded ok Checksum for /home/bxxxx/.cpan/sources/authors/id/G/GW/GWADEJ/Device-U +SB-0.29.tar.gz ok Scanning cache /home/bxxxx/.cpan/build for sizes Device-USB-0.29/ Device-USB-0.29/Changes Device-USB-0.29/dump_usb.pl Device-USB-0.29/Makefile.PL Device-USB-0.29/MANIFEST.SKIP Device-USB-0.29/MANIFEST Device-USB-0.29/README Device-USB-0.29/USB.pm Device-USB-0.29/t/ Device-USB-0.29/t/17-usb_dev_endpoint.t Device-USB-0.29/t/00-load.t Device-USB-0.29/t/07-list_devices_if.t Device-USB-0.29/t/05-find_device_if.t Device-USB-0.29/t/02-find_busses_devices.t Device-USB-0.29/t/15-usb_dev_configuration.t Device-USB-0.29/t/06-list_devices.t Device-USB-0.29/t/09-usb-bus.t Device-USB-0.29/t/16-usb_dev_interface.t Device-USB-0.29/t/14-bus_list_devices_if.t Device-USB-0.29/t/11-usb-device-methods.t Device-USB-0.29/t/boilerplate.t Device-USB-0.29/t/04-find_device.t Device-USB-0.29/t/pod-coverage.t Device-USB-0.29/t/03-list_busses.t Device-USB-0.29/t/08-get_busses.t Device-USB-0.29/t/10-usb-device-accessors.t Device-USB-0.29/t/13-bus_find_device_if.t Device-USB-0.29/t/pod.t Device-USB-0.29/t/TestTools.pm Device-USB-0.29/t/12-constants.t Device-USB-0.29/t/18-usb_device-configurations.t Device-USB-0.29/t/01-create-usb.t Device-USB-0.29/META.yml Device-USB-0.29/lib/ Device-USB-0.29/lib/Device/ Device-USB-0.29/lib/Device/USB/ Device-USB-0.29/lib/Device/USB/DevConfig.pm Device-USB-0.29/lib/Device/USB/FAQ.pod Device-USB-0.29/lib/Device/USB/Device.pm Device-USB-0.29/lib/Device/USB/DevInterface.pm Device-USB-0.29/lib/Device/USB/DevEndpoint.pm Device-USB-0.29/lib/Device/USB/Bus.pm Device-USB-0.29/lib/Device/USB.pm Removing previously used /home/bxxxx/.cpan/build/Device-USB-0.29 CPAN.pm: Going to build G/GW/GWADEJ/Device-USB-0.29.tar.gz Running make test Make had some problems, maybe interrupted? Won't test Running make install Make had some problems, maybe interrupted? Won't install Terminal does not support GetHistory. Lockfile removed.

Any ideas would be appreciated,

Thank you,
Bruce

Replies are listed 'Best First'.
Re: trouble installing Device::USB
by syphilis (Archbishop) on Aug 02, 2009 at 06:47 UTC
    Can't locate Inline/MakeMaker.pm in @INC

    The 'perl Makefile.PL' step would have warned you that Inline is needed and can't be found.
    It pays to look for this type of warning in the 'perl Makefile.PL' output, and take action to fix the problem.

    I think that, with the automated CPAN.pm installation procedure, this type of shortcoming is attended to automatically, but when you do it manually, you need to attend to it yourself.

    Cheers,
    Rob
Re: trouble installing Device::USB
by Khen1950fx (Canon) on Aug 02, 2009 at 04:23 UTC
    First, reinstall ExtUtils::MakeMaker, Inline::MakeMaker, and Bundle::CPAN.

    Second, get the tarball for libusb here

    Third, run cpan -fi Device::USB

    Fourth, on my system, I have to run ldconfig after I finish make, make check, and make install of libusb:

    /sbin/ldconfig /usr/local/lib. I'm not quite sure how Ubuntu does it.

      Thanks for the reply. I tried the suggestions and still get the same error.

      I am digging into the files to try to get a clue, but I sure would appreciated more suggestions if anyone has any.

      So far one thing bothers me (besides not being able to do the install); all the MakeMaker.pm files on my machine seem to contain "package ExtUtils::MakeMaker". From what I have seen and the comments I received so far I was expecting at least one of them to contain "package Inline::MakeMaker". Is this a good assumption?

      Thanks,
      Bruce

        Inline::MakeMaker should be installed by the Inline package as I recall.

        The Device::USB dependencies include Inline::C which should have installed Inline::MakeMaker. I would try the following:

        1. Check to see if Inline is installed.
        2. Check to see if Inline::MakeMaker is installed.

        I suspect that Inline failed to install somehow. But that is just a guess.

        G. Wade
        Is this a good assumption?

        No - as has already been mentioned in this thread, Inline::MakeMaker is part of Inline. When installing Inline, you'll be prompted to install Inline::C (during the 'perl Makefile.PL' stage). Accept that prompt, and all should be fine.

        Cheers,
        Rob

        Yes, if you had installed the Inline::MakeMaker package, otherwise no, you will not find it.

        The best advice I can give you is try to revert the changes you made manually and install the package using cpan script. It is its work resolving the dependencies of the module and install all that is needed.

        Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

      The reinstalls seemed to go OK.
      .
      In response to:
      -fi Device::USB
      
      I get:
      Unknown shell command '-fi'. Type ? for help.
      
      Trying '-fix', 'cpan -fi' and 'cpan -fix' all get the "Unknown shell command" response.

      In response to:
      cpan> ?
      
      I get: I'm currently at a loss as to where to go next with this one.

      Thanks,

      Bruce

        cpan -fi Device::USB is done from the command-line. "-fi" is short for "force install". On the other hand, if you go into the CPAN shell, then you would use force install Device::USB.
Re: trouble installing Device::USB
by Anonymous Monk on Aug 02, 2009 at 04:14 UTC