diff options
author | Bran <bran_avan@hotmail.co.uk> | 2019-03-14 17:28:56 +0000 |
---|---|---|
committer | Bran <bran_avan@hotmail.co.uk> | 2019-03-14 17:28:56 +0000 |
commit | 95342f6df4952bc88c5a02e1f3f8909ced05ae7f (patch) | |
tree | b923383d54e6a570970788657f3b089e16064da2 | |
parent | 5acc591473a4239a994b19eb6e7b256ba557ce21 (diff) | |
download | numpy-95342f6df4952bc88c5a02e1f3f8909ced05ae7f.tar.gz |
AVX detection fails on MacOS if $PATH doesn't contain /usr/sbin #7801
-rw-r--r-- | numpy/_build_utils/src/apple_sgemv_fix.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/numpy/_build_utils/src/apple_sgemv_fix.c b/numpy/_build_utils/src/apple_sgemv_fix.c index 5b27c73f4..aef7ff534 100644 --- a/numpy/_build_utils/src/apple_sgemv_fix.c +++ b/numpy/_build_utils/src/apple_sgemv_fix.c @@ -70,25 +70,25 @@ static int AVX_and_10_9 = 0; * __builtin_cpu_supports("avx") is available in gcc 4.8, * but clang and icc do not currently support it. */ static inline int cpu_supports_avx() { - int enabled, r; - size_t length = sizeof(enabled); - r = sysctlbyname("hw.optional.avx1_0", &enabled, &length, NULL, 0); - if ( r == 0 && enabled != 0) - return 1; - else - return 0; + int enabled, r; + size_t length = sizeof(enabled); + r = sysctlbyname("hw.optional.avx1_0", &enabled, &length, NULL, 0); + if ( r == 0 && enabled != 0) + return 1; + else + return 0; } /* Check if we are using MacOS X version 10.9 */ static inline int using_mavericks() { - int r; - char str[32] = {0}; - size_t size = sizeof(str); - r = sysctlbyname("kern.osproductversion", str, &size, NULL, 0); - if ( r == 0 && strncmp(str, "10.9", strlen("10.9")) == 0) - return 1; - else - return 0; + int r; + char str[32] = {0}; + size_t size = sizeof(str); + r = sysctlbyname("kern.osproductversion", str, &size, NULL, 0); + if ( r == 0 && strncmp(str, "10.9", strlen("10.9")) == 0) + return 1; + else + return 0; } __attribute__((destructor)) |