2

dnf search linput and dnf search lgbm don't yield any results. How can I get these in Fedora?

Edit: Backstory

I'm trying to build a Rust program, but it won't compile because apparently I'm missing some things. It said:

  = note: /usr/bin/ld: cannot find -lxkbcommon
          /usr/bin/ld: cannot find -lxkbcommon
          /usr/bin/ld: cannot find -linput
          /usr/bin/ld: cannot find -lgbm
          collect2: error: ld returned 1 exit status

I installed lxkbcommon (edit: I actually installed libxkbcommon. Not sure how I missed that.) via dnf install libxkbcommon-devel and then the output looked like this:

  = note: /usr/bin/ld: cannot find -linput
          /usr/bin/ld: cannot find -lgbm
          collect2: error: ld returned 1 exit status

So I figured I needed something called linput and lgbm as well, only I cannot find those with dnf search and I'm coming up empty-handed with google.

  • I don't understand why I got downvoted. I googled "fedora linput", "linux linput", and "linux input" hoping to find some repository I could add to dnf or find whatever package it lives in so I can install it. Nothing comes up. – Rokit Mar 17 at 19:24
  • Could you give a little backstory as to how you came across those packages? Why do you believe they exist and are called that? – Jeff Schaller Mar 17 at 19:39
  • @JeffSchaller Question updated. – Rokit Mar 17 at 19:54
  • 4
    That is an excellent update, thank you! It helps potential answerers understand why you want what you're asking for and what the potential misunderstanding(s) are. – Jeff Schaller Mar 17 at 19:55
  • 2
    It's important to be careful how you word things here; there's a phenomenon known as an "XY problem" where you think you need "X" but it turns out you really need "Y". If, for example, there happened to be a Fedora repo named "lgbm", an answerer could have solved your apparent problem by showing how to add that repo, when in reality your problem lies with compiling a rust program and having ld complain about missing libraries. (I may have swapped "X" and "Y", but I hope you followed) – Jeff Schaller Mar 17 at 19:59
4

What you are getting are error messages from the linker (ld), which is complaining that the libraries you are looking for are not available.

A message such as /usr/bin/ld: cannot find -linput actually means it was looking for a file named libinput.so. The -l flag is a command-line argument (to ld or to gcc) that expects the library name to follow and then the library name is used to form the file name which includes the lib prefix and the .so suffix (for dynamically loadable library, which is what is typically used in most distributions, Fedora included.)

So it turns out that the files you need are libinput.so and libgbm.so.

You can then use dnf provides to search for those files. Assuming you're using a 64-bit distribution, these libraries would be in /usr/lib64, so the full commands would be:

$ dnf provides /usr/lib64/libinput.so
libinput-devel-1.12.6-3.fc30.x86_64 : Development files for libinput
Repo        : rawhide
Matched from:
Filename    : /usr/lib64/libinput.so

$ dnf provides /usr/lib64/libgbm.so
mesa-libgbm-devel-19.0.0~rc7-1.fc30.x86_64 : Mesa libgbm development package
Repo        : rawhide
Matched from:
Filename    : /usr/lib64/libgbm.so

If you don't know the exact directory, you can also use dnf provides '*/libinput.so' or other wildcards if you know even less information about the files you want to search (and are willing to sort through more search results in look for something useful.)

In your case, it seems what you need is to:

$ sudo dnf install libinput-devel mesa-libgbm-devel

From that point on, dnf should also bring all other dependencies you need. Hopefully this is all you're missing to build the software you're building. But if you have further issues of missing libraries, using this information you might be able to find packages that ship those, assuming they're available in Fedora.

  • 3
    Excellent providing-of-fish and teaching-how-to-fish! – Jeff Schaller Mar 17 at 21:07
  • That did it! Thanks for the excellent answer. I have one question regarding the dnf search '*/libinput.so. When I execute that command I get a > in the terminal which is waiting for more input. I was expecting just a longer list. What does it need there? – Rokit Mar 17 at 21:34
  • 1
    @Rokit sorry I missed the closing quote in that command... Should have been dnf provides '*/libinput.so'. I fixed the answer to correct that. Glad this solved the issue you were having! – filbranden Mar 17 at 21:39
  • 1
    Also, should have been provides (looks for files in the package) rather than search (looks for terms in package name and description.) Answer updated for that as well! – filbranden Mar 17 at 21:41
0

If this is the same thing I found related to this:

https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html

lightGBM is a gradient boosting framework that uses tree-based learning algorithms. It is designed to be distributed and efficient with the following advantages:

  • Faster training speed and higher efficiency.
  • Lower memory usage.
  • Better accuracy.
  • Support of parallel and GPU learning.
  • Capable of handling large-scale data.

On Linux LightGBM can be built using CMake and gcc or Clang.

Install CMake.

Run the following commands:

git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
cmake ..
make -j4
  • good so far; are you able to address the -linput portion? – Jeff Schaller Mar 17 at 20:31
  • 1
    I think in this case -lgbm wants the "Generic Buffer Management" API of Mesa for graphics rendering, which can be found in the mesa-libgbm package in Fedora. Also, typically my first advice is to look for an available package in your own distro (in this case, Fedora) rather than building from source. When available from the distro, life is much easier... – filbranden Mar 17 at 20:54
  • 2
    I just built LightGBM. I also needed gcc-c++. How do I install it once it is built? I've always just installed packages via a package manager of some sort, never built from source. I also already had mesa-libgbm installed. Thanks for the help! – Rokit Mar 17 at 21:04
  • 1
    @Rokit just a side note: after using make it is usually possible (if the authors included an install target) to use make install (or sudo make install if the Makefile wants to install system-wide) to copy the built objects to useful directories, but note that make install can be difficult to undo in many cases – cat Mar 17 at 21:52
  • 1
    @Rokit if there's no install target (make: no rule to make target install) then you'll have to copy the built objects to the right folders yourself – cat Mar 17 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.