提交 55c889a9 authored 作者: abergeron's avatar abergeron

Merge pull request #4506 from nouiz/cutils

Don't use march flags in cutils to help don't have the architecture m…
......@@ -1799,7 +1799,7 @@ class GCC_compiler(Compiler):
return theano.config.cxx + " " + gcc_version_str
@staticmethod
def compile_args():
def compile_args(march_flags=True):
cxxflags = [flag for flag in config.gcc.cxxflags.split(' ') if flag]
# Add the equivalent of -march=native flag. We can't use
......@@ -1810,7 +1810,7 @@ class GCC_compiler(Compiler):
# Those URL discuss how to find witch flags are used by -march=native.
# http://en.gentoo-wiki.com/wiki/Safe_Cflags#-march.3Dnative
# http://en.gentoo-wiki.com/wiki/Hardware_CFLAGS
detect_march = GCC_compiler.march_flags is None
detect_march = GCC_compiler.march_flags is None and march_flags
if detect_march:
for f in cxxflags:
# If the user give an -march=X parameter, don't add one ourself
......@@ -2009,7 +2009,7 @@ class GCC_compiler(Compiler):
GCC_compiler.march_flags)
# Add the detected -march=native equivalent flags
if GCC_compiler.march_flags:
if march_flags and GCC_compiler.march_flags:
cxxflags.extend(GCC_compiler.march_flags)
# NumPy 1.7 Deprecate the old API. I updated most of the places
......
......@@ -280,7 +280,7 @@ def compile_cutils():
assert e.errno == errno.EEXIST
assert os.path.exists(loc), loc
args = cmodule.GCC_compiler.compile_args()
args = cmodule.GCC_compiler.compile_args(march_flags=False)
cmodule.GCC_compiler.compile_str('cutils_ext', code, location=loc,
preargs=args)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论