Add custom setuptools script for breezy slam

This commit is contained in:
Piv
2020-01-20 21:35:22 +10:30
parent 23a7d1cf8b
commit 03f8485bd5

51
breezyslam/setuppip.py Normal file
View File

@@ -0,0 +1,51 @@
from setuptools import setup, find_packages
from platform import machine
OPT_FLAGS = []
SIMD_FLAGS = []
arch = machine()
print(arch)
if arch in ['i686', 'x86_64']:
SIMD_FLAGS = ['-msse3']
arch = 'i686'
elif arch == 'armv7l':
OPT_FLAGS = ['-O3']
SIMD_FLAGS = ['-mfpu=neon']
else:
arch = 'sisd'
SOURCES = [
'pybreezyslam.c',
'pyextension_utils.c',
'../c/coreslam.c',
'../c/coreslam_' + arch + '.c',
'../c/random.c',
'../c/ziggurat.c']
from setuptools.extension import Extension
module = Extension('pybreezyslam',
sources = SOURCES,
extra_compile_args = ['-std=gnu99'] + SIMD_FLAGS + OPT_FLAGS
)
setup(
name='BreezySLAM',
version='0.1',
author="Michael Pivato",
author_email="m.pivato@hotmail.com",
description="Simple, efficient SLAM in Python",
packages=find_packages(),
ext_modules = [module],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)