setup.py 4.37 KB
Newer Older
1
2
3
4
################################################################################
#                                                                              #
#  Copyright 2015-2019 Max Planck Institute for Dynamics and Self-Organization #
#                                                                              #
Cristian Lalescu's avatar
Cristian Lalescu committed
5
#  This file is part of TurTLE.                                                #
6
#                                                                              #
Cristian Lalescu's avatar
Cristian Lalescu committed
7
#  TurTLE is free software: you can redistribute it and/or modify                #
8
9
10
11
#  it under the terms of the GNU General Public License as published           #
#  by the Free Software Foundation, either version 3 of the License,           #
#  or (at your option) any later version.                                      #
#                                                                              #
Cristian Lalescu's avatar
Cristian Lalescu committed
12
#  TurTLE is distributed in the hope that it will be useful,                     #
13
14
15
16
17
#  but WITHOUT ANY WARRANTY; without even the implied warranty of              #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
#  GNU General Public License for more details.                                #
#                                                                              #
#  You should have received a copy of the GNU General Public License           #
Cristian Lalescu's avatar
Cristian Lalescu committed
18
#  along with TurTLE.  If not, see <http://www.gnu.org/licenses/>                #
19
20
21
22
#                                                                              #
# Contact: Cristian.Lalescu@ds.mpg.de                                          #
#                                                                              #
################################################################################
Cristian Lalescu's avatar
Cristian Lalescu committed
23
24
25



26
27
28
AUTHOR = 'Cristian C Lalescu'
AUTHOR_EMAIL = 'Cristian.Lalescu@ds.mpg.de'

29
import os
30
import shutil
Cristian Lalescu's avatar
Cristian Lalescu committed
31
import datetime
32
import sys
33
import subprocess
34
35
36
import pickle

### package versioning
37
38
import get_version
VERSION = get_version.main()
Cristian Lalescu's avatar
Cristian Lalescu committed
39
print('This is TurTLE version ' + VERSION)
Cristian Lalescu's avatar
Cristian Lalescu committed
40

41

42
import distutils.cmd
43

44
class CompileLibCommand(distutils.cmd.Command):
Cristian Lalescu's avatar
Cristian Lalescu committed
45
    description = 'Compile TurTLE library.'
Cristian Lalescu's avatar
Cristian Lalescu committed
46
47
    user_options = [
            ('timing-output=', None, 'Toggle timing output.'),
48
            ('fftw-estimate=', None, 'Use FFTW ESTIMATE.'),
49
            ('split-fftw-many=', None, 'Turn on SPLIT_FFTW_MANY.'),
Berenger Bramas's avatar
Berenger Bramas committed
50
            ('disable-fftw-omp=', None, 'Turn Off FFTW OpenMP.'),
Cristian Lalescu's avatar
Cristian Lalescu committed
51
52
53
            ]
    def initialize_options(self):
        self.timing_output = 0
54
        self.fftw_estimate = 0
Berenger Bramas's avatar
Berenger Bramas committed
55
        self.disable_fftw_omp = 0
56
        self.split_fftw_many = 0
57
        return None
Cristian Lalescu's avatar
Cristian Lalescu committed
58
59
    def finalize_options(self):
        self.timing_output = (int(self.timing_output) == 1)
60
        self.split_fftw_many = (int(self.split_fftw_many) == 1)
61
        self.fftw_estimate = (int(self.fftw_estimate) == 1)
Berenger Bramas's avatar
Berenger Bramas committed
62
        self.disable_fftw_omp = (int(self.disable_fftw_omp) == 1)
63
        return None
64
    def run(self):
65
66
        ### save compiling information
        pickle.dump(
67
                {'install_date' : now,
68
69
                 'VERSION' : VERSION,
                 'git_revision' : git_revision},
Cristian Lalescu's avatar
Cristian Lalescu committed
70
                open('turtle/install_info.pickle', 'wb'),
71
                protocol = 2)
Cristian Lalescu's avatar
Cristian Lalescu committed
72
        return None
73

74
from setuptools import setup
Cristian Lalescu's avatar
Cristian Lalescu committed
75
76

setup(
Cristian Lalescu's avatar
Cristian Lalescu committed
77
        name = 'TurTLE',
78
        packages = ['TurTLE', 'TurTLE/test'],
Chichi Lalescu's avatar
Chichi Lalescu committed
79
        install_requires = ['numpy>=1.8', 'h5py>=2.2.1'],
80
        package_data = {'TurTLE': ['test/B32p1e4_checkpoint_0.h5']},
Cristian Lalescu's avatar
Cristian Lalescu committed
81
82
        entry_points = {
            'console_scripts': [
Cristian Lalescu's avatar
Cristian Lalescu committed
83
84
85
86
87
                'turtle = TurTLE.__main__:main',
                'turtle.test_NSVEparticles = TurTLE.test.test_turtle_NSVEparticles:main',
                'turtle.test_particles = TurTLE.test.test_particles:main',
                'turtle.test_Parseval = TurTLE.test.test_Parseval:main',
                'turtle.test_fftw = TurTLE.test.test_fftw:main'],
Cristian Lalescu's avatar
Cristian Lalescu committed
88
            },
89
        version = VERSION,
Cristian Lalescu's avatar
Cristian Lalescu committed
90
91
########################################################################
# useless stuff folows
92
93
# if anyone knows how to open the README when calling this script from
# cmake, please let me know.
Cristian Lalescu's avatar
Cristian Lalescu committed
94
########################################################################
Cristian Lalescu's avatar
Cristian Lalescu committed
95
        description = 'Turbulence Tools: Lagrangian and Eulerian',
96
        #long_description = open('${PROJECT_SOURCE_DIR}/README.rst', 'r').read(),
97
98
        author = AUTHOR,
        author_email = AUTHOR_EMAIL,
99
        license = 'GPL version 3.0')
Cristian Lalescu's avatar
Cristian Lalescu committed
100