MCPcopy Create free account
hub / github.com/numpy/numpy / check_gcc_version_at_least

Function check_gcc_version_at_least

numpy/distutils/command/autodist.py:66–87  ·  view source on GitHub ↗

Check that the gcc version is at least the specified version.

(cmd, major, minor=0, patchlevel=0)

Source from the content-addressed store, hash-verified

64
65
66def check_gcc_version_at_least(cmd, major, minor=0, patchlevel=0):
67 """
68 Check that the gcc version is at least the specified version."""
69
70 cmd._check_compiler()
71 version = '.'.join([str(major), str(minor), str(patchlevel)])
72 body = textwrap.dedent("""
73 int
74 main()
75 {
76 #if (! defined __GNUC__) || (__GNUC__ < %(major)d) || \\
77 (__GNUC_MINOR__ < %(minor)d) || \\
78 (__GNUC_PATCHLEVEL__ < %(patchlevel)d)
79 #error gcc >= %(version)s required
80 #endif
81 return 0;
82 }
83 """)
84 kw = {'version': version, 'major': major, 'minor': minor,
85 'patchlevel': patchlevel}
86
87 return cmd.try_compile(body % kw, None, None)
88
89
90def check_gcc_function_attribute(cmd, attribute, name):

Callers 1

Calls 2

_check_compilerMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected