-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-cpp.sh
More file actions
45 lines (35 loc) · 837 Bytes
/
Copy pathbuild-cpp.sh
File metadata and controls
45 lines (35 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Build script for Glinx C++ core on Linux/macOS
set -e
echo "=== Building Glinx C++ Core ==="
BUILD_DIR="glinx-core/build"
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# Configure
echo ""
echo "Configuring with CMake..."
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build
echo ""
echo "Building..."
cmake --build . -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
echo ""
echo "✓ Build successful!"
echo ""
echo "Artifacts:"
echo " - Static library: $BUILD_DIR/libglinx_core.a"
echo " - Python module: $BUILD_DIR/_glinx_core.so"
# Run tests
if [[ "$*" == *"--test"* ]]; then
echo ""
echo "Running tests..."
ctest --output-on-failure
fi
# Run benchmarks
if [[ "$*" == *"--bench"* ]]; then
echo ""
echo "Running benchmarks..."
./latency_bench
./throughput_bench 1000 5
fi
cd ../..