From 5157b341a0a20c54775daedce776f6e93438062e Mon Sep 17 00:00:00 2001 From: Rasmus Larsen Date: Sun, 29 Jan 2023 21:15:09 +0100 Subject: [PATCH] fix wheel build --- setup.py | 13 +++++++++++++ whispercpp.pyx | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 46997e7..4d712be 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from distutils.core import setup +from distutils.extension import Extension from Cython.Build import cythonize import numpy, os, sys @@ -10,6 +11,17 @@ else: os.environ['CFLAGS'] = '-mavx -mavx2 -mfma -mf16c -O3 -std=c11' os.environ['CXXFLAGS'] = '-mavx -mavx2 -mfma -mf16c -O3 -std=c++11' +ext_modules = [ + Extension( + name="whispercpp", + sources=["whispercpp.pyx", "whisper.cpp/whisper.cpp"], + language="c++", + extra_compile_args=["-std=c++11"], + ) +] +ext_modules = cythonize(ext_modules) + +whisper_clib = ('whisper_clib', {'sources': ['whisper.cpp/ggml.c']}) setup( name='whispercpp', @@ -17,6 +29,7 @@ setup( description='Python bindings for whisper.cpp', author='Luke Southam', author_email='luke@devthe.com', + libraries=[whisper_clib], ext_modules = cythonize("whispercpp.pyx"), include_dirs = ['./whisper.cpp/', numpy.get_include()], install_requires=[ diff --git a/whispercpp.pyx b/whispercpp.pyx index 486e1fc..abbbc0d 100644 --- a/whispercpp.pyx +++ b/whispercpp.pyx @@ -1,7 +1,5 @@ #!python # cython: language_level=3 -# distutils: language = c++ -# distutils: sources= ./whisper.cpp/whisper.cpp ./whisper.cpp/ggml.c import ffmpeg import numpy as np