Commit 4ec904f3 authored by Purves, Murray's avatar Purves, Murray
Browse files

WIP Amending build to use static lib

parent 3a5a05b0
......@@ -13,7 +13,7 @@
namespace radix
{
template <typename T>
extern std::vector<T> RADIX_PUBLIC interpolateValues(
std::vector<T> RADIX_PUBLIC interpolateValues(
const std::vector<T> &baseValues, const std::vector<T> &valuesToInterpolate,
const bool circular = false, const T missingValue = -9999.f);
......
......@@ -7,7 +7,7 @@
#include "python_utils.hh"
static PyObject* interpolateValues(PyObject* self, PyObject* args)
static PyObject* interpolate_values(PyObject* self, PyObject* args)
{
PyObject* baseValuesObj;
PyObject* valuesToInterpObj;
......@@ -38,7 +38,7 @@ static PyObject* interpolateValues(PyObject* self, PyObject* args)
return interpolatedValuesObj;
}
// static PyObject* interpolateValues(PyObject* self, PyObject* args)
// static PyObject* interpolate_values(PyObject* self, PyObject* args)
// {
// int input;
// if (!PyArg_ParseTuple(args, "i", &input))
......@@ -52,7 +52,7 @@ static PyObject* interpolateValues(PyObject* self, PyObject* args)
// }
static PyMethodDef interpolate_methods[] = {
{"interpolateValues", interpolateValues, METH_VARARGS, "Interpolate/extrapolate missing values from a data vector"},
{"interpolate_values", interpolate_values, METH_VARARGS, "Interpolate/extrapolate missing values from a data vector"},
{NULL, NULL, 0, NULL},
};
......
from distutils.core import setup, Extension
import sys
libraries = []
library_dirs = []
static_lib_dir = "/Users/ohp/project/build/radix/radixmath"
static_libraries = ["radixmath"]
extra_objects = []
# Add radix libraries to build - platform dependent
if sys.platform == "win32":
libraries.extend(static_libraries)
library_dirs.extend(static_lib_dir)
else:
extra_objects = ['{}/lib{}.a'.format(static_lib_dir, l)
for l in static_libraries]
interpolate_module = Extension(
'interpolate',
sources=['interpolatemodule.cc'],
language='C++',
libraries=libraries,
library_dirs=library_dirs,
extra_objects=extra_objects,
)
setup(
......
......@@ -12,7 +12,7 @@ expect_values = [1.0, 2.0, 3.0, 4.5, 6.0, 3.5, 1.0]
print("Base values: ", str(base_values))
print("Before interpolation: ", str(interp_values))
test_values = interpolate.interpolateValues(base_values, interp_values,
test_values = interpolate.interpolate_values(base_values, interp_values,
circular, missing_value)
print("After interpolation: ", str(interp_values))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment