How to set env variables for installer to find path to libraries?

This is a subset of another thread but it seems to be a question in of itself that i need to know the answer to for a few different steps so I’m splitting it out.

I’m getting told when compiling a driver that to see library that it needs to have an env variable set. Setting a variable is not so hard but how do know what exactly to set it to? I’m gathering it’s a path to the library so what it comes down to is knowing exactly what that path is – I think?

Anyway, here’s the message:

drivers@quark:~/drivers/ceton/ctntad-0.2.1> ./configure --prefix=/user
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu



checking for USB… configure: error: Package requirements (libusb-1.0 >= 1.0.0) were not met:

No package ‘libusb-1.0’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables USB_CFLAGS
and USB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I’m guessing that once I know the path I can then do something like this:

export USB_CFLAGS=/some/path; /configure --prefix=/user

You need a devel version of the lib

I already added it, it made no difference to the message, there’s more to it than just adding dev. versions of programs.

On 2015-05-07 22:16, Reg gie wrote:

> Anyway, here’s the message:
>>
>> drivers@quark:~/drivers/ceton/ctntad-0.2.1> ./configure --prefix=/user
>> --with-internal-glib

/user? Not /usr?

>> See the pkg-config man page for more details.

Maybe here you could find what to set them to…


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Show rpm -q output for package you added.

When I see an error like that (libusb not found),
I typically first verify whether it’s installed and the version with the following which is generic (yes, it might be faster to probe the system but this is a generic approach)

zypper se libusb

If an actual package with version doesn’t exist, then

zypper se --provides libusb

After verifying the package providing the “missing” file exists on your system you can also look for the specific location of the file

rpm -ql packagename

If you can do all of the above and locate a usable library file, then it’s not actually missing and is likely installed in a standard configured path so should be automatically discoverable without special additional configuration.

If the file isn’t found, then find an appropriate package and install it.

Nowadays, that’s usually about all that has to be done.
In “the old days” with earlier openSUSE, sometimes special libraries would be installed into unusual (or distro-specific) paths, and then you’d need to modify various env variables.
But for something as likely common as “lsusb >= 1.0” I’m guessing it already exists and is installed on your system, so as arvidjaar suggests, you may want to post your entire stdout.

TSU

quark:~ # rpm -q libusb-0_1-4
libusb-0_1-4-0.1.13-30.1.2.x86_64
quark:~ # rpm -q libusb-1_0-0 
libusb-1_0-0-1.0.19-2.1.2.x86_64
quark:~ # rpm -q libusb
libusb-0_1-4        libusb-1_0-0        libusbmuxd2         libusbredirhost1    libusbredirparser1

So this is what I get with the above command…thanks for walking me through this. Once I have been through this once and have it working I am sure this will help many times over in the future.

quark:~ # zypper se libusb
Retrieving repository 'packman-essentials' metadata ............................................................[done]
Building repository 'packman-essentials' cache .................................................................[done]
Loading repository data...
Reading installed packages...

S | Name                         | Summary                                                             | Type      
--+------------------------------+---------------------------------------------------------------------+-----------
  | libhidapi-libusb0-debuginfo  | Debug information for package libhidapi-libusb0                     | package   
  | libusb-0_1-4-debuginfo       | Debug information for package libusb-0_1-4                          | package   
  | libusb-1_0-0-debuginfo       | Debug information for package libusb-1_0-0                          | package   
  | libusb-1_0-debugsource       | Debug sources for package libusb-1_0                                | package   
  | libusb-compat-debugsource    | Debug sources for package libusb-compat                             | package   
  | libusbmuxd-debugsource       | Debug sources for package libusbmuxd                                | package   
  | libusbmuxd2-debuginfo        | Debug information for package libusbmuxd2                           | package   
  | libusbprog0-debuginfo        | Debug information for package libusbprog0                           | package   
  | libusbredirhost1-debuginfo   | Debug information for package libusbredirhost1                      | package   
  | libusbredirparser1-debuginfo | Debug information for package libusbredirparser1                    | package   
  | libusb-0_1-4-debuginfo-32bit | Debug information for package libusb-0_1-4                          | package   
  | libusb-1_0-0-debuginfo-32bit | Debug information for package libusb-1_0-0                          | package   
  | libusbmuxd2-debuginfo-32bit  | Debug information for package libusbmuxd2                           | package   
  | libhidapi-libusb0            | Simple library for communicating with USB and Bluetooth HID devices | package   
i | libusb-0_1-4                 | libusb-1.0 Compatibility Library for libusb-0.1                     | package   
i | libusb-1_0-0                 | USB Library                                                         | package   
  | libusb-1_0-devel             | USB Library                                                         | package   
  | libusb-compat-devel          | libusb-1.0 Compatibility Layer for libusb-0.1                       | package   
  | libusbmuxd-devel             | Development files for libusbmuxd                                    | package   
i | libusbmuxd2                  | A client library to multiplex connections from and to iOS devices   | package   
  | libusbprog0                  | USBprog Library                                                     | package   
i | libusbredirhost1             | A protocol for redirection USB traffic                              | package   
i | libusbredirparser1           | A protocol for redirection USB traffic                              | package   
  | libusb-0_1-4-32bit           | libusb-1.0 Compatibility Library for libusb-0.1                     | package   
  | libusb-1_0-0-32bit           | USB Library                                                         | package   
  | libusb-1_0-devel-32bit       | USB Library                                                         | package   
  | libusbmuxd2-32bit            | A client library to multiplex connections from and to iOS devices   | package   
  | libusb-1_0                   | USB Library                                                         | srcpackage
  | libusb-compat                | libusb-1.0 Compatibility Layer for libusb-0.1                       | srcpackage
  | libusbmuxd                   | A client library to multiplex connections from and to iOS devices   | srcpackage
quark:~ # 

Seeing if I can make this output a little nicer (learning what works here.)

S | Name                         | Summary                                                             | Type       --+------------------------------+---------------------------------------------------------------------+-----------   | libhidapi-libusb0-debuginfo  | Debug information for package libhidapi-libusb0                     | package      | libusb-0_1-4-debuginfo       | Debug information for package libusb-0_1-4                          | package      | libusb-1_0-0-debuginfo       | Debug information for package libusb-1_0-0                          | package      | libusb-1_0-debugsource       | Debug sources for package libusb-1_0                                | package      | libusb-compat-debugsource    | Debug sources for package libusb-compat                             | package      | libusbmuxd-debugsource       | Debug sources for package libusbmuxd                                | package      | libusbmuxd2-debuginfo        | Debug information for package libusbmuxd2                           | package      | libusbprog0-debuginfo        | Debug information for package libusbprog0                           | package      | libusbredirhost1-debuginfo   | Debug information for package libusbredirhost1                      | package      | libusbredirparser1-debuginfo | Debug information for package libusbredirparser1                    | package      | libusb-0_1-4-debuginfo-32bit | Debug information for package libusb-0_1-4                          | package      | libusb-1_0-0-debuginfo-32bit | Debug information for package libusb-1_0-0                          | package      | libusbmuxd2-debuginfo-32bit  | Debug information for package libusbmuxd2                           | package      | libhidapi-libusb0            | Simple library for communicating with USB and Bluetooth HID devices | package    i | libusb-0_1-4                 | libusb-1.0 Compatibility Library for libusb-0.1                     | package    i | libusb-1_0-0                 | USB Library                                                         | package      | libusb-1_0-devel             | USB Library                                                         | package      | libusb-compat-devel          | libusb-1.0 Compatibility Layer for libusb-0.1                       | package      | libusbmuxd-devel             | Development files for libusbmuxd                                    | package    i | libusbmuxd2                  | A client library to multiplex connections from and to iOS devices   | package      | libusbprog0                  | USBprog Library                                                     | package    i | libusbredirhost1             | A protocol for redirection USB traffic                              | package    i | libusbredirparser1           | A protocol for redirection USB traffic                              | package      | libusb-0_1-4-32bit           | libusb-1.0 Compatibility Library for libusb-0.1                     | package      | libusb-1_0-0-32bit           | USB Library                                                         | package      | libusb-1_0-devel-32bit       | USB Library                                                         | package      | libusbmuxd2-32bit            | A client library to multiplex connections from and to iOS devices   | package      | libusb-1_0                   | USB Library                                                         | srcpackage   | libusb-compat                | libusb-1.0 Compatibility Layer for libusb-0.1                       | srcpackage   | libusbmuxd                   | A client library to multiplex connections from and to iOS devices   | srcpackage 

Hi
So libusb-1_0-devel needs to be installed (no ‘i’ alongside it to show being installed);


zypper in libusb-1_0-devel

Also make sure your prefix is /usr not /user…

You don’t have the devel packages. You must have them to use the libraries in a build. In essence it is for the most part the the *.h files that define the interface to the library. This lets the program you are compiling to know how to talk to the library

That’s not development package.