Skip to content

Commit 93e130f

Browse files
Refactor scripts
1 parent 09b3dd3 commit 93e130f

File tree

3 files changed

+121
-34
lines changed

3 files changed

+121
-34
lines changed
Lines changed: 85 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,72 @@
1-
# AWS C Libraries Build Guide
1+
# Build Guide
22

3-
This guide provides instructions for building the AWS C libraries required for S3 integration.
3+
This guide provides instructions for building all required dependencies for the EmbeddingBridge project.
44

55
## Prerequisites
66

77
- CMake 3.9+
88
- C/C++ compiler (GCC 4.9+ or Clang 3.3+)
99
- Git
10+
- Python 3.6+ (for Arrow Python bindings)
11+
- pkg-config
1012

11-
## Build Order
13+
## Quick Start
14+
15+
Run the build scripts from the project root directory:
16+
17+
```bash
18+
# Build all dependencies
19+
./scripts/build_aws.sh
20+
./scripts/build_arrow.sh
21+
22+
# Build npy_array
23+
cd vendor/npy_array
24+
./configure
25+
make
26+
sudo make install
27+
cd ../..
28+
```
29+
30+
## Apache Arrow
31+
32+
Apache Arrow provides columnar data structures and is required for Parquet file support.
33+
34+
### Build Arrow
35+
36+
```bash
37+
./scripts/build_arrow.sh
38+
```
39+
40+
This script will:
41+
- Download and build Apache Arrow C++ libraries
42+
- Install to `/usr/local` by default
43+
- Build with Parquet, CSV, and dataset support
44+
- Optionally build GLib bindings with `--with-glib` flag
45+
46+
## NPY Array Library
47+
48+
The npy_array library provides C support for reading/writing NumPy arrays.
49+
50+
### Build npy_array
51+
52+
```bash
53+
cd vendor/npy_array
54+
./configure --prefix=/usr/local
55+
make
56+
sudo make install
57+
```
58+
59+
For more configuration options:
60+
```bash
61+
cd vendor/npy_array
62+
./configure --help
63+
```
64+
65+
## AWS C Libraries
66+
67+
AWS C libraries are required for S3 integration.
68+
69+
### Build Order
1270

1371
The libraries must be built in the following order due to dependencies:
1472

@@ -24,15 +82,21 @@ The libraries must be built in the following order due to dependencies:
2482
10. **aws-c-auth** - Authentication and credentials management
2583
11. **aws-c-s3** - S3 service client
2684

27-
## Build Steps
85+
### Quick Build
86+
87+
```bash
88+
./scripts/build_aws.sh
89+
```
90+
91+
### Manual Build Steps
2892

29-
### 1. Set up the directory structure
93+
#### 1. Set up the directory structure
3094

3195
```bash
3296
mkdir -p vendor/aws/install
3397
```
3498

35-
### 2. AWS-LC (LibCrypto)
99+
#### 2. AWS-LC (LibCrypto)
36100

37101
```bash
38102
cd vendor/aws
@@ -42,7 +106,7 @@ cmake -S vendor/aws/aws-lc -B vendor/aws/aws-lc/build -DCMAKE_INSTALL_PREFIX=$(p
42106
cmake --build vendor/aws/aws-lc/build --target install
43107
```
44108

45-
### 3. s2n-tls
109+
#### 3. s2n-tls
46110

47111
```bash
48112
cd vendor/aws
@@ -52,7 +116,7 @@ cmake -S vendor/aws/s2n-tls -B vendor/aws/s2n-tls/build -DCMAKE_INSTALL_PREFIX=$
52116
cmake --build vendor/aws/s2n-tls/build --target install
53117
```
54118

55-
### 4. aws-c-common
119+
#### 4. aws-c-common
56120

57121
```bash
58122
cd vendor/aws
@@ -62,7 +126,7 @@ cmake -S vendor/aws/aws-c-common -B vendor/aws/aws-c-common/build -DCMAKE_INSTAL
62126
cmake --build vendor/aws/aws-c-common/build --target install
63127
```
64128

65-
### 5. aws-checksums
129+
#### 5. aws-checksums
66130

67131
```bash
68132
cd vendor/aws
@@ -72,7 +136,7 @@ cmake -S vendor/aws/aws-checksums -B vendor/aws/aws-checksums/build -DCMAKE_INST
72136
cmake --build vendor/aws/aws-checksums/build --target install
73137
```
74138

75-
### 6. aws-c-cal
139+
#### 6. aws-c-cal
76140

77141
```bash
78142
cd vendor/aws
@@ -82,7 +146,7 @@ cmake -S vendor/aws/aws-c-cal -B vendor/aws/aws-c-cal/build -DCMAKE_INSTALL_PREF
82146
cmake --build vendor/aws/aws-c-cal/build --target install
83147
```
84148

85-
### 7. aws-c-io
149+
#### 7. aws-c-io
86150

87151
```bash
88152
cd vendor/aws
@@ -92,7 +156,7 @@ cmake -S vendor/aws/aws-c-io -B vendor/aws/aws-c-io/build -DCMAKE_INSTALL_PREFIX
92156
cmake --build vendor/aws/aws-c-io/build --target install
93157
```
94158

95-
### 8. aws-c-compression
159+
#### 8. aws-c-compression
96160

97161
```bash
98162
cd vendor/aws
@@ -102,7 +166,7 @@ cmake -S vendor/aws/aws-c-compression -B vendor/aws/aws-c-compression/build -DCM
102166
cmake --build vendor/aws/aws-c-compression/build --target install
103167
```
104168

105-
### 9. aws-c-http
169+
#### 9. aws-c-http
106170

107171
```bash
108172
cd vendor/aws
@@ -112,7 +176,7 @@ cmake -S vendor/aws/aws-c-http -B vendor/aws/aws-c-http/build -DCMAKE_INSTALL_PR
112176
cmake --build vendor/aws/aws-c-http/build --target install
113177
```
114178

115-
### 10. aws-c-sdkutils
179+
#### 10. aws-c-sdkutils
116180

117181
```bash
118182
cd vendor/aws
@@ -122,7 +186,7 @@ cmake -S vendor/aws/aws-c-sdkutils -B vendor/aws/aws-c-sdkutils/build -DCMAKE_IN
122186
cmake --build vendor/aws/aws-c-sdkutils/build --target install
123187
```
124188

125-
### 11. aws-c-auth
189+
#### 11. aws-c-auth
126190

127191
```bash
128192
cd vendor/aws
@@ -132,7 +196,7 @@ cmake -S vendor/aws/aws-c-auth -B vendor/aws/aws-c-auth/build -DCMAKE_INSTALL_PR
132196
cmake --build vendor/aws/aws-c-auth/build --target install
133197
```
134198

135-
### 12. aws-c-s3
199+
#### 12. aws-c-s3
136200

137201
```bash
138202
cd vendor/aws
@@ -145,26 +209,13 @@ cmake --build vendor/aws/aws-c-s3/build --target install
145209
## Using the Libraries
146210

147211
After building, the libraries and headers will be installed in:
148-
- Libraries: `vendor/aws/install/lib/`
149-
- Headers: `vendor/aws/install/include/`
150-
- Executables: `vendor/aws/install/bin/`
212+
- AWS Libraries: `vendor/aws/install/lib/`
213+
- AWS Headers: `vendor/aws/install/include/`
214+
- Arrow Libraries: `/usr/local/lib/` (or custom prefix)
215+
- npy_array: `/usr/local/lib/` (or custom prefix)
151216

152217
To test if everything is working correctly, run:
153218

154219
```bash
155220
vendor/aws/install/bin/s3 --help
156-
```
157-
158-
## Linking in CMake Projects
159-
160-
To use these libraries in a CMake project, add the following to your CMakeLists.txt:
161-
162-
```cmake
163-
set(AWS_LIBRARIES_DIR "${CMAKE_SOURCE_DIR}/vendor/aws/install")
164-
set(CMAKE_PREFIX_PATH "${AWS_LIBRARIES_DIR};${CMAKE_PREFIX_PATH}")
165-
166-
find_package(aws-c-s3 REQUIRED)
167-
168-
# Link your target with AWS libraries
169-
target_link_libraries(your_target PRIVATE AWS::aws-c-s3)
170-
```
221+
```

scripts/create_release.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# IMPORTANT:Change @types.h to have the correct version
4+
# RUN dist.sh before running this script
5+
6+
# Get version from command line or extract from types.h as default
7+
if [ -z "$1" ]; then
8+
# Extract version from types.h if no argument is provided
9+
DEFAULT_VERSION=$(grep -E "^#define EB_VERSION_STR" src/core/types.h | awk '{print $3}' | tr -d '"')
10+
VERSION=${DEFAULT_VERSION:-$(date +%Y%m%d)}
11+
else
12+
VERSION=$1
13+
fi
14+
RELEASE_NAME="embedding_bridge-${VERSION}"
15+
16+
# Create release directory
17+
mkdir -p "${RELEASE_NAME}"
18+
19+
# Copy distribution files
20+
cp -r dist/* "${RELEASE_NAME}/"
21+
22+
# Copy documentation and other important files
23+
cp README.md LICENSE CONTRIBUTING.md RELEASE_NOTES.md "${RELEASE_NAME}/"
24+
25+
# Create release archive
26+
tar -czf "${RELEASE_NAME}.tar.gz" "${RELEASE_NAME}"
27+
28+
# Optional: Create ZIP archive for Windows users
29+
zip -r "${RELEASE_NAME}.zip" "${RELEASE_NAME}"
30+
31+
# Cleanup
32+
rm -rf "${RELEASE_NAME}"
33+
34+
echo "Created release packages:"
35+
echo "- ${RELEASE_NAME}.tar.gz"
36+
echo "- ${RELEASE_NAME}.zip"
File renamed without changes.

0 commit comments

Comments
 (0)