Julia package for libKriging, a fast, portable Kriging / Gaussian process library written in C++ (Kriging, NuggetKriging, NoiseKriging, WarpKriging, MLPKriging, NestedKriging, Vecchia and Nystrom approximations, ...).
The repository is JLibKriging.jl (the General registry's naming convention); the package and its module are named JLibKriging.
This repository plays the same role for Julia as
rlibkriging does for R: it does not
duplicate any code. The Julia binding itself lives in libKriging
(bindings/Julia/jlibkriging); this package fetches the pinned libKriging sources,
adapts them for Julia on the fly, compiles the C API and generates the module.
import Pkg
Pkg.add("JLibKriging") # or: Pkg.add(url="https://github.com/libKriging/JLibKriging.jl")Installation compiles libKriging (deps/build.jl, a few minutes) and requires a
C++17 compiler (GCC/Clang, or Visual Studio on Windows) and a BLAS/LAPACK
implementation (a bundled LAPACK is used when none is found). CMake is provided by
CMake_jll; no git is needed.
using JLibKriging
X = reshape(range(0, 1; length=10), :, 1)
y = sin.(6 .* X[:, 1])
k = Kriging(y, X, "matern5_2")
mean, stdev = predict(k, reshape([0.25, 0.75], :, 1))See the libKriging documentation and
bindings/Julia
for the API and worked notebooks.
| Step | Where |
|---|---|
| pinned libKriging sources (commit + the submodules it needs) | deps/sources.toml, fetched as GitHub archives (a registered package has no git submodules) |
CMake patches (no tests/benchmarks/unused bindings, local LAPACK sources), build of libkriging_c |
deps/build.jl |
JLibKriging module = libKriging's jlibkriging.jl, renamed and pointed at the built library |
generated by deps/build.jl into deps/generated/ |
| tests = libKriging's own Julia tests, module name adapted | test/runtests.jl |
| follow libKriging master | tools/update_sources.sh, run by libKriging's "Send submodule updates" workflow |
Environment variables read by deps/build.jl: LIBKRIGING_SRC_DIR (use a local
libKriging checkout instead of downloading), JLIBKRIGING_BUILD_JOBS,
JLIBKRIGING_CMAKE_ARGS. JLIBKRIGING_LIB_PATH at run time overrides the library
location.
tools/diagnose.jl loads the library and exercises it step by step (load, dlopen,
construct, fit, predict) with flushed output; tools/diagnose_imports.jl (Windows)
lists the DLL imports that no DLL exports (the cause of "The specified procedure
could not be found"). On Windows the build needs MinGW-w64 (gcc, mingw32-make)
in the PATH, and links its C++ runtime statically because the runtime Julia has
already loaded takes precedence over any same-named DLL.
The package version is libKriging's version (cmake/version.cmake). Every push to
master runs the CI on Linux/macOS/Windows; when it passes and the version in
Project.toml is not yet in Julia's General registry, the workflow asks
Registrator to register it
(TagBot then tags the release). Between two libKriging releases, master follows
libKriging without registering anything.
Maintainers: the register job needs a repository secret ACCESS_TOKEN (a user
token with write access -- Registrator ignores comments from bots) and the
Registrator GitHub App installed on this repository.
Apache-2.0, see LICENSE.