From 17e71640f537d48ba4ded47d3d77e50bd3be18c8 Mon Sep 17 00:00:00 2001 From: Pietro Bonfa Date: Sun, 5 Apr 2020 17:19:07 +0200 Subject: [PATCH] Select appropriate openmp implementation for MKL when building with PGI. This depends on the version --- install/m4/x_ac_qe_blas.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install/m4/x_ac_qe_blas.m4 b/install/m4/x_ac_qe_blas.m4 index 8db7d7115..3c48f0ef0 100644 --- a/install/m4/x_ac_qe_blas.m4 +++ b/install/m4/x_ac_qe_blas.m4 @@ -50,8 +50,13 @@ else mkl_omp="mkl_gnu_thread" ;; pgf* ) - mkl_lib="mkl_intel_lp64" - mkl_omp="mkl_intel_thread" + # Detect (again) PGI version + pgf_version=`$mpif90 -V 2>&1 | sed '/^$/d' | grep "^pgf" | cut -d ' ' -f2` + # From version 19.1, the new llvm backend requires linking to mkl_intel_thread + ompimp="" + AS_VERSION_COMPARE([$pgf_version], [19.1], [ ompimp="pgi" ], [ ompimp="intel" ], [ ompimp="intel" ] ) + mkl_lib="mkl_${ompimp}_lp64" + mkl_omp="mkl_${ompimp}_thread" add_mkl_flag="-pgf90libs" ;; esac