From ebc46ca12cc0ee0172ac44ad6f9bdd30c72e3685 Mon Sep 17 00:00:00 2001 From: "Jakob P. Liljenberg" Date: Mon, 27 Nov 2023 18:21:42 +0100 Subject: [PATCH] Clean up compile instructions --- README.md | 143 +++++++++++++++++++++++++----------------------------- 1 file changed, 66 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index 4ee84749..5d124cc1 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,7 @@ Also needs a UTF8 locale and a font that covers: ## Compilation Linux - Needs GCC 10 or higher, (GCC 11 or above strongly recommended for better CPU efficiency in the compiled binary). + Needs GCC 10 / Clang 16 (or higher). The makefile also needs GNU coreutils and `sed` (should already be installed on any modern distribution). @@ -366,13 +366,11 @@ Also needs a UTF8 locale and a font that covers: -1. **Install dependencies (example for Ubuntu 21.04 Hirsute)** - - Use gcc-10 g++-10 if gcc-11 isn't available +1. **Install dependencies (example for Ubuntu 21.04 Hirsute)** ```bash sudo apt install coreutils sed git build-essential gcc-11 g++-11 - ``` + ``` 2. **Clone repository** @@ -383,56 +381,50 @@ Also needs a UTF8 locale and a font that covers: 3. **Compile** - Append `VERBOSE=true` to display full compiler/linker commands. - - Append `STATIC=true` for static compilation. - - Notice! If using LDAP Authentication, usernames will show as UID number for LDAP users if compiling statically with glibc. - - Append `QUIET=true` for less verbose output. - - Append `STRIP=true` to force stripping of debug symbols (adds `-s` linker flag). - - Append `ARCH=` to manually set the target architecture. - If omitted the makefile uses the machine triple (output of `-dumpmachine` compiler parameter) to detect the target system. - - Append `GPU_SUPPORT=true` or `false` to enable/disable GPU support. (Enabled by default on X86_64 Linux). + ```bash + make + ``` - Append `RSMI_STATIC=true` to statically link the ROCm SMI library used for querying AMDGPU data. - See [GPU compatibility](#gpu-compatibility) for details. + Options for make: - Use `ADDFLAGS` variable for appending flags to both compiler and linker. + | Flag | Description | + |---------------------------------|-------------------------------------------------------------------------| + | `VERBOSE=true` | To display full compiler/linker commands | + | `STATIC=true` | For static compilation | + | `QUIET=true` | For less verbose output | + | `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) | + | `ARCH=` | To manually set the target architecture | + | `GPU_SUPPORT=` | Enable/disable GPU support (Enabled by default on X86_64 Linux) | + | `RSMI_STATIC=true` | To statically link the ROCm SMI library used for querying AMDGPU | + | `ADDFLAGS=` | For appending flags to both compiler and linker | + | `CXX=` | Manualy set which compiler to use | + + Example: `make ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system. - For example: `ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system. + Notice! If using LDAP Authentication, usernames will show as UID number for LDAP users if compiling statically with glibc. - If `g++` is linked to an older version of gcc on your system specify the correct version by appending `CXX=g++-10` or `CXX=g++-11`. +4. **Install** ```bash - make + sudo make install ``` -5. **Install** - Append `PREFIX=/target/dir` to set target, default: `/usr/local` Notice! Only use "sudo" when installing to a NON user owned directory. +5. **(Optional) Set suid bit to make btop always run as root (or other user)** + ```bash - sudo make install + sudo make setuid ``` -6. **(Optional) Set suid bit to make btop always run as root (or other user)** - No need for `sudo` to enable signal sending to any process and to prevent /proc read permissions problems on some systems. Run after make install and use same PREFIX if any was used at install. Set `SU_USER` and `SU_GROUP` to select user and group, default is `root` and `root` - ```bash - sudo make setuid - ``` - * **Uninstall** ```bash @@ -554,50 +546,48 @@ Also needs a UTF8 locale and a font that covers: git clone https://github.com/aristocratos/btop.git cd btop ``` - 3. **Compile** - Append `VERBOSE=true` to display full compiler/linker commands. - - Append `STATIC=true` for static compilation (only libgcc and libstdc++ will be static!). - - Append `QUIET=true` for less verbose output. + ```bash + gmake + ``` - Append `STRIP=true` to force stripping of debug symbols (adds `-s` linker flag). + Options for make: - Append `ARCH=` to manually set the target architecture. - If omitted the makefile uses the machine triple (output of `-dumpmachine` compiler parameter) to detect the target system. + | Flag | Description | + |---------------------------------|-------------------------------------------------------------------------| + | `VERBOSE=true` | To display full compiler/linker commands | + | `STATIC=true` | For static compilation (only libgcc and libstdc++) | + | `QUIET=true` | For less verbose output | + | `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) | + | `ARCH=` | To manually set the target architecture | + | `ADDFLAGS=` | For appending flags to both compiler and linker | + | `CXX=` | Manualy set which compiler to use | - Use `ADDFLAGS` variable for appending flags to both compiler and linker. + Example: `gmake ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system. - For example: `ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system. +4. **Install** ```bash - gmake + sudo gmake install ``` -4. **Install** - Append `PREFIX=/target/dir` to set target, default: `/usr/local` Notice! Only use "sudo" when installing to a NON user owned directory. +5. **(Recommended) Set suid bit to make btop always run as root (or other user)** + ```bash - sudo gmake install + sudo gmake setuid ``` -5. **(Recommended) Set suid bit to make btop always run as root (or other user)** - No need for `sudo` to see information for non user owned processes and to enable signal sending to any process. Run after make install and use same PREFIX if any was used at install. Set `SU_USER` and `SU_GROUP` to select user and group, default is `root` and `wheel` - ```bash - sudo gmake setuid - ``` - * **Uninstall** ```bash @@ -651,47 +641,46 @@ Also needs a UTF8 locale and a font that covers: 3. **Compile** - Append `VERBOSE=true` to display full compiler/linker commands. - - Append `STATIC=true` for static compilation (only libgcc and libstdc++ will be static!). - - Append `QUIET=true` for less verbose output. - - Append `STRIP=true` to force stripping of debug symbols (adds `-s` linker flag). - - Append `ARCH=` to manually set the target architecture. - If omitted the makefile uses the machine triple (output of `-dumpmachine` compiler parameter) to detect the target system. - - Use `ADDFLAGS` variable for appending flags to both compiler and linker. - - For example: `ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system. - ```bash gmake ``` -4. **Install** + Options for make: - Append `PREFIX=/target/dir` to set target, default: `/usr/local` + | Flag | Description | + |---------------------------------|-------------------------------------------------------------------------| + | `VERBOSE=true` | To display full compiler/linker commands | + | `STATIC=true` | For static compilation (only libgcc and libstdc++) | + | `QUIET=true` | For less verbose output | + | `STRIP=true` | To force stripping of debug symbols (adds `-s` linker flag) | + | `ARCH=` | To manually set the target architecture | + | `ADDFLAGS=` | For appending flags to both compiler and linker | + | `CXX=` | Manualy set which compiler to use | - Notice! Only use "sudo" when installing to a NON user owned directory. + Example: `gmake ADDFLAGS=-march=native` might give a performance boost if compiling only for your own system. + +4. **Install** ```bash sudo gmake install ``` + + Append `PREFIX=/target/dir` to set target, default: `/usr/local` + + Notice! Only use "sudo" when installing to a NON user owned directory. 5. **(Recommended) Set suid bit to make btop always run as root (or other user)** + ```bash + sudo gmake setuid + ``` + No need for `sudo` to see information for non user owned processes and to enable signal sending to any process. Run after make install and use same PREFIX if any was used at install. Set `SU_USER` and `SU_GROUP` to select user and group, default is `root` and `wheel` - ```bash - sudo gmake setuid - ``` - * **Uninstall** ```bash