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

Add instructions to install AWS dependencies #153

Merged
merged 1 commit into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/building-the-aws-driver/BuildingAwsSdkCpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Building the AWS SDK for C++
The driver supports AWS IAM and AWS Secrets Manager authentication by using [AWS SDK for C++](https://docs.aws.amazon.com/sdk-for-cpp/). The driver requires `aws-cpp-sdk-core`, `aws-cpp-sdk-rds`, and `aws-cpp-sdk-secretsmanager`. You can either build the SDK yourself directly from the source using the script under `scripts` folder or [download the libraries using a package manager](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/sdk-from-pm.html). The script will install the SDK under `aws_sdk/install` folder. The driver will look for SDK dependencies through `aws_sdk/install` folder and `CMAKE_PREFIX_PATH` environment variable.
> **_NOTE:_** On Winodws, depending on the use case, you may build the SDK as a static library or dynamic library. On Linux and macOS, you should always build the SDK as a dynamic library.

## Windows
If you want to build and run the driver unit tests, you need to build the SDK as static library, as the unit test binary will link every dependency statically.
```
.\scripts\build_aws_sdk_win.ps1 x64 Debug OFF "Visual Studio 16 2019"
justing-bq marked this conversation as resolved.
Show resolved Hide resolved
```
If you want to build the driver DLL, you need to build the SDK as dynamic library, as the driver DLL will link the SDK dynamically.
```
.\scripts\build_aws_sdk_win.ps1 x64 Release ON "Visual Studio 16 2019"
```
## Linux/macOS
```
./scripts/build_aws_sdk_unix.sh Release
```

## Troubleshoot
See https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/troubleshooting-cmake.html
17 changes: 13 additions & 4 deletions docs/building-the-aws-driver/BuildingTheAwsDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
- [Visual Studio](https://visualstudio.microsoft.com/downloads/)
> The driver has been built successfully using `Visual Studio 2019`, and it may not build correctly with other versions. When installing Visual Studio, ensure the `Visual C++ 2019` and `Visual Studio Tools for CMake` packages are also installed.
- [MySQL Server](https://dev.mysql.com/downloads/installer/)
2. Build the driver in the `build` directory with the following commands:

2. Refer to [Building the AWS SDK for C++](./BuildingAwsSdkCpp.md) to install required AWS dependencies.

3. Build the driver in the `build` directory with the following commands:
```
cmake -S . -B build -G "Visual Studio 16 2019" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.0" -DMYSQLCLIENT_STATIC_LINKING=TRUE
cmake --build build --config Release
Expand All @@ -19,11 +22,14 @@
- `cmake`
- `mysql-client`
- `mysql`
2. Set the environment variable MYSQL_DIR as the path to your `mysql-client` installation location:

2. Refer to [Building the AWS SDK for C++](./BuildingAwsSdkCpp.md) to install required AWS dependencies.

3. Set the environment variable MYSQL_DIR as the path to your `mysql-client` installation location:
```
export MYSQL_DIR=/usr/local/opt/mysql-client
```
3. Build the driver in the `build` directory with the following commands:
4. Build the driver in the `build` directory with the following commands:
```
cmake -S . -B build -G "Unix Makefiles" -DMYSQLCLIENT_STATIC_LINKING=true -DODBC_INCLUDES=/usr/local/Cellar/libiodbc/3.52.15/include
justing-bq marked this conversation as resolved.
Show resolved Hide resolved
cmake --build build --config Release
Expand Down Expand Up @@ -51,7 +57,10 @@ export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl@1.1/lib/
sudo apt-get update
sudo apt-get install build-essential libgtk-3-dev libmysqlclient-dev unixodbc unixodbc-dev
```
2. Build the driver in the `build` directory with the following commands:

2. Refer to [Building the AWS SDK for C++](./BuildingAwsSdkCpp.md) to install required AWS dependencies.

3. Build the driver in the `build` directory with the following commands:
```
cmake -S . -B build -G "Unix Makefiles" -DMYSQLCLIENT_STATIC_LINKING=true -DWITH_UNIXODBC=1
cmake --build build --config Release
Expand Down