setup.py 3.1 KB
Newer Older
Cristian Lalescu's avatar
Cristian Lalescu committed
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
########################################################################
#
#  Copyright 2015 Max Planck Institute for Dynamics and SelfOrganization
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Contact: Cristian.Lalescu@ds.mpg.de
#
########################################################################



import os

########################################################################
#### these you're supposed to adapt to your environment

# first off, this is the install folder for fftw and/or openmpi etc
local_install_dir = '/scratch.local/chichi/installs'

include_dirs = ['src',
                '/usr/lib64/mpi/gcc/openmpi/include',
Chichi Lalescu's avatar
Chichi Lalescu committed
33
                '/usr/include/mpich',
Cristian Lalescu's avatar
Cristian Lalescu committed
34
35
36
37
                os.path.join(local_install_dir, 'include')]
########################################################################


38
39
40
AUTHOR = 'Cristian C Lalescu'
AUTHOR_EMAIL = 'Cristian.Lalescu@ds.mpg.de'

Cristian Lalescu's avatar
Cristian Lalescu committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import datetime
now = datetime.datetime.now()
date_name = '{0:0>4}{1:0>2}{2:0>2}'.format(now.year, now.month, now.day)
VERSION = date_name

src_file_list = ['field_descriptor',
                 'fftw_tools',
                 'vector_field',
                 'fluid_solver_base',
                 'fluid_solver',
                 'slab_field_particles',
                 'tracers',
                 'spline_n1',
                 'spline_n2',
                 'spline_n3']

57
header_list = ['cpp/base.hpp'] + ['cpp/' + fname + '.hpp' for fname in src_file_list]
Cristian Lalescu's avatar
Cristian Lalescu committed
58
59
60

# not sure we need the MANIFEST.in file, but I might as well
with open('MANIFEST.in', 'w') as manifest_in_file:
61
    for fname in ['cpp/' + fname + '.cpp' for fname in src_file_list] + header_list:
Cristian Lalescu's avatar
Cristian Lalescu committed
62
63
64
65
66
67
68
69
70
71
72
        manifest_in_file.write('include {0}\n'.format(fname))

libraries = ['fftw3_mpi',
             'fftw3',
             'fftw3f_mpi',
             'fftw3f']

from setuptools import setup, Extension

libbfps = Extension(
        'libbfps',
73
        sources = ['bfps/cpp/' + fname + '.cpp' for fname in src_file_list],
Cristian Lalescu's avatar
Cristian Lalescu committed
74
75
        include_dirs = include_dirs,
        libraries = libraries,
76
77
        library_dirs = [os.path.join(local_install_dir, 'lib'),
                        os.path.join(local_install_dir, 'lib64')])
Cristian Lalescu's avatar
Cristian Lalescu committed
78
79
80
81

setup(
        name = 'bfps',
        packages = ['bfps'],
Chichi Lalescu's avatar
Chichi Lalescu committed
82
        install_requires = ['numpy>=1.8', 'matplotlib>=1.3'],
Cristian Lalescu's avatar
Cristian Lalescu committed
83
        ext_modules = [libbfps],
84
        package_data = {'bfps': header_list},
Cristian Lalescu's avatar
Cristian Lalescu committed
85
86
87
########################################################################
# useless stuff folows
########################################################################
88
89
        author = AUTHOR,
        author_email = AUTHOR_EMAIL,
Cristian Lalescu's avatar
Cristian Lalescu committed
90
91
92
        version = VERSION,
        license = 'Apache Version 2.0')