Files
accel/ops/code/code_cpu_pkgconfig.go
zeekay e830255ea3 ops/code: the native HQC link is opt-in again (-tags=lux_hqc_native)
cgo says a C compiler is available. It does not say libluxgpu_hqc and
lux/gpu/hqc.h are installed. code_cpu.go declared the second fact as the
first, so any consumer that turns cgo on for an unrelated reason — blst,
say — had to carry a luxgpu install or fail to compile:

  ops/code/code_cpu.go:102:10: fatal error: lux/gpu/hqc.h:
  No such file or directory

Two facts, two predicates. This restores the pairing ops/code carried
through v1.2.4 and that every other optional native link in accel still
uses: crypto_secp256k1_cgo.go and ops/crypto/crypto_msm_native.go behind
lux_crypto_native, ops/fhe/cgo.go behind luxfhe, internal/capi/real.go
behind lux_accel_real. ops/code was the lone file keyed on bare cgo.

code_nocgo.go covers the complement, so a plain cgo build now reports
ErrNativeHQCUnavailable — the error the API already documents — instead
of failing to build. -tags=lux_hqc_native links the native oracle
unchanged.

Verified: build + test at CGO=0; CGO=1 with and without the tag; both
again under -tags=accel. Full suite green.
2026-08-21 00:08:45 -07:00

27 lines
924 B
Go

// Copyright (C) 2024-2026, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//go:build cgo && lux_gpu_pkgconfig && lux_hqc_native
// Optional pkg-config-driven link surface for the luxgpu substrate.
// Enable with `-tags=lux_gpu_pkgconfig` when you want a hard failure
// if `pkg-config luxgpu` doesn't resolve, instead of falling back to
// the multi-prefix probe in code_cpu.go. Mostly useful in CI / build
// systems that have already installed luxgpu via `cmake --install`
// and want to assert the install is wired up.
//
// The default build (no tag) still works without pkg-config — it
// probes every standard install prefix in code_cpu.go's CGO directives.
//
// To target a non-system install prefix from pkg-config:
//
// PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig \
// go build -tags=lux_gpu_pkgconfig ./...
package code
/*
#cgo pkg-config: luxgpu
*/
import "C"