-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating build infrastructure (#161)
* Updating build infrastructure * cibuildwheel tag name * skip all 32bit builds
- Loading branch information
Showing
5 changed files
with
96 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.15...3.26) | ||
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX) | ||
|
||
set(PYBIND11_NEWPYTHON ON) | ||
find_package(pybind11 CONFIG REQUIRED) | ||
|
||
include_directories( | ||
"src/george/include" | ||
"vendor/eigen" | ||
) | ||
|
||
pybind11_add_module(kernel_interface "src/george/kernel_interface.cpp") | ||
install(TARGETS kernel_interface LIBRARY DESTINATION .) | ||
|
||
pybind11_add_module(_hodlr "src/george/solvers/_hodlr.cpp") | ||
install(TARGETS _hodlr LIBRARY DESTINATION ./solvers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
[project] | ||
name = "george" | ||
description = "Blazingly fast Gaussian Processes for regression." | ||
readme = "README.rst" | ||
authors = [{ name = "Daniel Foreman-Mackey", email = "foreman.mackey@gmail.com" }] | ||
requires-python = ">=3.7" | ||
license = { file = "LICENSE" } | ||
urls = { Homepage = "https://github.com/dfm/george" } | ||
dependencies = ["numpy", "scipy"] | ||
dynamic = ["version"] | ||
|
||
[build-system] | ||
requires = ["setuptools>=40.6.0", "wheel", "setuptools_scm[toml]", "pybind11"] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["scikit-build-core", "pybind11"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[tool.scikit-build] | ||
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" | ||
sdist.include = ["src/george/george_version.py"] | ||
wheel.install-dir = "george" | ||
minimum-version = "0.5" | ||
build-dir = "build/{wheel_tag}" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/george/george_version.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
|
||
import yaml | ||
from jinja2 import Template | ||
|
||
|
||
def compile_kernels(fns): | ||
template_dir = "templates" | ||
output_dir = os.path.join("src", "george") | ||
|
||
with open(os.path.join(template_dir, "parser.h")) as f: | ||
PARSER_TEMPLATE = Template(f.read()) | ||
with open(os.path.join(template_dir, "kernels.h")) as f: | ||
CPP_TEMPLATE = Template(f.read()) | ||
with open(os.path.join(template_dir, "kernels.py")) as f: | ||
PYTHON_TEMPLATE = Template(f.read()) | ||
|
||
specs = [] | ||
for i, fn in enumerate(fns): | ||
with open(fn, "r") as f: | ||
spec = yaml.load(f.read(), Loader=yaml.FullLoader) | ||
print("Found kernel '{0}'".format(spec["name"])) | ||
spec["index"] = i | ||
spec["reparams"] = spec.get("reparams", {}) | ||
specs.append(spec) | ||
print("Found {0} kernel specifications".format(len(specs))) | ||
|
||
fn = os.path.join(output_dir, "include", "george", "parser.h") | ||
with open(fn, "w") as f: | ||
print("Saving parser to '{0}'".format(fn)) | ||
f.write(PARSER_TEMPLATE.render(specs=specs)) | ||
fn = os.path.join(output_dir, "include", "george", "kernels.h") | ||
with open(fn, "w") as f: | ||
print("Saving C++ kernels to '{0}'".format(fn)) | ||
f.write(CPP_TEMPLATE.render(specs=specs)) | ||
fn = os.path.join(output_dir, "kernels.py") | ||
with open(fn, "w") as f: | ||
print("Saving Python kernels to '{0}'".format(fn)) | ||
f.write(PYTHON_TEMPLATE.render(specs=specs)) |