forked from INM-6/elephant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
79 lines (74 loc) · 2.94 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# -*- coding: utf-8 -*-
import os
import platform
from setuptools import setup, Extension
with open(os.path.join(os.path.dirname(__file__),
"elephant", "VERSION")) as version_file:
version = version_file.read().strip()
with open("README.md") as f:
long_description = f.read()
with open('requirements/requirements.txt') as fp:
install_requires = fp.read().splitlines()
extras_require = {}
for extra in ['extras', 'docs', 'tests', 'tutorials', 'cuda', 'opencl']:
with open('requirements/requirements-{0}.txt'.format(extra)) as fp:
extras_require[extra] = fp.read()
if platform.system() == "Windows":
fim_module = Extension(
name='elephant.spade_src.fim',
sources=['elephant/spade_src/src/fim.cpp'],
include_dirs=['elephant/spade_src/include'],
language='c++',
libraries=[],
extra_compile_args=[
'-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM',
'-Dfim_EXPORTS', '-fopenmp', '/std:c++17'])
elif platform.system() == "Darwin":
fim_module = Extension(
name = 'elephant.spade_src.fim',
sources = ['elephant/spade_src/src/fim.cpp'],
include_dirs = ['elephant/spade_src/include'],
language = 'c++',
libraries = ['pthread', 'omp'],
extra_compile_args = [
'-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM',
'-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra',
'-Weffc++', '-Wunused-result', '-Werror', '-Werror=return-type',
'-Xpreprocessor',
'-fopenmp', '-std=gnu++17'])
else:
fim_module = Extension(
name='elephant.spade_src.fim',
sources=['elephant/spade_src/src/fim.cpp'],
include_dirs=['elephant/spade_src/include'],
language='c++',
libraries=['pthread', 'gomp'],
extra_compile_args=[
'-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM',
'-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra',
'-Weffc++', '-Wunused-result', '-Werror',
'-fopenmp', '-std=gnu++17'])
setup(
name="elephant",
version=version,
packages=['elephant', 'elephant.test'],
include_package_data=True,
ext_modules=[fim_module],
install_requires=install_requires,
extras_require=extras_require,
author="Elephant authors and contributors",
author_email="[email protected]",
description="Elephant is a package for analysis of electrophysiology data in Python",
long_description=long_description,
license="BSD",
url='http://python-elephant.org',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering']
)