-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
69 lines (61 loc) · 2.22 KB
/
setup.py
File metadata and controls
69 lines (61 loc) · 2.22 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# #!/usr/bin/env python
import sys
import os
import glob
from setuptools import setup, find_packages, Extension
from distutils.command.build_ext import build_ext
import numpy as np
libpath = os.path.abspath(os.path.join(os.path.dirname(__file__), './build/lib'))
class custom_build_ext(build_ext):
def build_extensions(self):
os.system('make lib_cuda')
build_ext.build_extensions(self)
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
nvcodec_dir = '/usr/local/lib'
if 'VIRTUAL_ENV' in os.environ:
nvcodec_dir = os.path.join(os.environ['VIRTUAL_ENV'], 'lib')
sources = ['nvcodec-python.cpp'] + glob.glob('src/**/*.cpp', recursive=True)
module = Extension('nvcodec', sources=sources, language='c++',
include_dirs=['src', 'src/cuvid', '/usr/local/cuda/include',np.get_include(),],
library_dirs=['build/lib', '/usr/local/cuda-11.2/targets/x86_64-linux/lib'],
libraries=['avformat', 'avcodec','avutil','nvcuvid','nvidia-encode','cuda', 'stdc++', 'm', 'cudart', 'color_space'],
)
from distutils.core import setup, Extension
setup(name='pynvcodec',
version='0.0.6',
ext_modules=[module],
cmdclass={'build_ext': custom_build_ext},
author="Usingnet",
author_email="developer@usingnet.com",
license="MIT",
description="Python interface for nvcodec. Encode/Decode H264 with Nvidia GPU Hardware Acceleration.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/UsingNet/nvcodec-python",
# packages=setuptools.find_packages(),
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Environment :: GPU :: NVIDIA CUDA :: 11.0",
],
keywords=[
"pynvcodec",
"nvcodec",
"h264",
"encode",
"decode",
"h264 encode",
"h264 decode",
"gpu",
"nvidia"
],
python_requires=">=3.6",
project_urls={
'Source': 'https://github.com/UsingNet/nvcodec-python',
'Tracker': 'https://github.com/UsingNet/nvcodec-python/issues',
},
install_requires=['numpy>=1.17']
)