Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/numpy/f2py/f2py2e.py
7757 views
1
#!/usr/bin/env python3
2
"""
3
4
f2py2e - Fortran to Python C/API generator. 2nd Edition.
5
See __usage__ below.
6
7
Copyright 1999--2011 Pearu Peterson all rights reserved,
8
Pearu Peterson <[email protected]>
9
Permission to use, modify, and distribute this software is given under the
10
terms of the NumPy License.
11
12
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
13
$Date: 2005/05/06 08:31:19 $
14
Pearu Peterson
15
16
"""
17
import sys
18
import os
19
import pprint
20
import re
21
22
from . import crackfortran
23
from . import rules
24
from . import cb_rules
25
from . import auxfuncs
26
from . import cfuncs
27
from . import f90mod_rules
28
from . import __version__
29
from . import capi_maps
30
31
f2py_version = __version__.version
32
numpy_version = __version__.version
33
errmess = sys.stderr.write
34
# outmess=sys.stdout.write
35
show = pprint.pprint
36
outmess = auxfuncs.outmess
37
38
__usage__ =\
39
f"""Usage:
40
41
1) To construct extension module sources:
42
43
f2py [<options>] <fortran files> [[[only:]||[skip:]] \\
44
<fortran functions> ] \\
45
[: <fortran files> ...]
46
47
2) To compile fortran files and build extension modules:
48
49
f2py -c [<options>, <build_flib options>, <extra options>] <fortran files>
50
51
3) To generate signature files:
52
53
f2py -h <filename.pyf> ...< same options as in (1) >
54
55
Description: This program generates a Python C/API file (<modulename>module.c)
56
that contains wrappers for given fortran functions so that they
57
can be called from Python. With the -c option the corresponding
58
extension modules are built.
59
60
Options:
61
62
--2d-numpy Use numpy.f2py tool with NumPy support. [DEFAULT]
63
--2d-numeric Use f2py2e tool with Numeric support.
64
--2d-numarray Use f2py2e tool with Numarray support.
65
--g3-numpy Use 3rd generation f2py from the separate f2py package.
66
[NOT AVAILABLE YET]
67
68
-h <filename> Write signatures of the fortran routines to file <filename>
69
and exit. You can then edit <filename> and use it instead
70
of <fortran files>. If <filename>==stdout then the
71
signatures are printed to stdout.
72
<fortran functions> Names of fortran routines for which Python C/API
73
functions will be generated. Default is all that are found
74
in <fortran files>.
75
<fortran files> Paths to fortran/signature files that will be scanned for
76
<fortran functions> in order to determine their signatures.
77
skip: Ignore fortran functions that follow until `:'.
78
only: Use only fortran functions that follow until `:'.
79
: Get back to <fortran files> mode.
80
81
-m <modulename> Name of the module; f2py generates a Python/C API
82
file <modulename>module.c or extension module <modulename>.
83
Default is 'untitled'.
84
85
--[no-]lower Do [not] lower the cases in <fortran files>. By default,
86
--lower is assumed with -h key, and --no-lower without -h key.
87
88
--build-dir <dirname> All f2py generated files are created in <dirname>.
89
Default is tempfile.mkdtemp().
90
91
--overwrite-signature Overwrite existing signature file.
92
93
--[no-]latex-doc Create (or not) <modulename>module.tex.
94
Default is --no-latex-doc.
95
--short-latex Create 'incomplete' LaTeX document (without commands
96
\\documentclass, \\tableofcontents, and \\begin{{document}},
97
\\end{{document}}).
98
99
--[no-]rest-doc Create (or not) <modulename>module.rst.
100
Default is --no-rest-doc.
101
102
--debug-capi Create C/API code that reports the state of the wrappers
103
during runtime. Useful for debugging.
104
105
--[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77
106
functions. --wrap-functions is default because it ensures
107
maximum portability/compiler independence.
108
109
--include-paths <path1>:<path2>:... Search include files from the given
110
directories.
111
112
--help-link [..] List system resources found by system_info.py. See also
113
--link-<resource> switch below. [..] is optional list
114
of resources names. E.g. try 'f2py --help-link lapack_opt'.
115
116
--f2cmap <filename> Load Fortran-to-Python KIND specification from the given
117
file. Default: .f2py_f2cmap in current directory.
118
119
--quiet Run quietly.
120
--verbose Run with extra verbosity.
121
-v Print f2py version ID and exit.
122
123
124
numpy.distutils options (only effective with -c):
125
126
--fcompiler= Specify Fortran compiler type by vendor
127
--compiler= Specify C compiler type (as defined by distutils)
128
129
--help-fcompiler List available Fortran compilers and exit
130
--f77exec= Specify the path to F77 compiler
131
--f90exec= Specify the path to F90 compiler
132
--f77flags= Specify F77 compiler flags
133
--f90flags= Specify F90 compiler flags
134
--opt= Specify optimization flags
135
--arch= Specify architecture specific optimization flags
136
--noopt Compile without optimization
137
--noarch Compile without arch-dependent optimization
138
--debug Compile with debugging information
139
140
Extra options (only effective with -c):
141
142
--link-<resource> Link extension module with <resource> as defined
143
by numpy.distutils/system_info.py. E.g. to link
144
with optimized LAPACK libraries (vecLib on MacOSX,
145
ATLAS elsewhere), use --link-lapack_opt.
146
See also --help-link switch.
147
148
-L/path/to/lib/ -l<libname>
149
-D<define> -U<name>
150
-I/path/to/include/
151
<filename>.o <filename>.so <filename>.a
152
153
Using the following macros may be required with non-gcc Fortran
154
compilers:
155
-DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN
156
-DUNDERSCORE_G77
157
158
When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY
159
interface is printed out at exit (platforms: Linux).
160
161
When using -DF2PY_REPORT_ON_ARRAY_COPY=<int>, a message is
162
sent to stderr whenever F2PY interface makes a copy of an
163
array. Integer <int> sets the threshold for array sizes when
164
a message should be shown.
165
166
Version: {f2py_version}
167
numpy Version: {numpy_version}
168
Requires: Python 3.5 or higher.
169
License: NumPy license (see LICENSE.txt in the NumPy source code)
170
Copyright 1999 - 2011 Pearu Peterson all rights reserved.
171
https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e"""
172
173
174
def scaninputline(inputline):
175
files, skipfuncs, onlyfuncs, debug = [], [], [], []
176
f, f2, f3, f5, f6, f7, f8, f9, f10 = 1, 0, 0, 0, 0, 0, 0, 0, 0
177
verbose = 1
178
dolc = -1
179
dolatexdoc = 0
180
dorestdoc = 0
181
wrapfuncs = 1
182
buildpath = '.'
183
include_paths = []
184
signsfile, modulename = None, None
185
options = {'buildpath': buildpath,
186
'coutput': None,
187
'f2py_wrapper_output': None}
188
for l in inputline:
189
if l == '':
190
pass
191
elif l == 'only:':
192
f = 0
193
elif l == 'skip:':
194
f = -1
195
elif l == ':':
196
f = 1
197
elif l[:8] == '--debug-':
198
debug.append(l[8:])
199
elif l == '--lower':
200
dolc = 1
201
elif l == '--build-dir':
202
f6 = 1
203
elif l == '--no-lower':
204
dolc = 0
205
elif l == '--quiet':
206
verbose = 0
207
elif l == '--verbose':
208
verbose += 1
209
elif l == '--latex-doc':
210
dolatexdoc = 1
211
elif l == '--no-latex-doc':
212
dolatexdoc = 0
213
elif l == '--rest-doc':
214
dorestdoc = 1
215
elif l == '--no-rest-doc':
216
dorestdoc = 0
217
elif l == '--wrap-functions':
218
wrapfuncs = 1
219
elif l == '--no-wrap-functions':
220
wrapfuncs = 0
221
elif l == '--short-latex':
222
options['shortlatex'] = 1
223
elif l == '--coutput':
224
f8 = 1
225
elif l == '--f2py-wrapper-output':
226
f9 = 1
227
elif l == '--f2cmap':
228
f10 = 1
229
elif l == '--overwrite-signature':
230
options['h-overwrite'] = 1
231
elif l == '-h':
232
f2 = 1
233
elif l == '-m':
234
f3 = 1
235
elif l[:2] == '-v':
236
print(f2py_version)
237
sys.exit()
238
elif l == '--show-compilers':
239
f5 = 1
240
elif l[:8] == '-include':
241
cfuncs.outneeds['userincludes'].append(l[9:-1])
242
cfuncs.userincludes[l[9:-1]] = '#include ' + l[8:]
243
elif l[:15] in '--include_paths':
244
outmess(
245
'f2py option --include_paths is deprecated, use --include-paths instead.\n')
246
f7 = 1
247
elif l[:15] in '--include-paths':
248
f7 = 1
249
elif l[0] == '-':
250
errmess('Unknown option %s\n' % repr(l))
251
sys.exit()
252
elif f2:
253
f2 = 0
254
signsfile = l
255
elif f3:
256
f3 = 0
257
modulename = l
258
elif f6:
259
f6 = 0
260
buildpath = l
261
elif f7:
262
f7 = 0
263
include_paths.extend(l.split(os.pathsep))
264
elif f8:
265
f8 = 0
266
options["coutput"] = l
267
elif f9:
268
f9 = 0
269
options["f2py_wrapper_output"] = l
270
elif f10:
271
f10 = 0
272
options["f2cmap_file"] = l
273
elif f == 1:
274
try:
275
with open(l):
276
pass
277
files.append(l)
278
except OSError as detail:
279
errmess(f'OSError: {detail!s}. Skipping file "{l!s}".\n')
280
elif f == -1:
281
skipfuncs.append(l)
282
elif f == 0:
283
onlyfuncs.append(l)
284
if not f5 and not files and not modulename:
285
print(__usage__)
286
sys.exit()
287
if not os.path.isdir(buildpath):
288
if not verbose:
289
outmess('Creating build directory %s\n' % (buildpath))
290
os.mkdir(buildpath)
291
if signsfile:
292
signsfile = os.path.join(buildpath, signsfile)
293
if signsfile and os.path.isfile(signsfile) and 'h-overwrite' not in options:
294
errmess(
295
'Signature file "%s" exists!!! Use --overwrite-signature to overwrite.\n' % (signsfile))
296
sys.exit()
297
298
options['debug'] = debug
299
options['verbose'] = verbose
300
if dolc == -1 and not signsfile:
301
options['do-lower'] = 0
302
else:
303
options['do-lower'] = dolc
304
if modulename:
305
options['module'] = modulename
306
if signsfile:
307
options['signsfile'] = signsfile
308
if onlyfuncs:
309
options['onlyfuncs'] = onlyfuncs
310
if skipfuncs:
311
options['skipfuncs'] = skipfuncs
312
options['dolatexdoc'] = dolatexdoc
313
options['dorestdoc'] = dorestdoc
314
options['wrapfuncs'] = wrapfuncs
315
options['buildpath'] = buildpath
316
options['include_paths'] = include_paths
317
options.setdefault('f2cmap_file', None)
318
return files, options
319
320
321
def callcrackfortran(files, options):
322
rules.options = options
323
crackfortran.debug = options['debug']
324
crackfortran.verbose = options['verbose']
325
if 'module' in options:
326
crackfortran.f77modulename = options['module']
327
if 'skipfuncs' in options:
328
crackfortran.skipfuncs = options['skipfuncs']
329
if 'onlyfuncs' in options:
330
crackfortran.onlyfuncs = options['onlyfuncs']
331
crackfortran.include_paths[:] = options['include_paths']
332
crackfortran.dolowercase = options['do-lower']
333
postlist = crackfortran.crackfortran(files)
334
if 'signsfile' in options:
335
outmess('Saving signatures to file "%s"\n' % (options['signsfile']))
336
pyf = crackfortran.crack2fortran(postlist)
337
if options['signsfile'][-6:] == 'stdout':
338
sys.stdout.write(pyf)
339
else:
340
with open(options['signsfile'], 'w') as f:
341
f.write(pyf)
342
if options["coutput"] is None:
343
for mod in postlist:
344
mod["coutput"] = "%smodule.c" % mod["name"]
345
else:
346
for mod in postlist:
347
mod["coutput"] = options["coutput"]
348
if options["f2py_wrapper_output"] is None:
349
for mod in postlist:
350
mod["f2py_wrapper_output"] = "%s-f2pywrappers.f" % mod["name"]
351
else:
352
for mod in postlist:
353
mod["f2py_wrapper_output"] = options["f2py_wrapper_output"]
354
return postlist
355
356
357
def buildmodules(lst):
358
cfuncs.buildcfuncs()
359
outmess('Building modules...\n')
360
modules, mnames, isusedby = [], [], {}
361
for item in lst:
362
if '__user__' in item['name']:
363
cb_rules.buildcallbacks(item)
364
else:
365
if 'use' in item:
366
for u in item['use'].keys():
367
if u not in isusedby:
368
isusedby[u] = []
369
isusedby[u].append(item['name'])
370
modules.append(item)
371
mnames.append(item['name'])
372
ret = {}
373
for module, name in zip(modules, mnames):
374
if name in isusedby:
375
outmess('\tSkipping module "%s" which is used by %s.\n' % (
376
name, ','.join('"%s"' % s for s in isusedby[name])))
377
else:
378
um = []
379
if 'use' in module:
380
for u in module['use'].keys():
381
if u in isusedby and u in mnames:
382
um.append(modules[mnames.index(u)])
383
else:
384
outmess(
385
f'\tModule "{name}" uses nonexisting "{u}" '
386
'which will be ignored.\n')
387
ret[name] = {}
388
dict_append(ret[name], rules.buildmodule(module, um))
389
return ret
390
391
392
def dict_append(d_out, d_in):
393
for (k, v) in d_in.items():
394
if k not in d_out:
395
d_out[k] = []
396
if isinstance(v, list):
397
d_out[k] = d_out[k] + v
398
else:
399
d_out[k].append(v)
400
401
402
def run_main(comline_list):
403
"""
404
Equivalent to running::
405
406
f2py <args>
407
408
where ``<args>=string.join(<list>,' ')``, but in Python. Unless
409
``-h`` is used, this function returns a dictionary containing
410
information on generated modules and their dependencies on source
411
files. For example, the command ``f2py -m scalar scalar.f`` can be
412
executed from Python as follows
413
414
You cannot build extension modules with this function, that is,
415
using ``-c`` is not allowed. Use ``compile`` command instead
416
417
Examples
418
--------
419
.. literalinclude:: ../../source/f2py/code/results/run_main_session.dat
420
:language: python
421
422
"""
423
crackfortran.reset_global_f2py_vars()
424
f2pydir = os.path.dirname(os.path.abspath(cfuncs.__file__))
425
fobjhsrc = os.path.join(f2pydir, 'src', 'fortranobject.h')
426
fobjcsrc = os.path.join(f2pydir, 'src', 'fortranobject.c')
427
files, options = scaninputline(comline_list)
428
auxfuncs.options = options
429
capi_maps.load_f2cmap_file(options['f2cmap_file'])
430
postlist = callcrackfortran(files, options)
431
isusedby = {}
432
for plist in postlist:
433
if 'use' in plist:
434
for u in plist['use'].keys():
435
if u not in isusedby:
436
isusedby[u] = []
437
isusedby[u].append(plist['name'])
438
for plist in postlist:
439
if plist['block'] == 'python module' and '__user__' in plist['name']:
440
if plist['name'] in isusedby:
441
# if not quiet:
442
outmess(
443
f'Skipping Makefile build for module "{plist["name"]}" '
444
'which is used by {}\n'.format(
445
','.join(f'"{s}"' for s in isusedby[plist['name']])))
446
if 'signsfile' in options:
447
if options['verbose'] > 1:
448
outmess(
449
'Stopping. Edit the signature file and then run f2py on the signature file: ')
450
outmess('%s %s\n' %
451
(os.path.basename(sys.argv[0]), options['signsfile']))
452
return
453
for plist in postlist:
454
if plist['block'] != 'python module':
455
if 'python module' not in options:
456
errmess(
457
'Tip: If your original code is Fortran source then you must use -m option.\n')
458
raise TypeError('All blocks must be python module blocks but got %s' % (
459
repr(postlist[i]['block'])))
460
auxfuncs.debugoptions = options['debug']
461
f90mod_rules.options = options
462
auxfuncs.wrapfuncs = options['wrapfuncs']
463
464
ret = buildmodules(postlist)
465
466
for mn in ret.keys():
467
dict_append(ret[mn], {'csrc': fobjcsrc, 'h': fobjhsrc})
468
return ret
469
470
471
def filter_files(prefix, suffix, files, remove_prefix=None):
472
"""
473
Filter files by prefix and suffix.
474
"""
475
filtered, rest = [], []
476
match = re.compile(prefix + r'.*' + suffix + r'\Z').match
477
if remove_prefix:
478
ind = len(prefix)
479
else:
480
ind = 0
481
for file in [x.strip() for x in files]:
482
if match(file):
483
filtered.append(file[ind:])
484
else:
485
rest.append(file)
486
return filtered, rest
487
488
489
def get_prefix(module):
490
p = os.path.dirname(os.path.dirname(module.__file__))
491
return p
492
493
494
def run_compile():
495
"""
496
Do it all in one call!
497
"""
498
import tempfile
499
500
i = sys.argv.index('-c')
501
del sys.argv[i]
502
503
remove_build_dir = 0
504
try:
505
i = sys.argv.index('--build-dir')
506
except ValueError:
507
i = None
508
if i is not None:
509
build_dir = sys.argv[i + 1]
510
del sys.argv[i + 1]
511
del sys.argv[i]
512
else:
513
remove_build_dir = 1
514
build_dir = tempfile.mkdtemp()
515
516
_reg1 = re.compile(r'--link-')
517
sysinfo_flags = [_m for _m in sys.argv[1:] if _reg1.match(_m)]
518
sys.argv = [_m for _m in sys.argv if _m not in sysinfo_flags]
519
if sysinfo_flags:
520
sysinfo_flags = [f[7:] for f in sysinfo_flags]
521
522
_reg2 = re.compile(
523
r'--((no-|)(wrap-functions|lower)|debug-capi|quiet)|-include')
524
f2py_flags = [_m for _m in sys.argv[1:] if _reg2.match(_m)]
525
sys.argv = [_m for _m in sys.argv if _m not in f2py_flags]
526
f2py_flags2 = []
527
fl = 0
528
for a in sys.argv[1:]:
529
if a in ['only:', 'skip:']:
530
fl = 1
531
elif a == ':':
532
fl = 0
533
if fl or a == ':':
534
f2py_flags2.append(a)
535
if f2py_flags2 and f2py_flags2[-1] != ':':
536
f2py_flags2.append(':')
537
f2py_flags.extend(f2py_flags2)
538
539
sys.argv = [_m for _m in sys.argv if _m not in f2py_flags2]
540
_reg3 = re.compile(
541
r'--((f(90)?compiler(-exec|)|compiler)=|help-compiler)')
542
flib_flags = [_m for _m in sys.argv[1:] if _reg3.match(_m)]
543
sys.argv = [_m for _m in sys.argv if _m not in flib_flags]
544
_reg4 = re.compile(
545
r'--((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help-fcompiler))')
546
fc_flags = [_m for _m in sys.argv[1:] if _reg4.match(_m)]
547
sys.argv = [_m for _m in sys.argv if _m not in fc_flags]
548
549
del_list = []
550
for s in flib_flags:
551
v = '--fcompiler='
552
if s[:len(v)] == v:
553
from numpy.distutils import fcompiler
554
fcompiler.load_all_fcompiler_classes()
555
allowed_keys = list(fcompiler.fcompiler_class.keys())
556
nv = ov = s[len(v):].lower()
557
if ov not in allowed_keys:
558
vmap = {} # XXX
559
try:
560
nv = vmap[ov]
561
except KeyError:
562
if ov not in vmap.values():
563
print('Unknown vendor: "%s"' % (s[len(v):]))
564
nv = ov
565
i = flib_flags.index(s)
566
flib_flags[i] = '--fcompiler=' + nv
567
continue
568
for s in del_list:
569
i = flib_flags.index(s)
570
del flib_flags[i]
571
assert len(flib_flags) <= 2, repr(flib_flags)
572
573
_reg5 = re.compile(r'--(verbose)')
574
setup_flags = [_m for _m in sys.argv[1:] if _reg5.match(_m)]
575
sys.argv = [_m for _m in sys.argv if _m not in setup_flags]
576
577
if '--quiet' in f2py_flags:
578
setup_flags.append('--quiet')
579
580
modulename = 'untitled'
581
sources = sys.argv[1:]
582
583
for optname in ['--include_paths', '--include-paths', '--f2cmap']:
584
if optname in sys.argv:
585
i = sys.argv.index(optname)
586
f2py_flags.extend(sys.argv[i:i + 2])
587
del sys.argv[i + 1], sys.argv[i]
588
sources = sys.argv[1:]
589
590
if '-m' in sys.argv:
591
i = sys.argv.index('-m')
592
modulename = sys.argv[i + 1]
593
del sys.argv[i + 1], sys.argv[i]
594
sources = sys.argv[1:]
595
else:
596
from numpy.distutils.command.build_src import get_f2py_modulename
597
pyf_files, sources = filter_files('', '[.]pyf([.]src|)', sources)
598
sources = pyf_files + sources
599
for f in pyf_files:
600
modulename = get_f2py_modulename(f)
601
if modulename:
602
break
603
604
extra_objects, sources = filter_files('', '[.](o|a|so|dylib)', sources)
605
include_dirs, sources = filter_files('-I', '', sources, remove_prefix=1)
606
library_dirs, sources = filter_files('-L', '', sources, remove_prefix=1)
607
libraries, sources = filter_files('-l', '', sources, remove_prefix=1)
608
undef_macros, sources = filter_files('-U', '', sources, remove_prefix=1)
609
define_macros, sources = filter_files('-D', '', sources, remove_prefix=1)
610
for i in range(len(define_macros)):
611
name_value = define_macros[i].split('=', 1)
612
if len(name_value) == 1:
613
name_value.append(None)
614
if len(name_value) == 2:
615
define_macros[i] = tuple(name_value)
616
else:
617
print('Invalid use of -D:', name_value)
618
619
from numpy.distutils.system_info import get_info
620
621
num_info = {}
622
if num_info:
623
include_dirs.extend(num_info.get('include_dirs', []))
624
625
from numpy.distutils.core import setup, Extension
626
ext_args = {'name': modulename, 'sources': sources,
627
'include_dirs': include_dirs,
628
'library_dirs': library_dirs,
629
'libraries': libraries,
630
'define_macros': define_macros,
631
'undef_macros': undef_macros,
632
'extra_objects': extra_objects,
633
'f2py_options': f2py_flags,
634
}
635
636
if sysinfo_flags:
637
from numpy.distutils.misc_util import dict_append
638
for n in sysinfo_flags:
639
i = get_info(n)
640
if not i:
641
outmess('No %s resources found in system'
642
' (try `f2py --help-link`)\n' % (repr(n)))
643
dict_append(ext_args, **i)
644
645
ext = Extension(**ext_args)
646
sys.argv = [sys.argv[0]] + setup_flags
647
sys.argv.extend(['build',
648
'--build-temp', build_dir,
649
'--build-base', build_dir,
650
'--build-platlib', '.',
651
# disable CCompilerOpt
652
'--disable-optimization'])
653
if fc_flags:
654
sys.argv.extend(['config_fc'] + fc_flags)
655
if flib_flags:
656
sys.argv.extend(['build_ext'] + flib_flags)
657
658
setup(ext_modules=[ext])
659
660
if remove_build_dir and os.path.exists(build_dir):
661
import shutil
662
outmess('Removing build directory %s\n' % (build_dir))
663
shutil.rmtree(build_dir)
664
665
666
def main():
667
if '--help-link' in sys.argv[1:]:
668
sys.argv.remove('--help-link')
669
from numpy.distutils.system_info import show_all
670
show_all()
671
return
672
673
# Probably outdated options that were not working before 1.16
674
if '--g3-numpy' in sys.argv[1:]:
675
sys.stderr.write("G3 f2py support is not implemented, yet.\\n")
676
sys.exit(1)
677
elif '--2e-numeric' in sys.argv[1:]:
678
sys.argv.remove('--2e-numeric')
679
elif '--2e-numarray' in sys.argv[1:]:
680
# Note that this errors becaust the -DNUMARRAY argument is
681
# not recognized. Just here for back compatibility and the
682
# error message.
683
sys.argv.append("-DNUMARRAY")
684
sys.argv.remove('--2e-numarray')
685
elif '--2e-numpy' in sys.argv[1:]:
686
sys.argv.remove('--2e-numpy')
687
else:
688
pass
689
690
if '-c' in sys.argv[1:]:
691
run_compile()
692
else:
693
run_main(sys.argv[1:])
694
695