proper cython setup
This commit is contained in:
@@ -6,14 +6,19 @@ extensions = Extension(
|
||||
name="tdm_reaper",
|
||||
sources=["cython/tdm_reaper.pyx"],
|
||||
# libraries=[""],
|
||||
library_dirs=["lib"],
|
||||
include_dirs=["lib"],
|
||||
# library_dirs=["lib"],
|
||||
include_dirs=["lib","pugixml"],
|
||||
language='c++',
|
||||
extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
||||
extra_link_args=['-std=c++17'],
|
||||
)
|
||||
|
||||
setup(
|
||||
version='0.1',
|
||||
description='TDMReaper cython extension',
|
||||
author='Record Evolution GmbH',
|
||||
author_email='mario.fink@record-evolution.de',
|
||||
url='https://github.com/RecordEvolution/tdm_ripper.git',
|
||||
name="tdm_reaper",
|
||||
ext_modules=cythonize(extensions)
|
||||
)
|
||||
|
@@ -6,10 +6,10 @@ from libcpp.string cimport string
|
||||
from libcpp.vector cimport vector
|
||||
from libcpp cimport bool
|
||||
|
||||
cdef extern from "../lib/tdm_reaper.hpp":
|
||||
cdef cppclass raw_eater:
|
||||
cdef extern from "tdm_reaper.hpp":
|
||||
cdef cppclass tdmreaper:
|
||||
# constructor(s)
|
||||
raw_eater() except +
|
||||
tdmreaper() except +
|
||||
# set new file for decoding
|
||||
# void set_file(string)
|
||||
# # perform conversion (pass any C++ exceptions to Python)
|
||||
|
@@ -4,14 +4,14 @@ import numpy as np
|
||||
import re
|
||||
import os
|
||||
|
||||
cdef class tdmripper:
|
||||
cdef class tdm_reaper:
|
||||
|
||||
# C++ instance of class => stack allocated (requires nullary constructor!)
|
||||
cdef tdm_reaper tdminst
|
||||
cdef tdm_reaper tdmrip
|
||||
|
||||
# constructor
|
||||
def __cinit__(self):
|
||||
self.tdminst = tdm_reaper()
|
||||
self.tdmrip = tdm_reaper()
|
||||
|
||||
# def set_file(self, string rawfile):
|
||||
# if not os.path.isfile(rawfile) :
|
||||
|
Reference in New Issue
Block a user