Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Problem make'ing Device::USB on osx Snow Leopard 10.6.2

by nick.fox (Novice)
on Jan 16, 2010 at 18:15 UTC ( [id://817786]=perlquestion: print w/replies, xml ) Need Help??

nick.fox has asked for the wisdom of the Perl Monks concerning the following question:

Hi all

I have been trying to install Device:USB. I can do it fine on ubuntu in a virtual environment but 10.6 seems to compile differently.

Could someone point me in the right direction?

This is the make error...

checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking build system type... i686-apple-darwin10.2.0 checking host system type... i686-apple-darwin10.2.0 checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /usr/bin/sed checking for egrep... grep -E checking for ld used by gcc... /usr/libexec/gcc/i686-apple-darwin10/4. +2.1/ld checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld) + is GNU ld... no checking for /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld option to r +eload object files... -r checking for BSD-compatible nm... /usr/bin/nm checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes rm: conftest.dSYM: is a directory checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for epcf90... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for gfortran... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 65536 checking command to parse /usr/bin/nm output from gcc object... rm: co +nftest.dSYM: is a directory rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc static flag works... rm: conftest.dSYM: is a director +y yes checking if gcc supports -fno-rtti -fno-exceptions... rm: conftest.dSY +M: is a directory no checking for gcc option to produce PIC... -fno-common checking if gcc PIC flag -fno-common works... rm: conftest.dSYM: is a +directory yes checking if gcc supports -c -o file.o... rm: conftest.dSYM: is a direc +tory yes checking whether the gcc linker (/usr/libexec/gcc/i686-apple-darwin10/ +4.2.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin10.2.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/libexec/gcc/i686-apple-darwin10/4. +2.1/ld checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld) + is GNU ld... no checking whether the g++ linker (/usr/libexec/gcc/i686-apple-darwin10/ +4.2.1/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fno-common checking if g++ PIC flag -fno-common works... rm: conftest.dSYM: is a +directory yes checking if g++ supports -c -o file.o... rm: conftest.dSYM: is a direc +tory yes checking whether the g++ linker (/usr/libexec/gcc/i686-apple-darwin10/ +4.2.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin10.2.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes appending configuration tag "F77" to libtool checking for what USB OS support... Darwin and/or MacOS 10 checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ANSI C... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking whether gcc and cc understand -c and -o together... rm: conft +est.dSYM: is a directory yes checking for a BSD-compatible install... /usr/bin/install -c checking for ANSI C header files... (cached) yes checking for vprintf... yes checking for _doprnt... no checking for an ANSI C-conforming const... yes checking whether byte ordering is bigendian... no checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for unistd.h... (cached) yes checking values.h usability... no checking values.h presence... no checking for values.h... no checking for memmove... yes checking for pkg-config... /opt/local/bin/pkg-config checking if we should build the documentation... auto checking for jade... no checking for openjade... no checking for Doxygen tools... checking for dot... not found checking for doxygen... not found configure: WARNING: Documentation build components not installed. sgml + docs will not be built configure: creating ./config.status config.status: creating Makefile config.status: creating doc/Makefile config.status: creating libusb.spec config.status: creating libusb-config config.status: creating libusb.pc config.status: creating tests/Makefile config.status: creating README config.status: creating INSTALL.libusb config.status: creating usb.h config.status: creating Doxyfile config.status: creating config.h config.status: executing depfiles commands config.status: executing default commands make all-recursive Making all in . if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -Werror + -no-cpp-precomp -g -O2 -g -Wall -MT usb.lo -MD -MP -MF ".deps/usb.Tp +o" -c -o usb.lo usb.c; \ then mv -f ".deps/usb.Tpo" ".deps/usb.Plo"; else rm -f ".deps/usb. +Tpo"; exit 1; fi mkdir .libs gcc -DHAVE_CONFIG_H -I. -Werror -no-cpp-precomp -g -O2 -g -Wall -MT u +sb.lo -MD -MP -MF .deps/usb.Tpo -c usb.c -fno-common -DPIC -o .libs/ +usb.o gcc -DHAVE_CONFIG_H -I. -Werror -no-cpp-precomp -g -O2 -g -Wall -MT u +sb.lo -MD -MP -MF .deps/usb.Tpo -c usb.c -o usb.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -Werror + -no-cpp-precomp -g -O2 -g -Wall -MT error.lo -MD -MP -MF ".deps/erro +r.Tpo" -c -o error.lo error.c; \ then mv -f ".deps/error.Tpo" ".deps/error.Plo"; else rm -f ".deps/ +error.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -Werror -no-cpp-precomp -g -O2 -g -Wall -MT e +rror.lo -MD -MP -MF .deps/error.Tpo -c error.c -fno-common -DPIC -o +.libs/error.o gcc -DHAVE_CONFIG_H -I. -Werror -no-cpp-precomp -g -O2 -g -Wall -MT e +rror.lo -MD -MP -MF .deps/error.Tpo -c error.c -o error.o >/dev/null +2>&1 if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -Werror + -no-cpp-precomp -g -O2 -g -Wall -MT descriptors.lo -MD -MP -MF ".dep +s/descriptors.Tpo" -c -o descriptors.lo descriptors.c; \ then mv -f ".deps/descriptors.Tpo" ".deps/descriptors.Plo"; else r +m -f ".deps/descriptors.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -Werror -no-cpp-precomp -g -O2 -g -Wall -MT d +escriptors.lo -MD -MP -MF .deps/descriptors.Tpo -c descriptors.c -fn +o-common -DPIC -o .libs/descriptors.o gcc -DHAVE_CONFIG_H -I. -Werror -no-cpp-precomp -g -O2 -g -Wall -MT d +escriptors.lo -MD -MP -MF .deps/descriptors.Tpo -c descriptors.c -o d +escriptors.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -Werror + -no-cpp-precomp -g -O2 -g -Wall -MT darwin.lo -MD -MP -MF ".deps/dar +win.Tpo" -c -o darwin.lo darwin.c; \ then mv -f ".deps/darwin.Tpo" ".deps/darwin.Plo"; else rm -f ".dep +s/darwin.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -Werror -no-cpp-precomp -g -O2 -g -Wall -MT d +arwin.lo -MD -MP -MF .deps/darwin.Tpo -c darwin.c -fno-common -DPIC +-o .libs/darwin.o cc1: warnings being treated as errors darwin.c: In function 'usb_get_next_device': darwin.c:257: warning: passing argument 5 of 'IOCreatePlugInInterfaceF +orService' from incompatible pointer type darwin.c: In function 'claim_interface': darwin.c:560: warning: passing argument 5 of 'IOCreatePlugInInterfaceF +orService' from incompatible pointer type darwin.c: In function 'rw_completed': darwin.c:772: warning: cast from pointer to integer of different size darwin.c:772: warning: format '%lu' expects type 'long unsigned int', +but argument 4 has type 'unsigned int' darwin.c:774: warning: cast from pointer to integer of different size darwin.c: In function 'usb_os_find_devices': darwin.c:1067: warning: format '%08lx' expects type 'long unsigned int +', but argument 3 has type 'UInt32' darwin.c:1095: warning: format '%08lx' expects type 'long unsigned int +', but argument 5 has type 'UInt32' make[2]: *** [darwin.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2

Replies are listed 'Best First'.
Re: Problem make'ing Device::USB on osx Snow Leopard 10.6.2
by Anonymous Monk on Jan 16, 2010 at 21:42 UTC
    That doesn't look like Device::USB

      You are indeed correct, i copied from the wrong terminal. the following is the correct make error from Device::USB. sorry about that.

      Also, Just to elaborate a little, when building Device::USB on ubuntu 9.10 it requires libusb v0.1.12 LEGACY. it seems that Device::USB requires the usb.h C header which is either not present in the latest version of libusb or has a different name.

      im starting to think my problems are more to do with this dependency than Device::USB itself.

        I think you are correct, because this:

        Note (probably harmless): No library found for -lusb

        indicates that libusb was not found at all.

        ...requires the usb.h C header which is either not present in the latest version of libusb or has a different name.
        Actually, it looks as if you have multiple versions of usb.h (hence, multiple installs of libusb) that are being detected. Look carefully through the output you posted and you see lots of things like this:
        USB.xs:16: error: conflicting types for ‘libusb_init’ /opt/local/include/libusb-1.0/usb.h:768: error: previous declaration o +f ‘libusb_init’ was here
        Now you just need to find the competing version, but I don't see anything in your posted output to help solve that problem.

        Update: I looked right past the point Corion mentions, so obviously I don't have the full story. You may need to tweak some settings in Makefile.PL to properly detect the one version of libusb that you want to use.

        Update 2: It looks like you are using MacPorts to supply libusb. Since MacPorts has multiple versions available, I'm betting that you have both the "stable" and the "legacy" versions installed, which is why usb.h is found more than once. I don't use MacPorts, so I can't offer any advice about what's the best way out of this, but I do think you need to tell Makefile.PL where to find what it's looking for.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://817786]
Approved by zwon
Front-paged by biohisham
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-24 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found