forked from williamstein/psage
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup_stephan.py
More file actions
397 lines (320 loc) · 15.6 KB
/
Copy pathsetup_stephan.py
File metadata and controls
397 lines (320 loc) · 15.6 KB
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
from __future__ import print_function
#################################################################################
#
# (c) Copyright 2010 William Stein
#
# This file is part of PSAGE
#
# PSAGE is free software: you can redistribute it and/or modify
# 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.
#
# PSAGE is distributed in the hope that it will be useful,
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#################################################################################
import os, sys
if sys.maxsize != 2**63 - 1:
print("*"*70)
print("The PSAGE library only works on 64-bit computers. Terminating build.")
print("*"*70)
sys.exit(1)
import build_system
SAGE_ROOT = os.environ['SAGE_ROOT']
SAGE_LOCAL = os.environ['SAGE_LOCAL']
INCLUDES = ['%s/%s/'%(SAGE_ROOT,x) for x in
( 'src/sage', 'src/sage/gsl', 'src',
'local/lib/python2.7/site-packages/sage/ext/',
'local/lib/python2.7/site-packages/cysignals/',
'src/sage/ext',
'src/build/cythonized/','src/build/cythonized/sage/ext',
)] \
+ ['%s/%s/'%(SAGE_LOCAL,x) for x in
('include', 'include/python',
'include/python2.7')]
print("INCLUDES=",INCLUDES)
if '-ba' in sys.argv:
print("Rebuilding all Cython extensions.")
sys.argv.remove('-ba')
FORCE = True
else:
FORCE = False
def Extension(*args, **kwds):
if 'include_dirs' not in kwds:
kwds['include_dirs'] = INCLUDES
else:
kwds['include_dirs'] += INCLUDES
if 'force' not in kwds:
kwds['force'] = FORCE
# Disable warnings when running GCC step -- cython has already parsed the code and
# generated any warnings; the GCC ones are noise.
if 'extra_compile_args' not in kwds:
kwds['extra_compile_args'] = ['-w']
else:
kwds['extra_compile_args'].append('-w')
E = build_system.Extension(*args, **kwds)
return E
numpy_include_dirs = [os.path.join(SAGE_LOCAL,
'lib/python/site-packages/numpy/core/include')]
ext_modules = [
# Remove until the database is rewritten to not use ZODB (which was removed from Sage 5.8)
# Extension("psage.ellff.ellff",
# ["psage/ellff/ellff.pyx",
# "psage/ellff/ell.cpp",
# "psage/ellff/ell_surface.cpp",
# "psage/ellff/euler.cpp",
# "psage/ellff/helper.cpp",
# "psage/ellff/jacobi.cpp",
# "psage/ellff/lzz_pEExtra.cpp",
# "psage/ellff/lzz_pEratX.cpp"],
# language = 'c++'),
# Extension("psage.function_fields.function_field_element",
# ["psage/function_fields/function_field_element.pyx"]),
# Extension("psage.modform.jacobiforms.jacobiformd1nn_fourierexpansion_cython",
# ["psage/modform/jacobiforms/jacobiformd1nn_fourierexpansion_cython.pyx"]),
# Extension("psage.modform.paramodularforms.siegelmodularformg2_misc_cython",
# ["psage/modform/paramodularforms/siegelmodularformg2_misc_cython.pyx"]),
# Extension("psage.modform.paramodularforms.siegelmodularformg2_fourierexpansion_cython",
# ["psage/modform/paramodularforms/siegelmodularformg2_fourierexpansion_cython.pyx"]),
# Extension("psage.modform.paramodularforms.siegelmodularformg2vv_fegenerators_cython",
# ["psage/modform/paramodularforms/siegelmodularformg2vv_fegenerators_cython.pyx"]),
# Extension("psage.modform.paramodularforms.paramodularformd2_fourierexpansion_cython",
# ["psage/modform/paramodularforms/paramodularformd2_fourierexpansion_cython.pyx"]),
# Extension("psage.modform.siegel.fastmult",
# ["psage/modform/siegel/fastmult.pyx"]),
# Extension('psage.modform.maass.mysubgroups_alg',
# ['psage/modform/maass/mysubgroups_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.modform.maass.maass_forms_alg',
# ['psage/modform/maass/maass_forms_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.modform.maass.lpkbessel',
# ['psage/modform/maass/lpkbessel.pyx'],
# libraries = ['m', 'gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension("psage.modform.rational.modular_symbol_map",
# ["psage/modform/rational/modular_symbol_map.pyx"]),
# Extension("psage.modform.rational.padic_elliptic_lseries_fast",
# ["psage/modform/rational/padic_elliptic_lseries_fast.pyx"]),
# Extension("psage.modform.hilbert.sqrt5.sqrt5_fast",
# ["psage/modform/hilbert/sqrt5/sqrt5_fast.pyx"],
# libraries = ['ntl', 'gmp'],
# language = 'c++'),
# Extension("psage.ellcurve.lseries.sqrt5",
# ["psage/ellcurve/lseries/sqrt5.pyx"],
# libraries = ['ntl', 'gmp'],
# language = 'c++'),
# Extension("psage.ellcurve.lseries.helper",
# ["psage/ellcurve/lseries/helper.pyx"]),
# Extension('psage.ellcurve.galrep.wrapper',
# sources = ['psage/ellcurve/galrep/wrapper.pyx', 'psage/ellcurve/galrep/galrep.c'],
# libraries = ['gmp']),
# Extension('psage.ellcurve.minmodel.sqrt5',
# sources = ['psage/ellcurve/minmodel/sqrt5.pyx'],
# libraries = ['gmp']),
# Extension('psage.rh.mazur_stein.game',
# sources = ['psage/rh/mazur_stein/game.pyx']),
# Extension('psage.rh.mazur_stein.book_cython',
# sources = ['psage/rh/mazur_stein/book_cython.pyx']),
# Extension("psage.ellcurve.lseries.fast_twist",
# ["psage/ellcurve/lseries/fast_twist.pyx"],
# libraries = ['gsl']),
# Extension("psage.ellcurve.lseries.aplist_sqrt5",
# ["psage/ellcurve/lseries/aplist_sqrt5.pyx"],
# language = 'c++'),
# Extension("psage.number_fields.sqrt5.prime",
# ["psage/number_fields/sqrt5/prime.pyx"],
# libraries = ['pari']),
# Extension("psage.modform.rational.special_fast",
# # ["psage/modform/rational/special_fast.pyx", SAGE_ROOT + "/devel/sage/sage/libs/flint/fmpq_poly.c"],
# ["psage/modform/rational/special_fast.pyx"],
# libraries = ['gmp', 'flint'],
# language = 'c++',
# include_dirs = [SAGE_LOCAL + '/include/FLINT/', SAGE_ROOT + '/devel/sage/sage/libs/flint/'],
# extra_compile_args = ['-std=c99']),
# Extension("psage.ellcurve.xxx.rankbound",
# sources = [ 'psage/ellcurve/xxx/rankbound.pyx',
# 'psage/ellcurve/xxx/rankbound_.cc',
# 'psage/ellcurve/xxx/mathlib.cc',
# 'psage/libs/smalljac/wrapper_g1.c'],
# libraries = ['gmp', 'm'],
# include_dirs = ['psage/libs/smalljac/'],
# language = 'c'
# )
]
# for g in [1, 2]:
# e = Extension('psage.libs.smalljac.wrapper%s'%g,
# sources = ['psage/libs/smalljac/wrapper%s.pyx'%g,
# 'psage/libs/smalljac/wrapper_g%s.c'%g],
# libraries = ['gmp', 'm'])
# ext_modules.append(e)
## Fredrik Stroemberg: my additional modules.
my_extensions = [
# Extension('psage.rings.mpc_extras',
# sources = ['psage/rings/mpc_extras.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp']),
# Extension('psage.modform.maass.inc_gamma',
# ['psage/modform/maass/inc_gamma.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp']),
# Extension('psage.modform.maass.mysubgroups_alg',
# ['psage/modform/maass/mysubgroups_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc']),
# Extension('psage.modform.maass.sl2z_subgroups_alg',
# ['psage/modform/maass/sl2z_subgroups_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc']),
# Extension('psage.modform.maass.permutation_alg',
# ['psage/modform/maass/permutation_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc']),
# Extension('psage.modform.maass.maass_forms_parallel_alg',
# ['psage/modform/maass/maass_forms_parallel_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp']),
# Extension('psage.modform.maass.pullback_algorithms',
# ['psage/modform/maass/pullback_algorithms.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# extra_compile_args=['-fopenmp'],
# include_dirs = numpy_include_dirs,
# extra_link_args=['-fopenmp']),
# Extension('psage.modform.maass.linear_system',
# ['psage/modform/maass/linear_system.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.modform.maass.automorphic_forms_alg',
# ['psage/modform/maass/automorphic_forms_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs,
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp']),
# Extension('psage.modform.hilbert.hn_class',
# ['psage/modform/hilbert/hn_class.pyx'],
# libraries = ['m']),
# Extension('psage.modform.hilbert.hilbert_modular_group_alg',
# ['psage/modform/hilbert/hilbert_modular_group_alg.pyx'],
# libraries = ["flint", "gmp", "gmpxx", "m","ntl"],
# language="c"),
# Extension('psage.zfunctions.selberg_z_alg',
# ['psage/zfunctions/selberg_z_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs,
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp']),
# Extension('psage.modform.maass.vv_harmonic_weak_maass_forms_alg',
# ['psage/modform/maass/vv_harmonic_weak_maass_forms_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.modform.maass.maass_forms_phase2',
# sources=['psage/modform/maass/maass_forms_phase2.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.modform.maass.lpkbessel',
# ['psage/modform/maass/lpkbessel.pyx']),
# Extension('psage.modules.vector_complex_dense',
# sources = ['psage/modules/vector_complex_dense.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.modules.vector_real_mpfr_dense',
# sources = ['psage/modules/vector_real_mpfr_dense.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.modules.weil_module_alg',
# sources = ['psage/modules/weil_module_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension('psage.matrix.matrix_complex_dense',
# sources = ['psage/matrix/matrix_complex_dense.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp'],
# include_dirs = numpy_include_dirs),
# Extension('psage.matrix.linalg_complex_dense',
# sources = ['psage/matrix/linalg_complex_dense.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp']),
# Extension('psage.modform.maass.poincare_series_alg',
# ['psage/modform/maass/poincare_series_alg.pyx'],
# libraries = ['m','gmp','mpfr','mpc']),
# Extension('psage.modform.maass.poincare_series_alg_vv',
# ['psage/modform/maass/poincare_series_alg_vv.pyx'],
# libraries = ['m','gmp','mpfr','mpc']),
# Extension('psage.modform.maass.eisenstein_series',
# ['psage/modform/maass/eisenstein_series.pyx'],
# libraries = ['m','gmp','mpfr','mpc'],
# include_dirs = numpy_include_dirs),
# Extension("psage.modform.maass.test_parallel",
# sources = [ 'psage/modform/maass/test_parallel.pyx' ],
# libraries = ['m','gmp','mpfr','mpc'],
# extra_compile_args=['-fopenmp'],
# extra_link_args=['-fopenmp'])
]
ext_modules.extend(my_extensions)
## Stephan Ehlen's additional modules
sehlen_extensions = [
Extension('psage.modules.weil_invariants',
sources = ['psage/modules/weil_invariants.pyx'],
libraries = ['m']
)
]
ext_modules.extend(sehlen_extensions)
# I just had a long chat with Robert Bradshaw (a Cython dev), and he
# told me the following functionality -- turning an Extension with
# Cython code into one without -- along with proper dependency
# checking, is now included in the latest development version of
# Cython (Nov 2, 2010). It's supposed to be a rewrite he did of the
# code in the Sage library. Hence once that gets released, we should
# switch to using it here.
build_system.cythonize(ext_modules)
build_system.setup(
name = 'psage',
version = "2014.x.x",
description = "PSAGE: Software for Arithmetic Geometry",
author = 'William Stein',
author_email = 'wstein@gmail.com',
url = 'http://purple.sagemath.org',
license = 'GPL v2+',
packages = ['psage',
# 'psage.ellcurve',
# 'psage.ellcurve.lseries',
# # 'psage.ellff',
# 'psage.function_fields',
# 'psage.lmfdb',
# 'psage.lmfdb.ellcurves',
# 'psage.lmfdb.ellcurves.sqrt5',
# 'psage.matrix',
'psage.modform',
# 'psage.modform.fourier_expansion_framework',
# 'psage.modform.fourier_expansion_framework.gradedexpansions',
# 'psage.modform.fourier_expansion_framework.modularforms',
# 'psage.modform.fourier_expansion_framework.monoidpowerseries',
# 'psage.modform.hilbert',
# 'psage.modform.hilbert.sqrt5',
# 'psage.modform.rational',
# 'psage.modform.siegel',
# 'psage.modform.jacobiforms',
# 'psage.modform.maass',
'psage.modules',
'psage.modform.weilrep_tools',
'psage.number_fields',
'psage.number_fields.sqrt5',
'psage.rh',
'psage.rh.mazur_stein',
'psage.rings',
'psage.zfunctions'
],
platforms = ['any'],
download_url = 'NA',
ext_modules = ext_modules
)