| 12345678910111213141516171819202122232425262728293031 |
- #!/usr/bin/env bash
- set -euo pipefail
- unset LD_LIBRARY_PATH
- cd "$(dirname "$0")"
- ROOT_DIR="$(cd ../.. && pwd)"
- BUILD_DIR="${ROOT_DIR:?}/build/native"
- mkdir -p "${BUILD_DIR:?}"
- re2c -b -g -W -Werror parser_re2c.re -o "${BUILD_DIR}/parser_re2c.c"
- gcc -c -O3 -fPIC -march=x86-64 -I. "${BUILD_DIR}/parser_re2c.c" -o "${BUILD_DIR}/parser_re2c.o"
- gcc -c -O3 -fPIC -march=x86-64 -I. simd_kernels.c -o "${BUILD_DIR}/simd_kernels.o"
- gcc -c -O3 -fPIC -march=x86-64 -I. opencl_batch.c -o "${BUILD_DIR}/opencl_batch.o"
- gcc -c -O3 -fPIC -march=x86-64 scan_asm.S -o "${BUILD_DIR}/scan_asm.o"
- zig build-obj -O ReleaseFast -fPIC -mcpu=x86_64 -femit-bin="${BUILD_DIR}/zig_kernels.o" zig_kernels.zig
- if [ -f "${ROOT_DIR}/tools/pxe_sync.zig" ]; then
- zig build-exe -O ReleaseSmall -target x86_64-uefi-msvc -femit-bin="${BUILD_DIR}/pxe_sync.efi" "${ROOT_DIR}/tools/pxe_sync.zig"
- fi
- gcc -c -O3 -fPIC -march=x86-64 -I. c_bridge.c -o "${BUILD_DIR}/c_bridge.o"
- ar rcs "${BUILD_DIR}/libstl_kernels.a" \
- "${BUILD_DIR}/parser_re2c.o" \
- "${BUILD_DIR}/simd_kernels.o" \
- "${BUILD_DIR}/opencl_batch.o" \
- "${BUILD_DIR}/scan_asm.o" \
- "${BUILD_DIR}/zig_kernels.o" \
- "${BUILD_DIR}/c_bridge.o"
- rustc -O -C target-cpu=x86-64 -C lto=thin -C codegen-units=1 -C strip=debuginfo src/main.rs \
- -L "${BUILD_DIR}" -l static=stl_kernels -l freeipmi -l ipmiconsole -l ssh -l util -l dl -l pthread -o "${BUILD_DIR}/stl_native_server"
- rustc --test -O -C target-cpu=x86-64 src/main.rs \
- -L "${BUILD_DIR}" -l static=stl_kernels -l freeipmi -l ipmiconsole -l ssh -l util -l dl -l pthread -o "${BUILD_DIR}/stl_native_tests"
- (cd "${ROOT_DIR}" && "${BUILD_DIR}/stl_native_tests")
|