Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Path: code / alex / psage / setup.py
Views: 184606
1
#################################################################################
2
#
3
# (c) Copyright 2010 William Stein
4
#
5
# This file is part of PSAGE
6
#
7
# PSAGE is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# PSAGE is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#
20
#################################################################################
21
22
23
import os, sys
24
25
26
if sys.maxint != 2**63 - 1:
27
print "*"*70
28
print "The PSAGE library only works on 64-bit computers. Terminating build."
29
print "*"*70
30
sys.exit(1)
31
32
33
import build_system
34
35
SAGE_ROOT = os.environ['SAGE_ROOT']
36
SAGE_LOCAL = os.environ['SAGE_LOCAL']
37
38
INCLUDES = ['%s/%s/'%(SAGE_ROOT,x) for x in
39
('devel/sage/sage/ext', 'devel/sage', 'devel/sage/sage/gsl', \
40
'src/build/cythonized/sage/ext', 'src')] \
41
+ ['%s/%s/'%(SAGE_LOCAL,x) for x in
42
('include', 'include/python', 'lib/python2.7/site-packages/cysignals')] + ['../','../../','.','../../../','../../../../']
43
if '-ba' in sys.argv:
44
print "Rebuilding all Cython extensions."
45
sys.argv.remove('-ba')
46
FORCE = True
47
else:
48
FORCE = False
49
50
def Extension(*args, **kwds):
51
if not kwds.has_key('include_dirs'):
52
kwds['include_dirs'] = INCLUDES
53
else:
54
kwds['include_dirs'] += INCLUDES
55
if not kwds.has_key('force'):
56
kwds['force'] = FORCE
57
58
# Disable warnings when running GCC step -- cython has already parsed the code and
59
# generated any warnings; the GCC ones are noise.
60
if not kwds.has_key('extra_compile_args'):
61
kwds['extra_compile_args'] = ['-w']
62
else:
63
kwds['extra_compile_args'].append('-w')
64
65
return build_system.Extension(*args, **kwds)
66
67
68
numpy_include_dirs = [os.path.join(SAGE_LOCAL,
69
'lib/python/site-packages/numpy/core/include')]
70
71
ext_modules = [
72
# Extension("psage.ellff.ellff",
73
# ["psage/ellff/ellff.pyx",
74
# "psage/ellff/ell.cpp",
75
# "psage/ellff/ell_surface.cpp",
76
# "psage/ellff/euler.cpp",
77
# "psage/ellff/helper.cpp",
78
# "psage/ellff/jacobi.cpp",
79
# "psage/ellff/lzz_pEExtra.cpp",
80
# "psage/ellff/lzz_pEratX.cpp"],
81
# language = 'c++'),
82
#
83
# Extension("psage.function_fields.function_field_element",
84
# ["psage/function_fields/function_field_element.pyx"]),
85
#
86
# Extension("psage.modform.jacobiforms.jacobiformd1nn_fourierexpansion_cython",
87
# ["psage/modform/jacobiforms/jacobiformd1nn_fourierexpansion_cython.pyx"]),
88
#
89
# Extension("psage.modform.paramodularforms.siegelmodularformg2_misc_cython",
90
# ["psage/modform/paramodularforms/siegelmodularformg2_misc_cython.pyx"]),
91
#
92
# Extension("psage.modform.paramodularforms.siegelmodularformg2_fourierexpansion_cython",
93
# ["psage/modform/paramodularforms/siegelmodularformg2_fourierexpansion_cython.pyx"]),
94
#
95
# Extension("psage.modform.paramodularforms.siegelmodularformg2vv_fegenerators_cython",
96
# ["psage/modform/paramodularforms/siegelmodularformg2vv_fegenerators_cython.pyx"]),
97
#
98
# Extension("psage.modform.paramodularforms.paramodularformd2_fourierexpansion_cython",
99
# ["psage/modform/paramodularforms/paramodularformd2_fourierexpansion_cython.pyx"]),
100
#
101
# Extension("psage.modform.siegel.fastmult",
102
# ["psage/modform/siegel/fastmult.pyx"]),
103
#
104
# Extension('psage.modform.maass.mysubgroups_alg',
105
# ['psage/modform/maass/mysubgroups_alg.pyx']),
106
#
107
# Extension('psage.modform.maass.maass_forms_alg',
108
# ['psage/modform/maass/maass_forms_alg.pyx'],
109
# include_dirs = numpy_include_dirs),
110
#
111
# Extension('psage.modform.maass.lpkbessel',
112
# ['psage/modform/maass/lpkbessel.pyx']),
113
114
115
# Extension("psage.modform.rational.modular_symbol_map",
116
# ["psage/modform/rational/modular_symbol_map.pyx"]),
117
118
# Extension("psage.modform.rational.padic_elliptic_lseries_fast",
119
# ["psage/modform/rational/padic_elliptic_lseries_fast.pyx"]),
120
121
Extension("psage.modform.hilbert.sqrt5.sqrt5_fast",
122
["psage/modform/hilbert/sqrt5/sqrt5_fast.pyx"],
123
libraries = ['ntl', 'gmp'],
124
language = 'c++'),
125
126
Extension("psage.ellcurve.lseries.sqrt5",
127
["psage/ellcurve/lseries/sqrt5.pyx"],
128
libraries = ['ntl', 'gmp'],
129
language = 'c++'),
130
131
Extension("psage.ellcurve.lseries.helper",
132
["psage/ellcurve/lseries/helper.pyx"]),
133
134
Extension('psage.ellcurve.galrep.wrapper',
135
sources = ['psage/ellcurve/galrep/wrapper.pyx', 'psage/ellcurve/galrep/galrep.c'],
136
libraries = ['gmp']),
137
138
Extension('psage.ellcurve.minmodel.sqrt5',
139
sources = ['psage/ellcurve/minmodel/sqrt5.pyx'],
140
libraries = ['gmp']),
141
142
# Extension('psage.rh.mazur_stein.game',
143
# sources = ['psage/rh/mazur_stein/game.pyx']),
144
145
# Extension('psage.rh.mazur_stein.book_cython',
146
# sources = ['psage/rh/mazur_stein/book_cython.pyx']),
147
148
Extension("psage.ellcurve.lseries.fast_twist",
149
["psage/ellcurve/lseries/fast_twist.pyx"],
150
libraries = ['gsl']),
151
152
Extension("psage.ellcurve.lseries.aplist_sqrt5",
153
["psage/ellcurve/lseries/aplist_sqrt5.pyx"],
154
language = 'c++'),
155
156
Extension("psage.number_fields.sqrt5.prime",
157
["psage/number_fields/sqrt5/prime.pyx"],
158
libraries = ['pari']),
159
160
# Extension("psage.modform.rational.special_fast",
161
# ["psage/modform/rational/special_fast.pyx"],
162
# libraries = ['gmp', 'flint'],
163
# language = 'c++',
164
# include_dirs = [SAGE_LOCAL + '/include/FLINT/', SAGE_ROOT + '/devel/sage/sage/libs/flint/'],
165
# extra_compile_args = ['-std=c99']),
166
167
Extension("psage.ellcurve.xxx.rankbound",
168
sources = [ 'psage/ellcurve/xxx/rankbound.pyx',
169
'psage/ellcurve/xxx/rankbound_.cc',
170
'psage/ellcurve/xxx/mathlib.cc',
171
'psage/libs/smalljac/wrapper_g1.c'],
172
libraries = ['gmp', 'm'],
173
include_dirs = ['psage/libs/smalljac/'],
174
language = 'c'
175
)
176
]
177
178
for g in [1, 2]:
179
e = Extension('psage.libs.smalljac.wrapper%s'%g,
180
sources = ['psage/libs/smalljac/wrapper%s.pyx'%g,
181
'psage/libs/smalljac/wrapper_g%s.c'%g],
182
libraries = ['gmp', 'm'])
183
ext_modules.append(e)
184
185
186
187
# I just had a long chat with Robert Bradshaw (a Cython dev), and he
188
# told me the following functionality -- turning an Extension with
189
# Cython code into one without -- along with proper dependency
190
# checking, is now included in the latest development version of
191
# Cython (Nov 2, 2010). It's supposed to be a rewrite he did of the
192
# code in the Sage library. Hence once that gets released, we should
193
# switch to using it here.
194
195
build_system.cythonize(ext_modules)
196
197
build_system.setup(
198
name = 'psage',
199
version = "2011.01.06",
200
description = "PSAGE: Software for Arithmetic Geometry",
201
author = 'William Stein',
202
author_email = '[email protected]',
203
url = 'http://purple.sagemath.org',
204
license = 'GPL v2+',
205
packages = ['psage',
206
'psage.ellcurve',
207
'psage.ellcurve.lseries',
208
209
#'psage.ellff',
210
211
#'psage.function_fields',
212
213
'psage.lmfdb',
214
'psage.lmfdb.ellcurves',
215
'psage.lmfdb.ellcurves.sqrt5',
216
217
'psage.modform',
218
219
#'psage.modform.fourier_expansion_framework',
220
#'psage.modform.fourier_expansion_framework.gradedexpansions',
221
#'psage.modform.fourier_expansion_framework.modularforms',
222
#'psage.modform.fourier_expansion_framework.monoidpowerseries',
223
224
'psage.modform.hilbert',
225
'psage.modform.hilbert.sqrt5',
226
227
'psage.modform.rational',
228
229
#'psage.modform.siegel',
230
#'psage.modform.jacobiforms',
231
#'psage.modform.maass',
232
233
'psage.number_fields',
234
'psage.number_fields.sqrt5',
235
236
#'psage.rh',
237
#'psage.rh.mazur_stein'
238
],
239
platforms = ['any'],
240
download_url = 'NA',
241
ext_modules = ext_modules
242
)
243
244
245