This project includes several build scripts to make compilation easier:
Builds the project for your native platform (macOS/Linux).
- Cleans the build directory
- Configures CMake with Release mode
- Builds all targets (library, tests, and demo)
- Generates compile_commands.json for IDE support
Cross-compiles the project for ARM64 (aarch64) Linux.
- Requires IMX_SYSROOT environment variable to be set
- Cleans the build-arm directory
- Configures CMake with the ARM toolchain
- Builds only the ckks_demo executable
- Creates a stripped version for smaller size
- Shows the copy command for deployment
Quickly rebuilds ARM binary without reconfiguring.
- Use this when you've only changed source files
- Much faster than full rebuild
- Automatically falls back to full build if needed
Removes all build artifacts from both native and ARM builds.
./build.sh
./build/tests # Run tests
./build/ckks_demo # Run demo# First set the sysroot path
export IMX_SYSROOT=/path/to/imx-sysroot
./build-arm.sh
# Copy to board:
scp build-arm/ckks_demo user@board-ip:/path/./quick-build-arm.sh # Fast rebuild for ARM./build-arm.sh # Full rebuild needed./clean.shFirst, you need to create a sysroot from your target board:
-
Create sysroot on the board:
ssh root@your-board-ip tar czf /tmp/imx-sysroot.tar.gz /usr/include /usr/lib /lib
-
Copy to development machine:
scp root@your-board-ip:/tmp/imx-sysroot.tar.gz . mkdir -p ~/imx-sysroot tar xzf imx-sysroot.tar.gz -C ~/imx-sysroot
-
Configure the build - two options:
a. Environment variable (recommended):
export IMX_SYSROOT=~/imx-sysroot ./build-arm.sh
b. CMake parameter:
cmake -B build-arm -S . -DIMX_SYSROOT=~/imx-sysroot -DCMAKE_TOOLCHAIN_FILE=toolchain-aarch64.cmake make -C build-arm ckks_demo
If you need to change the cross-compiler settings, edit toolchain-aarch64.cmake:
- Compiler path
- CPU flags
- Optimization level
Then run ./build-arm.sh to reconfigure and rebuild.