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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
from distutils.core import setup, Extension
from distutils.sysconfig import *
from distutils.util import *
import os
import numpy
data_files = []
# Include gsl dlls for the win32 distribution
if get_platform() == "win32":
dlls = ["mlpy\gslwin\libgsl-0.dll", "mlpy\gslwin\libgslcblas-0.dll"]
data_files += [("Lib\site-packages\mlpy", dlls)]
## Python include
py_include = get_python_inc()
## Numpy header files
numpy_lib = os.path.split(numpy.__file__)[0]
numpy_include = os.path.join(numpy_lib, 'core/include')
## Numpy Support include
numpysupport_include = 'mlpy/numpysupport'
## Extra compile args
extra_compile_args = ['-Wno-strict-prototypes']
##### Includes #####
base_include = [py_include, numpy_include]
## Svmcore include
svmcore_include = base_include + [numpysupport_include, 'mlpy/svmcore/include']
## Nncore include
nncore_include = base_include + [numpysupport_include, 'mlpy/nncore/include']
## Canberracore include
canberracore_include = base_include + [numpysupport_include]
####################
##### Sources ######
## Svmcore sources
svmcore_sources = ['mlpy/svmcore/src/alloc.c', 'mlpy/svmcore/src/sort.c',
'mlpy/svmcore/src/sampling.c', 'mlpy/svmcore/src/unique.c',
'mlpy/svmcore/src/dist.c', 'mlpy/svmcore/src/svm.c',
'mlpy/svmcore/src/matrix.c', 'mlpy/svmcore/src/rsfn.c',
'mlpy/svmcore/src/rnd.c', 'mlpy/svmcore/svmcore.c',
'mlpy/numpysupport/numpysupport.c']
## Nncore sources
nncore_sources = ['mlpy/nncore/src/alloc.c', 'mlpy/nncore/src/sort.c',
'mlpy/nncore/src/unique.c', 'mlpy/nncore/src/dist.c',
'mlpy/nncore/src/nn.c', 'mlpy/nncore/nncore.c',
'mlpy/numpysupport/numpysupport.c']
## Canberracore sources
canberracore_sources = ['mlpy/canberracore/canberracore.c',
'mlpy/numpysupport/numpysupport.c']
####################
# Setup
setup(name = 'MLPY',
version = '2.2.0',
requires = ['numpy (>= 1.1.0)', 'gsl (>= 1.8)'],
description = 'mlpy - Machine Learning Py - high-performance Python package for predictive modeling',
author = 'mlpy Developers - FBK-MPBA',
author_email = 'albanese@fbk.eu',
url = 'https://mlpy.fbk.eu',
download_url = 'https://mlpy.fbk.eu/wiki/MlpyDownloads',
license='GPLv3',
classifiers=['Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: BSD',
'Operating System :: Unix',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Programming Language :: C',
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
],
packages=['mlpy'],
ext_modules=[Extension('mlpy.svmcore', svmcore_sources,
include_dirs=svmcore_include,
extra_compile_args=extra_compile_args),
Extension('mlpy.nncore', nncore_sources,
include_dirs=nncore_include,
extra_compile_args=extra_compile_args),
Extension('mlpy.canberracore', canberracore_sources,
include_dirs=canberracore_include,
extra_compile_args=extra_compile_args),
Extension('mlpy.hccore', ['mlpy/hccore/hccore.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args),
Extension('mlpy.dwtcore', ['mlpy/dwtcore/dwt.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args,
libraries=['gsl', 'gslcblas', 'm']),
Extension('mlpy.uwtcore', ['mlpy/uwtcore/uwt.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args,
libraries=['gsl', 'gslcblas', 'm']),
Extension('mlpy.gslpy', ['mlpy/gslpy.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args,
libraries=['gsl', 'gslcblas', 'm']),
Extension('mlpy.cwb', ['mlpy/cwt/cwb.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args,
libraries=['gsl', 'gslcblas', 'm']),
Extension('mlpy.peaksd', ['mlpy/peaksd.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args),
Extension('mlpy.misc', ['mlpy/misc.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args),
Extension('mlpy.dtwcore', ['mlpy/dtwcore/dtwcore.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args),
Extension('mlpy.kmeanscore', ['mlpy/kmeanscore/kmeanscore.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args,
libraries=['gsl', 'gslcblas', 'm']),
Extension('mlpy.kernel', ['mlpy/kernel/kernel.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args,
libraries=['m']),
Extension('mlpy.spectralreg', ['mlpy/spectralreg/spectralreg.c'],
include_dirs=base_include,
extra_compile_args=extra_compile_args),
],
scripts=['mlpy/tools/irelief-sigma', 'mlpy/tools/srda-landscape',
'mlpy/tools/svm-landscape', 'mlpy/tools/fda-landscape',
'mlpy/tools/knn-landscape', 'mlpy/tools/pda-landscape',
'mlpy/tools/dlda-landscape', 'mlpy/tools/borda',
'mlpy/tools/canberra', 'mlpy/tools/canberraq'],
data_files = data_files
)
|