Exemplo n.º 1
0
 def compile():
     print 'compiling fortran subroutines'
     import numpy.f2py.f2py2e as f2py2e
     import sys
     sys.argv +=  "-c -m fortranfunction fortranfunction.f90".split()
     f2py2e.main()
     sys.argv = [sys.argv[0]]
Exemplo n.º 2
0
    def _run_f2py(self, argv, show_captured=False, verbosity=0):
        """
        Here we directly call the numpy.f2py.f2py2e.run_compile() entry point,
        after some small amount of setup to get sys.argv and the current
        working directory set appropriately.
        """
        old_argv = sys.argv
        old_cwd = os.getcwdu() if sys.version_info[0] == 2 else os.getcwd()
        try:
            sys.argv = ['f2py'] + list(map(str, argv))
            if verbosity > 1:
                print("Running...\n   %s" % ' '.join(sys.argv))

            os.chdir(self._lib_dir)
            try:
                with capture_output() as captured:
                    f2py2e.main()
                if show_captured or verbosity > 2:
                    captured()
            except SystemExit as e:
                captured()
                raise UsageError(str(e))
        finally:
            sys.argv = old_argv
            os.chdir(old_cwd)
Exemplo n.º 3
0
# See:
# https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e
from numpy.f2py.f2py2e import main

main()
Exemplo n.º 4
0
# See http://cens.ioc.ee/projects/f2py2e/
from __future__ import division, print_function

from numpy.f2py.f2py2e import main

main()
Exemplo n.º 5
0
#!/usr/bin/env python.exe
# See http://cens.ioc.ee/projects/f2py2e/
try:
    from numpy.f2py import f2py2e
except:
    import f2py2e
f2py2e.main()
Exemplo n.º 6
0
# -*- coding: utf-8 -*-
import re
import sys

from numpy.f2py.f2py2e import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())