-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
46 lines (42 loc) · 1.18 KB
/
Copy pathsetup.py
File metadata and controls
46 lines (42 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# setup.py
import os
from setuptools import setup, Extension
import pybind11
source_file = []
def getallsource(path="src"):
if "/." in path:
return
if path.endswith(".hpp"):
source_file.append(path)
return
child = os.listdir(path)
for c in child:
getallsource(os.path.join(path, c))
return
getallsource()
source_file = ["#include ../"+ i for i in source_file]
# Define the extension module
fastsolver_module = Extension(
'fastsolver',
sources=['python/pybind.cpp'],
include_dirs=[
pybind11.get_include(),
os.getenv('OPENBLAS_INCLUDE', '/opt/homebrew/opt/openblas/include'),
os.getenv('FFTW_INCLUDE', '/opt/homebrew/opt/fftw/include') # Add FFTW include path
],
library_dirs=[
os.getenv('OPENBLAS_LIB', '/opt/homebrew/opt/openblas/lib'),
os.getenv('FFTW_LIB', '/opt/homebrew/opt/fftw/lib')
],
libraries=['openblas', 'fftw3'], # Add FFTW library to link against
language='c++',
extra_compile_args=['-std=c++17']
)
# Setup configuration
setup(
name='fastsolver',
version='0.1.1',
description='Python bindings for FASTSolver',
ext_modules=[fastsolver_module],
install_requires=['pybind11'],
)