Project

General

Profile

Bug #2892

Wrong avx-512 support for own fftw build using clang-6

Added by Bernd Doser 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
build system
Target version:
Affected version - extra info:
tested versions 2019.1 and 2018.6
Affected version:
Difficulty:
uncategorized
Close

Description

Building GROMACS 2019.1 with

cmake -DCMAKE_BUILD_TYPE=release -DGMX_BUILD_OWN_FFTW=ON ..
make

using clang-6, I get following error during fftw build:

/work/build/clang/src/external/build-fftw/fftwBuild-prefix/src/fftwBuild/simd-support/simd-avx512.h:48:2: error: "compiling simd-avx512.h without avx-512f support

There is no error doing the same with gcc-7.

Both are using the same optimization flags for FFTW (--enable-sse2;--enable-avx;--enable-avx2;--enable-avx512), whereas used processor is only supporting avx and avx2.

Best regards,
Bernd

Associated revisions

Revision 7e1a8b8e (diff)
Added by Mark Abraham 9 months ago

Prevented FFTW build errors with clang and AVX-512

FFTW hard-codes the inclusion of files that does not work with its
AVX-512 flags when using thee clang compiler, so in this case
GROMACS should compile without AVX-512 support.

Updated release notes, but didn't update the install guide for this
niche case.

Fixes #2892

Change-Id: Ida18fad66e654511937d51ee58f42440de2a321d

History

#1 Updated by Mark Abraham 9 months ago

  • Status changed from New to Feedback wanted
  • Target version set to 2019.2

I presume that error is coming from clang-6 being the compiler used to compile FFTW. I can reproduce that with clang-6 and clang-7 if I use CC and CXX environment variables to influence the compiler chosen by the fftw configure call (which the GROMACS build system does not attempt to control). I deduce that FFTW does not support clang on KNL architectures.

Thus if you want to compile GROMACS with clang and use the build-own-fftw feature, then you should set the compilers to use with GROMACS with CMAKE_C_COMPILER and CMAKE_CXX_COMPILER, and let the FFTW configure find GCC from the environment.

Perhaps we should update our docs accordingly

#2 Updated by Bernd Doser 9 months ago

Dear Mark,

thanks for the verification. I was setting the compiler with

-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++

As my processor is not supporting avx512, I would assume the FFTW optimization flags are wrong. If I fix them in src/external/build-fftw/CMakeLists.txt, everything works fine with clang.

Please see https://github.com/HITS-MCM/gromacs-ramd/commit/52eda180ee9390be43621da10851df60854f63e0

Best regards,
Bernd

#3 Updated by Mark Abraham 9 months ago

Bernd Doser wrote:

Dear Mark,

thanks for the verification. I was setting the compiler with

-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++

Sure, that controls the compiler used for GROMACS. It does not affect the compiler used for building FFTW in the case at hand.

As my processor is not supporting avx512, I would assume the FFTW optimization flags are wrong. If I fix them in src/external/build-fftw/CMakeLists.txt, everything works fine with clang.

Please see https://github.com/HITS-MCM/gromacs-ramd/commit/52eda180ee9390be43621da10851df60854f63e0

OK. Clearly fftw cannot be built by clang with AVX-512 support.

#4 Updated by Gerrit Code Review Bot 9 months ago

Gerrit received a related patchset '1' for Issue #2892.
Uploader: Mark Abraham ()
Change-Id: gromacs~release-2019~Ida18fad66e654511937d51ee58f42440de2a321d
Gerrit URL: https://gerrit.gromacs.org/9331

#5 Updated by Mark Abraham 9 months ago

  • Status changed from Feedback wanted to Resolved

#6 Updated by Paul Bauer 9 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF