from setuptools import setup, Extension
from torch.utils import cpp_extension
import torch


torch_lib_path = torch.utils.cpp_extension.library_paths()[0]

setup(
    name='gac_core',
    ext_modules=[
        cpp_extension.CppExtension(
            'gac_core',
            ['gac_core.cpp'],
            extra_compile_args=['-O3', '-fvisibility=hidden'],
            extra_link_args=[f'-Wl,-rpath,{torch_lib_path}']
        )
    ],
    cmdclass={
        'build_ext': cpp_extension.BuildExtension.with_options(
            no_python_abi_suffix=True,
            use_ninja=False
        )
    },
    zip_safe=False,
)