You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Ubuntu 20.04 (g++-10), when compiling from the v1.3.0 tag (I also tested on main) with GPU_SUPPORT enabled (NVIDIA), the default makefile does not include the linker flag -ldl and therefore does not compile. Adding -ldl solves this problem.
To Reproduce
git clone https://github.com/aristocratos/btop.git
cd btop
git checkout v1.3.0 (optional)
CXX=g++-10 make
I expect the compilation to resolve successfully. Below I have attached a screenshot and a log of the error message.
Text Log
/usr/bin/ld: /tmp/btop.c8wIWg.ltrans16.ltrans.o: in function `Shared::init()':
<artificial>:(.text+0x6608): undefined reference to `dlopen'
/usr/bin/ld: <artificial>:(.text+0x6629): undefined reference to `dlopen'
/usr/bin/ld: <artificial>:(.text+0x663e): undefined reference to `dlerror'
/usr/bin/ld: /tmp/btop.c8wIWg.ltrans22.ltrans.o: in function `Gpu::Nvml::init()::{lambda(char const*)#1}::operator()(char const*) const [clone .constprop.0]':
<artificial>:(.text+0x1b6f): undefined reference to `dlsym'
/usr/bin/ld: <artificial>:(.text+0x1b77): undefined reference to `dlerror'
/usr/bin/ld: /tmp/btop.c8wIWg.ltrans22.ltrans.o: in function `Gpu::Rsmi::init()::{lambda(char const*)#1}::operator()(char const*) const [clone .constprop.0]':
<artificial>:(.text+0x1c6f): undefined reference to `dlsym'
/usr/bin/ld: <artificial>:(.text+0x1c77): undefined reference to `dlerror'
/usr/bin/ld: /tmp/btop.c8wIWg.ltrans25.ltrans.o: in function `Gpu::Rsmi::init() [clone .isra.0]':
<artificial>:(.text+0x8497): undefined reference to `dlopen'
/usr/bin/ld: <artificial>:(.text+0x84b1): undefined reference to `dlerror'
/usr/bin/ld: /tmp/btop.c8wIWg.ltrans25.ltrans.o: in function `Gpu::Nvml::shutdown() [clone .isra.0]':
<artificial>:(.text+0x1c19): undefined reference to `dlclose'
/usr/bin/ld: /tmp/btop.c8wIWg.ltrans25.ltrans.o: in function `Gpu::Rsmi::shutdown() [clone .isra.0]':
<artificial>:(.text+0x1ce7): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make: *** [Makefile:350: btop] Error 1
However, when I compile using the following command:
LDFLAGS=-ldl make
btop compiles successfully.
This seems to be an easy fix, but I would defer to you on whether this fix is only needed on certain platforms/distributions/kernel versions.
Info (please complete the following information):
btop++ version: v1.3.0
(If compiled) Compiler and version: g++ 10.5.0
Architecture: x86_64
Platform: Linux
(Linux) Kernel: 5.15.0-91-generic
Terminal used: st
Font used: roboto-mono
The text was updated successfully, but these errors were encountered:
Since the Makefile doesn't do it I wouldn't like to do this to support (compiling against) some ancient glibc.
Being written with C++-20 btop is dependent on recent compilers anyway so it wouldn't make much sense to support (compiling against) older libc's while requiring new compilers.
Sounds good. Since it looks like you want to have this behavior explicitly, I will close this for now.
Describe the bug
On Ubuntu 20.04 (g++-10), when compiling from the v1.3.0 tag (I also tested on main) with GPU_SUPPORT enabled (NVIDIA), the default makefile does not include the linker flag -ldl and therefore does not compile. Adding -ldl solves this problem.
To Reproduce
I expect the compilation to resolve successfully. Below I have attached a screenshot and a log of the error message.
![image](https://private-user-images.githubusercontent.com/18104107/298421867-f742c053-34e8-427d-81ec-139eb553a942.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3Njc1MTIsIm5iZiI6MTczOTc2NzIxMiwicGF0aCI6Ii8xODEwNDEwNy8yOTg0MjE4NjctZjc0MmMwNTMtMzRlOC00MjdkLTgxZWMtMTM5ZWI1NTNhOTQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDA0NDAxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZjZjkwOWMzMjQ4MGY5NWJkZTU1OTYyNmYzOTg0OTQ4N2MwZjg3NzI4Mzc4Nzg1NzBlYjc5Yzk5Njg3YmViMjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.c7_ZVFPcL0s46bYF7xFSTMP_M9SQrEit-hDoC0z10pk)
Text Log
However, when I compile using the following command:
btop compiles successfully.
![image](https://private-user-images.githubusercontent.com/18104107/298422027-a13c5446-d7d1-49cd-80e9-95480726cbf1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3Njc1MTIsIm5iZiI6MTczOTc2NzIxMiwicGF0aCI6Ii8xODEwNDEwNy8yOTg0MjIwMjctYTEzYzU0NDYtZDdkMS00OWNkLTgwZTktOTU0ODA3MjZjYmYxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDA0NDAxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU2NmQ1Y2Y1YjEzYjZkOWNhOGMzNjQwMDY2MGMzNThhMTdlMjJhZjNlYzY5YzQ2NGI4ZTM2NTY3ZDE0MGFjMjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BucVnZHy_9SXTugR2a4MV2HfmlSomXQ2OHTHkWf8WXk)
This seems to be an easy fix, but I would defer to you on whether this fix is only needed on certain platforms/distributions/kernel versions.
Info (please complete the following information):
The text was updated successfully, but these errors were encountered: