Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: numpy/numpy
...
head fork: matthew-brett/numpy
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 11 additions and 25 deletions.
  1. +11 −25 numpy/distutils/fcompiler/gnu.py
View
36 numpy/distutils/fcompiler/gnu.py
@@ -202,8 +202,18 @@ def get_flags_opt(self):
opt.append('-funroll-loops')
return opt
+ def _c_arch_flags(self):
+ """ Return detected arch flags from CFLAGS """
+ from distutils import sysconfig
+ cflags = sysconfig.get_config_vars()['CFLAGS']
+ arch_re = re.compile(r"-arch\s+(\w+)")
+ arch_flags = []
+ for arch in arch_re.findall(cflags):
+ arch_flags += ['-arch', arch]
+ return arch_flags
+
def get_flags_arch(self):
- return []
+ return self._c_arch_flags()
class Gnu95FCompiler(GnuFCompiler):
compiler_type = 'gnu95'
@@ -249,30 +259,6 @@ def version_match(self, version_string):
g2c = 'gfortran'
- def _universal_flags(self, cmd):
- """Return a list of -arch flags for every supported architecture."""
- if not sys.platform == 'darwin':
- return []
- arch_flags = []
- for arch in ["ppc", "i686", "x86_64", "ppc64"]:
- if _can_target(cmd, arch):
- arch_flags.extend(["-arch", arch])
- return arch_flags
-
- def get_flags(self):
- flags = GnuFCompiler.get_flags(self)
- arch_flags = self._universal_flags(self.compiler_f90)
- if arch_flags:
- flags[:0] = arch_flags
- return flags
-
- def get_flags_linker_so(self):
- flags = GnuFCompiler.get_flags_linker_so(self)
- arch_flags = self._universal_flags(self.linker_so)
- if arch_flags:
- flags[:0] = arch_flags
- return flags
-
def get_library_dirs(self):
opt = GnuFCompiler.get_library_dirs(self)
if sys.platform == 'win32':

No commit comments for this range

Something went wrong with that request. Please try again.