forked from oseledets/ttpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build system refactoring, add setup script into root directory.
- Loading branch information
Showing
11 changed files
with
333 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/usr/bin/env python | ||
"""TTPY: Python implementation of the Tensor Train (TT) - Toolbox. | ||
Python implementation of the Tensor Train (TT) - Toolbox. It contains several important packages for working with the | ||
TT-format in Python. It is able to do TT-interpolation, solve linear systems, eigenproblems, solve dynamical problems. | ||
Several computational routines are done in Fortran (which can be used separatedly), and are wrapped with the f2py tool. | ||
""" | ||
|
||
from numpy.distutils.core import setup | ||
from numpy.distutils.misc_util import Configuration | ||
|
||
|
||
PLATFORMS = [ | ||
'Windows', | ||
'Linux', | ||
'Solaris', | ||
'Mac OS-X', | ||
'Unix', | ||
] | ||
|
||
CLASSIFIERS = """\ | ||
Development Status :: 4 - Beta | ||
Intended Audience :: Science/Research | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: MIT License | ||
Programming Language :: Fortran | ||
Programming Language :: Python | ||
Programming Language :: Python :: 2 | ||
Programming Language :: Python :: 2.6 | ||
Programming Language :: Python :: 2.7 | ||
Programming Language :: Python :: Implementation :: CPython | ||
Topic :: Software Development | ||
Topic :: Scientific/Engineering | ||
Operating System :: Microsoft :: Windows | ||
Operating System :: POSIX | ||
Operating System :: Unix | ||
Operating System :: MacOS | ||
""" | ||
|
||
MAJOR = 0 | ||
MINOR = 0 | ||
MICRO = 0 | ||
ISRELEASED = False | ||
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) | ||
|
||
|
||
def configuration(parent_package='', top_path=None): | ||
config = Configuration(None, parent_package, top_path) | ||
config.set_options( | ||
ignore_setup_xxx_py=True, | ||
assume_default_configuration=True, | ||
delegate_options_to_subpackages=True, | ||
quiet=True, | ||
) | ||
config.add_subpackage('tt') | ||
return config | ||
|
||
def setup_package(): | ||
metadata = dict( | ||
name='ttpy', | ||
version=VERSION, | ||
description = DOCLINES[0], | ||
long_description = '\n'.join(DOCLINES[2:]), | ||
url='https://github.com/oseledets/ttpy', | ||
download_url='https://github.com/oseledets/ttpy/tarball/v' + VERSION, | ||
author='Ivan Oseledets', | ||
maintainer='Ivan Oseledets', | ||
platforms=PLATFORMS, | ||
classifiers=[line for line in CLASSIFIERS.split('\n') if line], | ||
configuration=configuration, | ||
) | ||
|
||
setup(**metadata) | ||
|
||
|
||
if __name__ == '__main__': | ||
setup_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
# This script will build the main subpackages | ||
from distutils.util import get_platform | ||
import sys | ||
# setup.py | ||
# This script will build the main subpackages | ||
# See LICENSE for details | ||
|
||
from __future__ import print_function, absolute_import | ||
from numpy.distutils.misc_util import Configuration | ||
|
||
def configuration(parent_package='', top_path=None): | ||
from numpy.distutils.misc_util import Configuration, get_info | ||
config = Configuration('amen', parent_package, top_path) | ||
|
||
src = ['amen_f90.f90', 'amen_f90.pyf'] | ||
AMEN_SRC = [ | ||
'amen_f90.f90', | ||
'amen_f90.pyf', | ||
] | ||
|
||
|
||
def configuration(parent_package='', top_path=None): | ||
config = Configuration('amen', parent_package, top_path) | ||
config.add_extension( | ||
'amen_f90', | ||
sources=src, | ||
sources=AMEN_SRC, | ||
depends=['mytt'], | ||
libraries=['mytt']) | ||
libraries=['mytt'], | ||
) | ||
|
||
return config | ||
|
||
|
||
if __name__ == '__main__': | ||
print 'This is the wrong setup.py to run' | ||
print('This is the wrong setup.py to run') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,49 @@ | ||
# This script will build the main subpackages | ||
from distutils.util import get_platform | ||
import sys | ||
# setup.py | ||
# This script will build the main subpackages | ||
# See LICENSE for details | ||
|
||
from __future__ import print_function, absolute_import | ||
from numpy.distutils.misc_util import Configuration | ||
from os.path import join | ||
|
||
def configuration(parent_package='', top_path=None): | ||
from numpy.distutils.misc_util import Configuration, get_info | ||
config = Configuration('core', parent_package, top_path) | ||
tt_fort = '../tt-fort' | ||
|
||
src = ['tt_f90.f90', 'tt_f90.pyf'] | ||
TTFORT_DIR = '../tt-fort' | ||
|
||
TT_SRC = [ | ||
'tt_f90.f90', | ||
'tt_f90.pyf', | ||
] | ||
|
||
TTCORE_SRC = [ | ||
'matrix_util.f90', | ||
'core.f90', | ||
] | ||
|
||
|
||
def configuration(parent_package='', top_path=None): | ||
ttcore_src = [join(TTFORT_DIR, x) for x in TTCORE_SRC] | ||
ttcore_src.append('core.pyf') | ||
|
||
config = Configuration('core', parent_package, top_path) | ||
config.add_extension( | ||
'tt_f90', sources=src, depends=[ | ||
'mytt', 'print_lib'], libraries=[ | ||
'mytt', 'print_lib']) | ||
tt_src = ['matrix_util.f90', 'core.f90'] | ||
src = [tt_fort + '/' + x for x in tt_src] | ||
src += ['core.pyf'] | ||
config.add_extension('core_f90', sources=src) | ||
'tt_f90', | ||
sources=TT_SRC, | ||
depends=[ | ||
'mytt', | ||
'print_lib', | ||
], | ||
libraries=[ | ||
'mytt', | ||
'print_lib' | ||
], | ||
) | ||
config.add_extension( | ||
'core_f90', | ||
sources=ttcore_src, | ||
) | ||
|
||
return config | ||
|
||
|
||
if __name__ == '__main__': | ||
print 'This is the wrong setup.py to run' | ||
print('This is the wrong setup.py to run') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
#This script will build the main subpackages | ||
from distutils.util import get_platform | ||
import sys | ||
# setup.py | ||
# This script will build the main subpackages | ||
# See LICENSE for details | ||
|
||
from __future__ import print_function, absolute_import | ||
from numpy.distutils.misc_util import Configuration | ||
|
||
|
||
def configuration(parent_package='',top_path=None): | ||
from numpy.distutils.misc_util import Configuration, get_info | ||
config = Configuration('cross', parent_package, top_path) | ||
config.add_subpackage('rectcross') | ||
|
||
return config | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
print 'This is the wrong setup.py to run' | ||
|
||
|
||
print('This is the wrong setup.py to run') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,48 @@ | ||
# This script will build the main subpackages | ||
# setup.py | ||
# This script will build the main subpackages | ||
# See LICENSE for details | ||
|
||
from __future__ import print_function, absolute_import | ||
from numpy.distutils.misc_util import Configuration | ||
from os.path import join | ||
|
||
|
||
TTFORT_DIR = '../tt-fort/' | ||
PRIMME_DIR = '../tt-fort/primme' | ||
|
||
TTEIGB_SRC = [ | ||
'ttals.f90', | ||
'tt_eigb.f90', | ||
] | ||
|
||
|
||
def configuration(parent_package='', top_path=None): | ||
from numpy.distutils.misc_util import Configuration, get_info | ||
tteigb_src = [join(TTFORT_DIR, x) for x in TTEIGB_SRC] | ||
tteigb_src.append('tt_eigb.pyf') | ||
|
||
config = Configuration('eigb', parent_package, top_path) | ||
tt_fort = '../tt-fort/' | ||
primme_dir = '../tt-fort/primme/' | ||
src = ['ttals.f90', 'tt_eigb.f90'] | ||
src = [tt_fort + '/' + x for x in src] | ||
config.add_library('primme', sources=[join(primme_dir, '*.c')] + [join(primme_dir, '*.f')], | ||
include_dirs=['.']) # ,macros=['F77UNDERSCORE']) | ||
src.append('tt_eigb.pyf') | ||
config.add_library( | ||
'primme', | ||
sources=[join(PRIMME_DIR, '*.c')] + [join(PRIMME_DIR, '*.f')], | ||
include_dirs=['.'], | ||
) | ||
config.add_extension( | ||
'tt_eigb', sources=src, depends=[ | ||
'primme', 'mytt', 'print_lib'], libraries=[ | ||
'primme', 'mytt', 'print_lib']) | ||
'tt_eigb', | ||
sources=tteigb_src, | ||
depends=[ | ||
'primme', | ||
'mytt', | ||
'print_lib', | ||
], | ||
libraries=[ | ||
'primme', | ||
'mytt', | ||
'print_lib', | ||
], | ||
) | ||
|
||
return config | ||
|
||
|
||
if __name__ == '__main__': | ||
print 'This is the wrong setup.py to run' | ||
|
||
|
||
#, include_dirs=None, define_macros=None, undef_macros=None, library_dirs=None, libraries=None, runtime_library_dirs=None, extra_objects=None, extra_compile_args=None, extra_link_args=None, export_symbols=None, swig_opts=None, depends=None, language=None, f2py_options=None, module_dirs | ||
print('This is the wrong setup.py to run') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,59 @@ | ||
# This script will build the main subpackages | ||
# setup.py | ||
# This script will build the main subpackages | ||
# See LICENSE for details | ||
|
||
from __future__ import print_function, absolute_import | ||
from numpy.distutils.misc_util import Configuration | ||
from os.path import join | ||
|
||
|
||
TTFORT_DIR = '../tt-fort' | ||
EXPM_DIR = '../tt-fort/expm' | ||
|
||
EXPOKIT_SRC = [ | ||
'explib.f90', | ||
'normest.f90', | ||
'expokit.f', | ||
'dlacn1.f', | ||
'dlapst.f', | ||
'dlarpc.f', | ||
'zlacn1.f', | ||
] | ||
|
||
TTKSL_SRC = [ | ||
'ttals.f90', | ||
'tt_ksl.f90', | ||
] | ||
|
||
|
||
def configuration(parent_package='', top_path=None): | ||
from numpy.distutils.misc_util import Configuration, get_info | ||
config = Configuration('ksl', parent_package, top_path) | ||
tt_dir = '../tt-fort/' | ||
exp_dir = '../tt-fort/expm' | ||
src = ['ttals.f90', 'tt_ksl.f90'] | ||
exp_src = [ | ||
'explib.f90', | ||
'normest.f90', | ||
'expokit.f', | ||
'dlacn1.f', | ||
'dlapst.f', | ||
'dlarpc.f', | ||
'zlacn1.f'] | ||
exp_src = [exp_dir + '/' + x for x in exp_src] | ||
config.add_library('expokit', sources=exp_src) | ||
src = [tt_dir + x for x in src] | ||
src.append('tt_ksl.pyf') | ||
config.add_extension('dyn_tt', sources=src, depends=['print_lib', 'expokit', 'mytt'], | ||
libraries=['print_lib', 'expokit', 'mytt'],) | ||
return config | ||
expokit_src = [join(EXPM_DIR, x) for x in EXPOKIT_SRC] | ||
|
||
#from distutils.core import setup | ||
#from numpy.distutils.core import setup, Extension | ||
#src = ['tt_f90.f90','tt_f90.pyf'] | ||
#inc_dir = ['tt-fort'] | ||
#lib = ['tt-fort/mytt.a'] | ||
#ext = Extension('tt_f90', src, include_dirs=inc_dir) | ||
#setup(ext_modules = [ext]) | ||
ttksl_src = [join(TTFORT_DIR, x) for x in TTKSL_SRC] | ||
ttksl_src.append('tt_ksl.pyf') | ||
|
||
config = Configuration('ksl', parent_package, top_path) | ||
config.add_library( | ||
'expokit', | ||
sources=expokit_src, | ||
) | ||
config.add_extension( | ||
'dyn_tt', | ||
sources=ttksl_src, | ||
depends=[ | ||
'print_lib', | ||
'expokit', | ||
'mytt', | ||
], | ||
libraries=[ | ||
'print_lib', | ||
'expokit', | ||
'mytt', | ||
], | ||
) | ||
|
||
if __name__ == '__main__': | ||
print 'This is the wrong setup.py to run' | ||
return config | ||
|
||
|
||
#, include_dirs=None, define_macros=None, undef_macros=None, library_dirs=None, libraries=None, runtime_library_dirs=None, extra_objects=None, extra_compile_args=None, extra_link_args=None, export_symbols=None, swig_opts=None, depends=None, language=None, f2py_options=None, module_dirs | ||
if __name__ == '__main__': | ||
print('This is the wrong setup.py to run') |
Oops, something went wrong.