[Nut-upsuser] UPS/NUT with openSUSE 13.1

Rob Groner rgroner at RTD.com
Tue Sep 22 21:21:35 UTC 2015


Thanks again Tim.

I installed openSUSE from scratch, without installing libusb anything.  I tried configure, and it failed because it couldn't find libusb.  I used ldconfig to see what the system could see.  It found 3 entries with "libusb" in them.

I then built and installed the last update of libusb-0.1 (not libusb-compat or libusb-1.0).  I tried configure, and it ran without errors.  I then execute ldconfig, and it was the same as before the install.

So configure is finding these libusb libraries, but ldconfig doesn't seem to know about them.

All  of this might be a goose chase, but Charles hinted that libusb might be part of the problem.  I had this working fine earlier this year and now it doesn't, and a changing version of libusb would explain that.  Plus, if I install openSUSE 13.1 AND install libusb* from the ISO, then it works.  It's just getting libusb from some other source that seems to be causing the problem.


Rob Groner
Software Engineer Level II

RTD Embedded Technologies, Inc.
ISO 9001 and AS9100 Certified
Ph: +1 814-234-8087
www.rtd.com

-----Original Message-----
From: Tim Dawson [mailto:tadawson at tpcsvc.com] 
Sent: Tuesday, September 22, 2015 4:52 PM
To: Rob Groner <rgroner at RTD.com>; nut-upsuser at lists.alioth.debian.org
Subject: Re: [Nut-upsuser] UPS/NUT with openSUSE 13.1

For fun, if you want to see where the system thinks it is linking a library from, you can use "ldconfig -p" and it will give you a path to all known libraries that it can find.  If you have one loaded, and it can't find it (odd directory, etc.) you can always amend "LD_LIBRARY_PATH" the same way as PKG_CONFIG_PATH I mentioned earlier . 
. . . PKG . . . is for the build system, and LD. . . is for the runtime dynamic linker.

- Tim


On 09/22/2015 03:48 PM, Rob Groner wrote:
> Tim,
>
> Thanks for the help!  No, I didn't already know that... I swear, the more time I spend at this, the less I seem to be understanding.
>
> I know that it had to be finding the libusb-compat I had just installed, because configure hadn't worked before that, and now it did.  But finding useful version information seems to be almost impossible.
>
> Rob Groner
> Software Engineer Level II
>
> RTD Embedded Technologies, Inc.
> ISO 9001 and AS9100 Certified
> Ph: +1 814-234-8087
> www.rtd.com
>
> -----Original Message-----
> From: Nut-upsuser 
> [mailto:nut-upsuser-bounces+rgroner=rtd.com at lists.alioth.debian.org] 
> On Behalf Of Tim Dawson
> Sent: Tuesday, September 22, 2015 3:56 PM
> To: nut-upsuser at lists.alioth.debian.org
> Subject: Re: [Nut-upsuser] UPS/NUT with openSUSE 13.1
>
> Rob -
> 	
> Just stepping in from the sidelines . . . with a few tidbits.
>
> Nut uses pkgconfig to find and identify stuff as part of it's build . .
> . So, depending on where your libusb install went, if it wasn't in the default "PKG_CONFIG_PATH" setting, it won't be found.  Much like other shell variables, you can adjust that setting to find anything you like .
> . .
> IE PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/new/component;export
> PKG_CONFIG_PATH (or as appropriate for the shell you use).
>
> Keep in mind that this is *NOT* the path where the library (.so or .a
> file) lives, but typically a directory *below* that with the pkgconfig 
> .pc files, typically "pkgconfig".  These .pc files tell the build 
> system what is available, and what version they are, so for libusb on 
> my system here libusb.pc (located in /usr/lib, PKG_CONFIG_DIR is
> /usr/lib/pkgconfig) is:
>
> prefix=/usr
> exec_prefix=${prefix}
> libdir=${exec_prefix}/lib
> includedir=${prefix}/include
>
> Name: libusb
> Description: USB access library
> Version: 0.1.12
> Libs: -L${libdir} -lusb
> Cflags: -I${includedir}
>
> This may help make sense of what version report, and how stuff gets found.  Then again, if you already know this, sorry . . .
>
> - Tim
>
>
> On 09/22/2015 02:47 PM, Rob Groner wrote:
>> Thanks Charles, you were right about that.
>>
>> Here is what I tried...I installed openSUSE 13.1 from scratch (which means no libusb).  I then took libusb-1.0 from the sourceforge site and built and installed it.  Still it got the "cannot find libusb" error.  So, looking at the sourceforge site, is see it mention that to work with the older libusb-0.1, you had to use libusb-compat-0.1.5.  So, I downloaded, built, and installed that...and now ./configure is working.
>>
>> I'm sure this is all obvious to you, but I only now sort of understand the relationship between libusb-1.0 and libusb-0.1.
>>
>> So, here is what I think I know:
>>
>> NUT is using the libusb-1.0.20 library, by way of the libusb-compat layer.  When I check the configure log, it says "libusb-0.1.12"  I'm not sure why it says that, as in where it gets that value, as that version doesn't correspond to anything I installed.  I see looking at the last version of libusb-0.1 that was available, it was libusb-0.1.12, so it must be getting that version number from the libusb-compat layer, as I did not install the old libusb-0.1.12 on this last test.
>>
>> After installing libusb-1.0 and the libusb-compat layer and rebuilding NUT...it still doesn't work (as in, the shutdown command is not passed to the UPS due to can't claim message for USB).
>>
>> I could try reinstalling openSUSE and installing the old libusb-0.1.12 and see if that works.  Perhaps it is the compat layer or the new libusb-1.0 that is the problem.
>>
>>
>> Rob Groner
>> Software Engineer Level II
>>
>> RTD Embedded Technologies, Inc.
>> ISO 9001 and AS9100 Certified
>> Ph: +1 814-234-8087
>> www.rtd.com
>>
>> -----Original Message-----
>> From: Charles Lepple [mailto:clepple at gmail.com]
>> Sent: Monday, September 21, 2015 7:30 PM
>> To: Rob Groner <rgroner at RTD.com>
>> Cc: Roger Price <roger at rogerprice.org>; nut-upsuser Mailing List 
>> <nut-upsuser at lists.alioth.debian.org>
>> Subject: Re: [Nut-upsuser] UPS/NUT with openSUSE 13.1
>>
>> On Sep 21, 2015, at 9:39 AM, Rob Groner <rgroner at RTD.com> wrote:
>>>
>>> I didn't think to look for a log (attached), but now looking in it, I don't see anything more than I already thought I knew.  It's as cryptic as configure itself.
>>>
>>> It does reference the line in the configure where the test for USB failed, but I'd already been looking in there.  I can't make sense of the lines above that set "nut_have_libusb", as far as what they're looking for.  Clearly somehow, that is supposed to be set to "yes".
>>
>> You have:
>>
>> ./configure --with-usb --with-dev
>> --with-usb-includes=/usr/local/include
>> --with-usb-libs=-L=/usr/local/lib64
>>
>> I think you want:
>>
>> ./configure --with-usb --with-dev
>> --with-usb-includes=-I/usr/local/include
>> --with-usb-libs=-L/usr/local/lib64
>>
>> The key lines in the compilation testing:
>>
>> configure:8062: gcc -o conftest /usr/local/include   conftest.c -L=/usr/local/lib64 >&5
>> /usr/local/include: file not recognized: Is a directory
>>
>>
>> _______________________________________________
>> Nut-upsuser mailing list
>> Nut-upsuser at lists.alioth.debian.org
>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
>>
>
> --
> ================================================================================
> Tim Dawson (tadawson at tpcsvc.com)                    Owner/Engineer
> TPC Services                                        Bellnet: (972)-221-7385
> Lewisville, Texas 75067
> "Gaff Tape can't fix 'Stupid', but it can muffle the sound..."
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
>

--
================================================================================
Tim Dawson (tadawson at tpcsvc.com)                    Owner/Engineer
TPC Services                                        Bellnet: (972)-221-7385
Lewisville, Texas 75067
"Gaff Tape can't fix 'Stupid', but it can muffle the sound..."



More information about the Nut-upsuser mailing list