-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·40 lines (33 loc) · 994 Bytes
/
build.sh
File metadata and controls
executable file
·40 lines (33 loc) · 994 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
#!/bin/bash
clear
echo "Building ASP Optimization Engine..."
echo
# Create artifacts directory if it doesn't exist
mkdir -p artifacts/macOS
# Set file names
MAIN_PROGRAM_NAME="src/scheduler.cpp"
DLL_NAME="artifacts/macOS/scheduler.dylib"
TEST_PROGRAM_NAME="src/tester.cpp"
EXECUTABLE_NAME="artifacts/macOS/tester"
# Compile the DLL
echo "Compiling optimization engine library..."
g++ -dynamiclib -o $DLL_NAME $MAIN_PROGRAM_NAME -std=c++17 -O2 -fPIC
if [ $? -ne 0 ]; then
echo "ERROR: Failed to compile shared library!"
exit 1
fi
echo "=> Library compiled successfully"
# Compile the test program
echo "Compiling test program..."
g++ -o $EXECUTABLE_NAME $TEST_PROGRAM_NAME -std=c++17 -O2 -ldl
if [ $? -ne 0 ]; then
echo "ERROR: Failed to compile test program!"
exit 1
fi
echo "=> Test program compiled successfully"
echo
echo "=> Build Complete"
echo
echo "-> Run './run.sh [test_number]' to test the engine."
echo "-> Example: './run.sh 1' runs test case input1.txt"
echo