~ubuntu-branches/ubuntu/feisty/python-numpy/feisty

« back to all changes in this revision

Viewing changes to numpy/distutils/fcompiler/nag.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-07-12 10:00:24 UTC
  • Revision ID: james.westby@ubuntu.com-20060712100024-5lw9q2yczlisqcrt
Tags: upstream-0.9.8
ImportĀ upstreamĀ versionĀ 0.9.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
import sys
 
3
 
 
4
from numpy.distutils.cpuinfo import cpu
 
5
from numpy.distutils.fcompiler import FCompiler
 
6
 
 
7
class NAGFCompiler(FCompiler):
 
8
 
 
9
    compiler_type = 'nag'
 
10
    version_pattern =  r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
 
11
 
 
12
    executables = {
 
13
        'version_cmd'  : ["f95", "-V"],
 
14
        'compiler_f77' : ["f95", "-fixed"],
 
15
        'compiler_fix' : ["f95", "-fixed"],
 
16
        'compiler_f90' : ["f95"],
 
17
        'linker_so'    : ["f95"],
 
18
        'archiver'     : ["ar", "-cr"],
 
19
        'ranlib'       : ["ranlib"]
 
20
        }
 
21
 
 
22
    def get_flags_linker_so(self):
 
23
        if sys.platform=='darwin':
 
24
            return ['-unsharedf95','-Wl,-bundle,-flat_namespace,-undefined,suppress']
 
25
        return ["-Wl,-shared"]
 
26
    def get_flags_opt(self):
 
27
        return ['-O4']
 
28
    def get_flags_arch(self):
 
29
        return ['-target=native']
 
30
    def get_flags_debug(self):
 
31
        return ['-g','-gline','-g90','-nan','-C']
 
32
 
 
33
if __name__ == '__main__':
 
34
    from distutils import log
 
35
    log.set_verbosity(2)
 
36
    from numpy.distutils.fcompiler import new_fcompiler
 
37
    compiler = new_fcompiler(compiler='nag')
 
38
    compiler.customize()
 
39
    print compiler.get_version()