abseil / abseil/abseil-cpp

[Bug]: cmake installation does not set RPATH/RUNPATH

Offen
#1,594 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
18.1k
Forks
3.2k
Ø Merge
20 Std. 36 Min.
Gemergte PRs (30 T.)
1

Beschreibung

### Describe the issue

Downloading current absl and protobuf releases and compiling using cmake results in protoc not finding transitively linked absl libraries, because absl when installed via cmake does not set RPATH/RUNPATH of the libraries.

### Steps to reproduce the problem

```
$ curl -L https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.tar.gz | tar xz
$ cd abseil-cpp-20230802.1
$ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/.local/protobuf -DCMAKE_BUILD_TYPE=Release -DABSL_PROPAGATE_CXX_STD=ON -DBUILD_SHARED_LIBS=ON
$ cmake --build build
$ cmake --install build
$ cd ..
$ curl -L https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protobuf-25.1.tar.gz | tar xz
$ cd protobuf-25.1
$ CMAKE_PREFIX_PATH=~/.local/protobuf cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/.local/protobuf -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_ABSL_PROVIDER=package -DBUILD_SHARED_LIBS=ON
$ cmake --build build
% cmake --install build
$ ~/.local/protobuf/bin/protoc
/home/mnoethe/.local/protobuf/bin/protoc: error while loading shared libraries: libabsl_log_internal_globals.so.2308.0.0: cannot open shared object file: No such file or directory
```

### What version of Abseil are you using?

See above, latest release.

### What operating system and version are you using?

Linux (Ubuntu 22.04), but should not matter. RPATH is not set at all.

### What compiler and version are you using?

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

### What build system are you using?

$ cmake --version
cmake version 3.24.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

### Additional context

Calling cmake for the absl build with `-DCMAKE_INSTALL_RPATH='$ORIGIN'` works, for macOS it would be `@loader_path`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.