Unknown OpenMP flags for clang
Hey guys
I am trying to build libFLAME on our AMD Naples machines using the AOCC v.2.2.0 compilers (clang, clang++, flang). We run CentOS 7.8 on our compute nodes.
Here is the configure options that I pass:
# CFLAGS are set identical to OpenBLAS
cflags='-O3 -march=native -fopenmp=libiomp5 -mavx2 -fvectorize -mfma -m3dnow -floop-unswitch-aggressive'
fflags='-O3 -march=native -fopenmp=libiomp5 -mavx -frecursive'
./configure --prefix=$dir_install \
--enable-max-arg-list-hack \
--enable-static-build \
--enable-dynamic-build \
--enable-lapack2flame \
--disable-external-lapack-for-subproblems \
--disable-external-lapack-interfaces \
--enable-multithreading=openmp \
--enable-supermatrix \
--enable-vector-intrinsics=sse \
--enable-cblas-interfaces \
--with-cc=clang \
EXTRA_CFLAGS="$cflags" \
F77=flang \
FFLAGS="$fflags"
However, I get the following complaint over OpenMP flags:
checking user-requested multithreading model... openmp
checking for (guessing) OpenMP flags for clang... unknown
configure: error: configure doesn't know what flag to give clang in order to enable OpenMP support. Please submit a bug report to the FLAME developers.
I have played with the cflags and fflags variables above, e.g. with/without -fopenmp, or -fopenmp=libomp or -fopenmp=libiomp5; however, all have failed. Seems like the configure is not listening to the EXTRA_CLFAGS argument passed to it.
Do you have any idea how to fix this?
Regards Ehsan
A gentle reminder about this issue.
Clang does not support openmp. Use pthreads instead.
Hi,
You can try adding following line in the 'configure' file to include -fopenmp option for clang clang) fla_c_openmp_flags='-fopenmp' ;;
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for (guessing) OpenMP flags for ${CC_VENDOR}" >&5 $as_echo_n "checking for (guessing) OpenMP flags for ${CC_VENDOR}... " >&6; }
case ${CC_VENDOR} in
icc)
fla_c_openmp_flags='-qopenmp'
;;
gcc)
fla_c_openmp_flags='-fopenmp'
;;
clang)
fla_c_openmp_flags='-fopenmp'
;;
pathcc)
fla_c_openmp_flags='-mp'
;;
pgcc)
fla_c_openmp_flags='-mp'
;;
sxcc)
fla_c_openmp_flags='-P openmp'
;;
*xlc*)
fla_c_openmp_flags='-qsmp=omp'
;;
*)
fla_c_openmp_flags='unknown'
;;
esac