Skip to content

Commit

Permalink
fix build files
Browse files Browse the repository at this point in the history
  • Loading branch information
hosimesi committed Aug 14, 2023
1 parent 88ee3a3 commit 05e32dc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "numpy", "Cython"]
build-backend = "setuptools.build_meta"
42 changes: 21 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import os

import numpy
from setuptools import Extension, find_packages, setup

try:
from Cython.Build import cythonize

ext = ".pyx"
except ImportError:
cythonize = None
ext = ".cpp"

ext_modules = [
Extension(
"ffm.libffm",
extra_compile_args=["-Wall", "-O3", "-std=c++0x", "-march=native", "-DUSESSE"],
sources=[os.path.join("ffm", "libffm" + ext), "ffm.cpp"],
include_dirs=[".", numpy.get_include()],
language="c++",
)
]
def make_extensions():
import numpy
try:
from Cython.Build import cythonize
ext = ".pyx"
except ImportError:
cythonize = None
ext = ".cpp"
ext_modules = [
Extension(
"ffm.libffm",
extra_compile_args=["-Wall", "-O3", "-std=c++0x", "-march=native", "-DUSESSE"],
sources=[os.path.join("ffm", "libffm" + ext), "ffm.cpp"],
include_dirs=[".", numpy.get_include()],
language="c++",
)
]
if cythonize is not None:
ext_modules = cythonize(ext_modules)
return ext_modules

if cythonize is not None:
ext_modules = cythonize(ext_modules)

setup(
name="ffm",
version="0.4.0",
description="LibFFM Python Package",
long_description="LibFFM Python Package",
install_requires=["numpy"],
ext_modules=ext_modules,
ext_modules=make_extensions(),
maintainer="",
maintainer_email="",
zip_safe=False,
Expand Down

0 comments on commit 05e32dc

Please sign in to comment.