-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added build from source for arch linux
- Loading branch information
BIGBEASTISHANK
committed
Nov 26, 2023
1 parent
418602c
commit fee2dbc
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
\page build-archlinux Building on Arch Linux | ||
|
||
\note You might not have to build library from source on arch, you can install directly from AUR repo, See the guide [here](/install-arch-aur.html). | ||
|
||
## 1. Copy Source code | ||
```bash | ||
git clone https://github.com/brainboxdotcc/DPP | ||
cd DPP/ | ||
``` | ||
|
||
```bash | ||
cmake -B ./build -DCMAKE_INSTALL_PREFIX=/usr/ | ||
cmake --build ./build -j8 | ||
``` | ||
|
||
Replace the number after `-j` with a number suitable for your setup, usually the same as the number of cores on your machine. `cmake` will fetch any dependencies that are required for you and ensure they are compiled alongside the library. | ||
|
||
## 2. Install to /usr/include and /usr/lib | ||
|
||
```bash | ||
cd build | ||
sudo make install | ||
``` | ||
|
||
## 3. Installation to a Different Directory | ||
|
||
If you want to install the library, its dependencies, and header files to a different directory, specify this directory when running `cmake`: | ||
|
||
```bash | ||
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install | ||
``` | ||
|
||
Then once the build is complete, run `make install` to install to the location you specified. | ||
|
||
\note If you have installed `g++` and not made any changes in enviorment variable related to the path of system headers then you should install in `/usr/` because it is the default system header location on arch. | ||
|
||
## 4. Using the Library | ||
|
||
Once installed to the `/usr/` directory, you can make use of the library in standalone programs simply by including it and linking to it: | ||
|
||
```bash | ||
g++ mydppbot.cpp -o dppbot -ldpp | ||
``` | ||
|
||
The important flags in this command-line are: | ||
|
||
* `-ldpp` - Link to libdpp.so | ||
* `mydppbot.cpp` - Your source code | ||
* `dppbot` - The name of the executable to make | ||
|
||
\include{doc} install_prebuilt_footer.dox | ||
|
||
**Have fun!** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters