def flag_handler(self, name, flags): arch = "" spec = self.spec target_simds = { ('x86_64', ): ('sse', 'sse2', 'avx', 'avx2', 'avx512', 'avx-128-fma', 'kcvi'), ('ppc', 'ppc64le', 'power7'): ('altivec', 'vsx'), ('arm', ): ('neon', ) } if spec.satisfies("platform=cray"): # FIXME; It is assumed that cray is x86_64. # If you support arm on cray, you need to fix it. arch = "x86_64" for targets, simds in target_simds.items(): if ((arch not in targets) and not any( spec.satisfies('target={0}'.format(t)) for t in targets)): if any(spec.satisfies('simd={0}'.format(x)) for x in simds): raise ConflictsInSpecError(spec, [ (spec, spec.architecture.target, spec.variants['simd'], 'simd={0} are valid only on {1}'.format( ','.join(target_simds[targets]), ','.join(targets))) ]) return (flags, None, None)
def flag_handler(self, name, flags): arch = '' spec = self.spec if spec.satisfies("platform=cray"): # FIXME; It is assumed that cray is x86_64. # If you support arm on cray, you need to fix it. arch = 'x86_64' if (arch != 'x86_64' and not spec.satisfies("target=x86_64")): if spec.satisfies("+sse"): raise ConflictsInSpecError( spec, [(spec, spec.architecture.target, spec.variants['sse'], '+sse is valid only on x86_64')]) if spec.satisfies("+avx"): raise ConflictsInSpecError( spec, [(spec, spec.architecture.target, spec.variants['avx'], '+avx is valid only on x86_64')]) return (flags, None, None)
def flag_handler(self, name, flags): # We cannot catch all conflicts with the conflicts directive because # the user can add arbitrary strings to the flags. Here we can at least # fail early. # We'll include cppflags in case users mistakenly put c++ flags there. spec = self.spec if name in ('cxxflags', 'cppflags') and spec.satisfies('+tests'): if '-stdlib=libc++' in flags: raise ConflictsInSpecError( spec, [(spec, spec.compiler_flags[name], spec.variants['tests'], yaml_cpp_tests_libcxx_error_msg)]) return (flags, None, None)
def flag_handler(self, name, flags): arch = '' spec = self.spec if (spec.satisfies("platform=cray")): # FIXME; It is assumed that cray is x86_64. # If you support arm on cray, you need to fix it. arch = 'x86_64' if (arch != 'x86_64' and not spec.satisfies("target=x86_64")): for s in self.simd_x86: if (spec.satisfies("simd={0}".format(s))): raise ConflictsInSpecError(spec, [ (spec, spec.architecture.target, spec.variants['simd'], 'simd=sse,avx,avx2 and fma are valid' ' only on x86_64') ]) # FIXME: It is assumed that arm 32 bit target is arm. if (arch != 'arm' and not spec.satisfies("target=arm")): if (spec.satisfies("simd=neon")): raise ConflictsInSpecError( spec, [(spec, spec.architecture.target, spec.variants['simd'], 'simd=neon is valid only on arm 32 bit')]) return (flags, None, None)