forked from ikinsella/locaNMF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
49 lines (43 loc) · 1.52 KB
/
setup.py
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
47
48
49
import os
import sys
import setuptools
# from setuptools import setup
from torch.utils.cpp_extension import CUDAExtension, BuildExtension
with open("README.md", "r", encoding="utf8") as fh:
long_description = fh.read()
ENV = os.environ["CONDA_PREFIX"] # Absolute path of active conda env root
LIBRARY_DIRS = [os.path.join(ENV, "lib")] # .[so,dylib]
INCLUDE_DIRS = [os.path.join(ENV, "include")]
ext_modules = []
if '--with-extension' in sys.argv:
ext_modules.append(
CUDAExtension('cuhals',
['./locanmf/cuhals.cpp', './locanmf/cuhals_kernels.cu'],
extra_compile_args={'cxx': ["-fopenmp", "-I"+INCLUDE_DIRS[0]],
'nvcc': []}))
sys.argv.remove('--with-extension')
# setup(name='locaNMF',
# ext_modules=ext_modules,
# cmdclass={
# 'build_ext': BuildExtension
# })
setuptools.setup(
name="locanmf",
version="1.0",
author="Ian August Kinsella",
author_email="[email protected]",
description="Demixer using Localized semi-Nonnegative Matrix Factorization method",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ikinsella/locaNMF",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GPL License",
"Operating System :: OS Independent",
],
ext_modules=ext_modules,
cmdclass={
'build_ext': BuildExtension
},
)