Files
jackpot-miner/Cargo.toml
T
jackpotincorporated 00531fb591 Windows build: generate the OpenCL import library, drop the SDK dependency
Building the `gpu` (OpenCL) backend on Windows no longer needs a vendor OpenCL
SDK. `cl-sys` links `OpenCL` (#[link(name = "OpenCL")]); instead of requiring an
SDK-provided OpenCL.lib, build.rs now generates a vendor-neutral import library
at build time from windows/OpenCL.def (all 118 cl-sys exports) — lib.exe for
MSVC (located via the cc crate), dlltool for MinGW — and puts it on the link
search path. The real OpenCL.dll is supplied at runtime by the GPU driver.

build.rs no-ops on non-Windows targets and when the gpu feature is off, and
warns rather than panics if the toolchain tool is absent so `cargo check` still
works. Combined with the runtime-loaded (dlopen) CUDA/NVML, a Windows build now
needs zero external GPU libraries.

Add BUILD-windows.md (toolchain, build, crt-static packaging, runtime deps, CI)
and link it from the README. Verified the whole crate compiles for
x86_64-pc-windows-gnu (default features and gpu,cuda); Linux is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 12:38:15 -04:00

58 lines
1.7 KiB
TOML

[package]
name = "jackpotminer"
version = "0.1.0"
edition = "2021"
description = "A GPU-accelerated Equihash 192,7 miner (ZClassic and other 192,7 coins)"
[dependencies]
blake2b_simd = "1"
sha2 = "0.10"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = "0.8"
hex = "0.4"
rayon = "1"
num_cpus = "1"
core_affinity = "0.8"
clap = { version = "4", features = ["derive"] }
log = "0.4"
env_logger = "0.11"
anyhow = "1"
ctrlc = "3"
socket2 = "0.5"
ocl = { version = "0.19", optional = true }
ratatui = "0.30.0"
eframe = { version = "0.28", optional = true }
# Runtime loader for the CUDA driver / NVML (dlopen'd, not link-time, so the
# binary has no build- or load-time dependency on libcuda / libnvidia-ml).
libloading = { version = "0.8", optional = true }
[features]
default = ["gpu", "cuda", "config-gui"]
gpu = ["dep:ocl"]
# CUDA backend: drives miniZ's embedded Equihash 192,7 fatbin via the CUDA driver
# API. The driver (libcuda) and NVML are dlopen'd at runtime via libloading, so
# there is no build-time or load-time dependency on them — the binary builds and
# starts on hosts without an NVIDIA driver and simply reports no CUDA devices.
cuda = ["dep:libloading"]
# Optional native GUI config editor (the `jackpotminer-config` binary). Off by
# default so the miner never pulls in the GUI toolkit.
config-gui = ["dep:eframe"]
# The GUI config editor is a separate binary, built only with --features config-gui.
[[bin]]
name = "jackpotminer-config"
path = "src/config_gui.rs"
required-features = ["config-gui"]
[build-dependencies]
# Locates the MSVC `lib.exe` (to generate the OpenCL import library on Windows);
# unused on other platforms. See build.rs.
cc = "1"
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
panic = "abort"