db-lab1/BUILD-ubuntu.md

73 lines
1.1 KiB
Markdown
Raw Normal View History

2021-11-07 12:02:24 +00:00
# Build (Ubuntu)
2021-10-21 03:13:09 +01:00
2021-11-07 12:02:24 +00:00
To build the dependencies & the project itself, The following must be installed:
- g++
- make
- CMake
## Dependencies
> For each dependency, shell is assumed to be in the directory of `dependencies`. So, the first command is always changing into the directory which contains the dependency.
### [Boost](https://www.boost.org/)
shell:
```
cd boost
./bootstrap
./b2
sudo ./b2 install
```
### [Crypto++](https://cryptopp.com/)
shell:
```
cd cryptopp
make
```
### [PostgreSQL](https://www.postgresql.org/)
**The database should be installed locally.**
### [Libpqxx](https://github.com/jtv/libpqxx)
shell:
```
cd libpqxx
./configure
make
```
### [inja](https://github.com/pantor/inja)
*Nothing should be done...*
## Sample Project: `WebApp`
> Now we should go back to the root directory.
2021-10-21 03:13:09 +01:00
shell:
```
mkdir build && cd build
cmake ..
cmake --build .
```
Assuming the shell is in `build`, you can run `WebApp` using:
```
2021-11-16 09:05:17 +00:00
cd WebApp
./WebApp ../../config.json
2021-10-21 03:13:09 +01:00
```
given that the database and `config.json` are properly configured.
> If some of the dynamically linked libraries are missing, try:
> ```
> sudo ldconfig
> ```