From 9d90d0ec9b0667f538d729080e9a0a4b502a7cba Mon Sep 17 00:00:00 2001 From: Florian Ballenegger Date: Tue, 4 Aug 2020 16:35:24 +0200 Subject: [PATCH] test for libmvec in configure.ac with linking --- configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index b1a4bfe1e..e2d83fc32 100644 --- a/configure.ac +++ b/configure.ac @@ -1232,20 +1232,24 @@ fi # test if we can use libmvec or equivalent if test "x$have_intrinsics" = xyes; then AC_MSG_CHECKING([vector math library]) - AC_TRY_COMPILE([ - #include + AC_LINK_IFELSE( + [ + AC_LANG_PROGRAM( + [[ + #include typedef double Vec4d __attribute__ ((vector_size (4*sizeof(double)), aligned (4*sizeof(double)))); Vec4d _ZGVdN4v_exp(Vec4d x); Vec4d _ZGVdN4v_log(Vec4d x); - ],[ - Vec4d v1,v2; + ]],[[ + Vec4d v1,v2; v1 = (Vec4d) {1.0,2.0,3.141592,4.0}; v2 = _ZGVdN4v_log(v1); v1 = _ZGVdN4v_exp(v2); + ]]) ],[ AC_MSG_RESULT([yes]) have_libmvec=yes - ], [ + ],[ AC_MSG_RESULT([no]) have_libmvec=no ])