Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
CFLAGS ?= -march=native -O3 -mno-avx512f
CFLAGS ?= -march=native -O3

# Function to check if compiler supports a flag
# returns flag if flag is supported, otherwise empty string
check_cflag = $(shell echo "int main(){}" | $(CC) -x c - $(1) -o /dev/null >/dev/null 2>&1 && echo $(1))

# Try to add flags only if supported
CFLAGS += $(call check_cflag,-mno-avx512f)

# The following conditional statement appends "-std=gnu99" to CFLAGS when the
# compiler does not define __STDC_VERSION__. The idea is that many older
Expand Down
40 changes: 21 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@


def readme():
with open(os.path.join(here, 'README.md'), 'r', 'utf-8') as f:
with open(os.path.join(here, "README.md"), "r", "utf-8") as f:
return f.read()


class CustomDevelop(develop.develop, object):
"""
Class needed for "pip install -e ."
"""

def run(self):
subprocess.check_call("make lib", shell=True)
super(CustomDevelop, self).run()
Expand All @@ -26,27 +27,28 @@ class CustomBuildPy(build_py.build_py, object):
"""
Class needed for "pip install ransac"
"""

def run(self):
super(CustomBuildPy, self).run()
subprocess.check_call("make lib", shell=True)
subprocess.check_call("cp -r lib build/lib/", shell=True)



requirements = ['numpy']

extras_require = {'test': ['pytest']}

setup(name="ransac",
version="1.0.4",
description="Python wrapper of Enric Meinhardt's RANSAC implementation",
long_description=readme(),
long_description_content_type="text/markdown",
url="https://github.com/cmla/ransac",
author="Carlo de Franchis",
author_email="carlo.de-franchis@ens-cachan.fr",
py_modules=["ransac"],
install_requires=requirements,
extras_require=extras_require,
cmdclass={'develop': CustomDevelop,
'build_py': CustomBuildPy})
requirements = ["numpy"]

extras_require = {"test": ["pytest"]}

setup(
name="ransac",
version="1.0.5",
description="Python wrapper of Enric Meinhardt's RANSAC implementation",
long_description=readme(),
long_description_content_type="text/markdown",
url="https://github.com/cmla/ransac",
author="Carlo de Franchis",
author_email="carlo.de-franchis@ens-cachan.fr",
py_modules=["ransac"],
install_requires=requirements,
extras_require=extras_require,
cmdclass={"develop": CustomDevelop, "build_py": CustomBuildPy},
)