Skip to content

Commit

Permalink
add poetry setup
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBubel committed Jul 15, 2024
1 parent bfa1d67 commit 875e3f4
Show file tree
Hide file tree
Showing 3 changed files with 3,324 additions and 0 deletions.
62 changes: 62 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import sys
import numpy as np
from setuptools import setup, Extension


def ismac():
return sys.platform[:6] == "darwin"

if ismac():
compile_flags = ["-O3"]
link_args = []
else:
compile_flags = ["-fopenmp", "-O3"]
link_args = ["-lgomp"]

extensions = [
Extension(
name="GPy.kern.src.stationary_cython",
sources=[
"GPy/kern/src/stationary_cython.pyx",
"GPy/kern/src/stationary_utils.c",
],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
Extension(
name="GPy.util.choleskies_cython",
sources=["GPy/util/choleskies_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_link_args=link_args,
extra_compile_args=compile_flags,
),
Extension(
name="GPy.util.linalg_cython",
sources=["GPy/util/linalg_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
Extension(
name="GPy.kern.src.coregionalize_cython",
sources=["GPy/kern/src/coregionalize_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
Extension(
name="GPy.models.state_space_cython",
sources=["GPy/models/state_space_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
]

def build(setup_kwargs):
"""Needed for the poetry building interface."""
setup_kwargs.update({
'ext_modules': extensions,
# 'include_dirs': [np.get_include()],
})
Loading

0 comments on commit 875e3f4

Please sign in to comment.