Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Build fails in Ubuntu 20.04 using gcc 13.2.0 #795

Open
codeapparat opened this issue Mar 12, 2024 · 4 comments
Open

[BUG] Build fails in Ubuntu 20.04 using gcc 13.2.0 #795

codeapparat opened this issue Mar 12, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@codeapparat
Copy link

Describe the bug
Can't compile btop under Ubuntu 20.04, using g++ 13.2.0,
it fails at linking time. When typing make I get:

PLATFORM ?| Linux
ARCH ?| x86_64
GPU_SUPPORT :| true
CXX ?| /opt/gcc-13.2.0/bin/g++ (13.2.0)
THREADS :| 6
REQFLAGS !| -std=c++20
WARNFLAGS :| -Wall -Wextra -pedantic
OPTFLAGS :| -O2 -ftree-vectorize -flto=6
LDCXXFLAGS :| -pthread -DFMT_HEADER_ONLY -D_GLIBCXX_ASSERTIONS -D_FILE_OFFSET_BITS=64 -fexceptions -fstack-clash-protection -fcf-protection -fstack-protector -DGPU_SUPPORT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
CXXFLAGS +| $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
LDFLAGS +| $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)

Building btop++ (v1.3.2) Linux x86_64
Command 'lowdown' not found: skipping generating man page btop.1
...
Configuring obj/config.h
Compiling src/btop.cpp
Compiling src/btop_menu.cpp
Compiling src/btop_input.cpp
Compiling src/btop_shared.cpp
Compiling src/btop_draw.cpp
...
Linking and optimizing binary...
/usr/bin/ld: /tmp/ccj2IUfF.ltrans17.ltrans.o: in function Shared::init()': <artificial>:(.text+0x5cf7): undefined reference to dlopen'
/usr/bin/ld: :(.text+0x5d12): undefined reference to dlopen' /usr/bin/ld: <artificial>:(.text+0x611b): undefined reference to dlerror'
/usr/bin/ld: /tmp/ccj2IUfF.ltrans23.ltrans.o: in function Gpu::Rsmi::init()::{lambda(char const*)#1}::operator()(char const*) const [clone .isra.0]': <artificial>:(.text+0x19): undefined reference to dlsym'
/usr/bin/ld: :(.text+0x21): undefined reference to dlerror' /usr/bin/ld: /tmp/ccj2IUfF.ltrans23.ltrans.o: in function Gpu::Nvml::init()::{lambda(char const*)#1}::operator()(char const*) const [clone .isra.0]':
:(.text+0x4a4d): undefined reference to dlsym' /usr/bin/ld: <artificial>:(.text+0x4a55): undefined reference to dlerror'
/usr/bin/ld: /tmp/ccj2IUfF.ltrans23.ltrans.o: in function Gpu::Rsmi::init() [clone .isra.0]': <artificial>:(.text+0x4c50): undefined reference to dlopen'
/usr/bin/ld: :(.text+0x4c6a): undefined reference to dlerror' /usr/bin/ld: /tmp/ccj2IUfF.ltrans23.ltrans.o: in function Gpu::Nvml::shutdown() [clone .isra.0]':
:(.text+0x4974): undefined reference to dlclose' /usr/bin/ld: /tmp/ccj2IUfF.ltrans23.ltrans.o: in function Gpu::Rsmi::shutdown() [clone .isra.0]':
:(.text+0x4bcc): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make: *** [Makefile:383: btop] Error 1

To Reproduce
Ubuntu 20.04, compile gcc 13.2.0 and set CXX to the new g++ binary.

git clone https://github.com/aristocratos/btop.git
cd btop
make CXX=/opt/gcc-13.2.0/bin/g++

Expected behavior
btop binary gets created after make

Info (please complete the following information):

  • btop++ version: 1.3.2 (from git)
  • Architecture: x86_64
  • Platform: Ubuntu 20.04
  • Linux Kernel: 5.8.0-63-generic

Thank you very much, for this amazing tool!

@codeapparat codeapparat added the bug Something isn't working label Mar 12, 2024
@imwints
Copy link
Contributor

imwints commented Mar 12, 2024

Read the README.md and search for similar issues before posting a bug report!

Duplicate of #704 #725 #730

Please upgrade to a newer version of your distro.

@alalazo
Copy link

alalazo commented Mar 14, 2024

@imwints Maybe getting four duplicates of the same issue means the use case is not as unusual as was initially thought?

@arubin
Copy link

arubin commented Sep 25, 2024

For reference, I solved this issue by adding the line:
target_link_libraries(btop dl)
To the linking section towards the end of CMakeLists.txt

@alalazo
Copy link

alalazo commented Sep 25, 2024

@arubin See #725 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants