gamemode icon indicating copy to clipboard operation
gamemode copied to clipboard

`libinih.so.0: cannot open shared object file` under Ubuntu 18.04

Open multimeric opened this issue 5 years ago • 3 comments

Describe the bug Following the build instructions explained in the readme under Ubuntu 18.04, the build will succeed, but running gamemoded will result in the error:

gamemoded: error while loading shared libraries: libinih.so.0: cannot open shared object file: No such file or directory

To Reproduce Steps used to reproduce the behavior:

  1. Install deps: apt install meson libsystemd-dev pkg-config ninja-build git libdbus-1-dev libinih-dev
  2. Compile gamemode:
git clone https://github.com/FeralInteractive/gamemode.git
cd gamemode
git checkout 1.6 # omit to build the master branch
./bootstrap.sh
  1. Run: gamemoded
  2. See error

Expected behavior Gamemode should not fail

System Info (please complete the following information):

  • OS and version: Ubuntu 18.04, Linux 4.19.34-041934-generic
  • GameMode Version: tag 1.6

Additional context I think the key to this issue is that gamemode has some kind of fallback mechanism for the ini parser (inih), which fails to actually install the parser library.

Specifically, the bootstrap script prints this:

Run-time dependency inih found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency inih

|Executing subproject inih method meson 
|
|Project name: inih
|Project version: 49
|C compiler for the host machine: cc (gcc 7.5.0 "cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0")
|C++ compiler for the host machine: c++ (gcc 7.5.0 "c++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0")
|Build targets in project: 8
|Subproject inih finished.

Dependency inih from subproject subprojects/inih found: YES

Therefore, my workaround was to manually copy the inih artifacts into /usr/lib:

cd builddir/subprojects/inih
sudo cp libinih.so* /usr/lib -P

This seemed to solve it.

multimeric avatar Dec 03 '20 22:12 multimeric

Worth noting that this is also an issue with raspbian 10/raspberry pi OS on the p400 device.

The given solution worked for me here too.

DanBuchan avatar Dec 16 '20 12:12 DanBuchan

Hm, might be due to inih r49 used, on master it shouldn't happen.

But this is an old distro problem anyway, all major distros now have inih.

stephanlachnit avatar Dec 26 '20 22:12 stephanlachnit

I believe I'm having the same or a similar issue, but the work around did not work for me. I'm running Linux Mint 19.3 (Ubuntu 18.04). I installed gamemode according to the instruction in the Ubuntu section of the readme, and I was able to use gamemode to increase the performance of a couple of steam games. Athough I had to use LD_PRELOAD="$LD_PRELOAD:/usr/$LIB/libgamemodeauto.so.0" to get it to work on steam. When I try to run gamemode on non-steam games, through the console, I get very similar error as the OP " ld.so: object '/usr/$LIB/libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored."

AlliedOasis1999 avatar Feb 20 '21 18:02 AlliedOasis1999