The Go bindings include neural-network tensors, layers, losses, optimizers, and networks, along with line, bar, and scatter charts. PCA/SVD/UMAP are not currently available in Go. Check the Go binding README for current coverage and limitations.
Can I add it with go get?
Go can fetch the binding module directly from GitHub. Run this from your Go application's module directory:
go get github.com/MeanderingAI/CoolBox/_deliverables/libraries/bindings/go_bindings@main
Important: fetching the module does not currently make it buildable as a standalone dependency. Its cgo build refers to native libraries, headers, Eigen, and binding sources in sibling directories of the full CoolBox repository. Clone the complete repository and build the C API as described below before compiling or testing the bindings.
1. Install Go
CoolBox’s bindings require Go 1.21 or newer, cgo, CMake, and a C/C++ compiler compatible with your Go toolchain. On Windows, use a MinGW-w64 toolchain compatible with cgo. Install Go from the official downloads page, then open a new terminal.
Download Go from go.devCheck that the Go executable is on your PATH:
go version
2. Clone CoolBox
Clone the repository, including its tracked submodules, as the README recommends:
git clone --recurse-submodules https://github.com/MeanderingAI/CoolBox.git
cd CoolBox
3. Build the native C API
From the repository root, configure and build the shared C API library. Use a compatible C/C++ toolchain for both this build and cgo:
cmake -S _deliverables/libraries/bindings/c_bindings -B _deliverables/libraries/bindings/c_bindings/build -DBUILD_TESTING=ON
cmake --build _deliverables/libraries/bindings/c_bindings/build --config Release
On Windows, configure CMake with the MinGW Makefiles generator and a MinGW-w64 installation compatible with your Go compiler.
cmake -G "MinGW Makefiles" -S _deliverables/libraries/bindings/c_bindings `
-B _deliverables/libraries/bindings/c_bindings/build `
-DBUILD_TESTING=ON
cmake --build _deliverables/libraries/bindings/c_bindings/build
4. Test the Go bindings
Run the binding tests from the Go package directory:
Set-Location _deliverables/libraries/bindings/go_bindings
go test ./...
If you built the C API outside its default directory, configure CGO_LDFLAGS to locate it. On Windows, make sure the native DLLs are on PATH.
Try a Go tutorial
Use the Go tab in the deep-learning tutorial to train a small network. For PCA, use the Python bindings and follow the PCA tutorial.