Bug #3380
IBM VSX checks fail with gcc-10
Description
This is part of https://bugzilla.redhat.com/show_bug.cgi?id=1799473
-- Flag was accepted, but it did not build test source (this could be due to either the compiler or binutils) -- Performing Test CXX_maltivec_mabi_altivec_FLAG_ACCEPTED -- Performing Test CXX_maltivec_mabi_altivec_FLAG_ACCEPTED - Success -- Performing Test CXX_maltivec_mabi_altivec_COMPILE_WORKS -- Performing Test CXX_maltivec_mabi_altivec_COMPILE_WORKS - Failed -- Flag was accepted, but it did not build test source (this could be due to either the compiler or binutils) -- Performing Test CXX_qarch_auto_qaltivec_FLAG_ACCEPTED -- Performing Test CXX_qarch_auto_qaltivec_FLAG_ACCEPTED - Failed -- Performing Test CXX_COMPILE_WORKS_WITHOUT_SPECIAL_FLAGS -- Performing Test CXX_COMPILE_WORKS_WITHOUT_SPECIAL_FLAGS - Failed -- Could not find any flag to build test source (this could be due to either the compiler or binutils) CMake Error at cmake/gmxManageSimd.cmake:51 (message): Cannot find IBM VSX compiler flag. Use a newer compiler, or disable SIMD support (slower). Call Stack (most recent call first): cmake/gmxManageSimd.cmake:265 (gmx_give_fatal_error_when_simd_support_not_found) CMakeLists.txt:719 (gmx_manage_simd) -- Configuring incomplete, errors occurred!
looking at CMakeOutput.log (attached):
Run Build Command(s):/usr/bin/gmake cmTC_90725/fast && /usr/bin/gmake -f CMakeFiles/cmTC_90725.dir/build.make CMakeFiles/cmTC_90725.dir/build gmake[1]: Entering directory '/builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_90725.dir/src.cxx.o /usr/bin/c++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -std=c++11 -DCXX_qarch_auto_qaltivec_FLAG_ACCEPTED -mcpu=power8 -mpower8-vector -qarch=auto -qaltivec -o CMakeFiles/cmTC_90725.dir/src.cxx.o -c /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx c++: error: unrecognized command-line option '-qarch=auto' c++: error: unrecognized command-line option '-qaltivec'; did you mean '-maltivec'? gmake[1]: *** [CMakeFiles/cmTC_90725.dir/build.make:66: CMakeFiles/cmTC_90725.dir/src.cxx.o] Error 1 gmake[1]: Leaving directory '/builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp' gmake: *** [Makefile:121: cmTC_90725/fast] Error 2 Source file was: int main() { return 0;} Performing C++ SOURCE FILE Test CXX_COMPILE_WORKS_WITHOUT_SPECIAL_FLAGS failed with the following output: Change Dir: /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/gmake cmTC_5ed9c/fast && /usr/bin/gmake -f CMakeFiles/cmTC_5ed9c.dir/build.make CMakeFiles/cmTC_5ed9c.dir/build gmake[1]: Entering directory '/builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_5ed9c.dir/src.cxx.o /usr/bin/c++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -std=c++11 -DCXX_COMPILE_WORKS_WITHOUT_SPECIAL_FLAGS -mcpu=power8 -mpower8-vector -o CMakeFiles/cmTC_5ed9c.dir/src.cxx.o -c /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx: In function 'int main()': /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx:2:21: error: 'vector' was not declared in this scope; did you mean 'vec_or'? 2 | int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);} | ^~~~~~ | vec_or /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx:2:55: error: 'x' was not declared in this scope 2 | int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);} | ^ /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx:2:66: error: 'y' was not declared in this scope 2 | int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);} | ^ In file included from /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx:1: /builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp/src.cxx:2:80: error: invalid parameter combination for AltiVec intrinsic '__builtin_vec_vcmpge_p' 2 | int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);} | ^~~~~~~~~~ gmake[1]: *** [CMakeFiles/cmTC_5ed9c.dir/build.make:66: CMakeFiles/cmTC_5ed9c.dir/src.cxx.o] Error 1 gmake[1]: Leaving directory '/builddir/build/BUILD/gromacs-2019.5/serial/CMakeFiles/CMakeTmp' gmake: *** [Makefile:121: cmTC_5ed9c/fast] Error 2 Source file was: #include<altivec.h> int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);}
WIth gcc-9 this check still works.
Associated revisions
Allow gcc-9 on Power 9
Previous restriction ended up blacklisting gcc 9 and later whereas the
intent was to only do so for version 10 and later. Worked around the
version comparison quirk (and lack of >= operator).
Refs #3380
Change-Id: If9f45fe77459c3d873eab3856126f1653efe8cdb
History
#1 Updated by Christoph Junghans 11 months ago
Ok, if I have a code like:
#include<altivec.h> int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);}
Wtih gcc-9 will "g++ -std=c++11 code.c" will compile while it fails with gcc-10. Without "-std=c++11" gcc-10 will compile as well.
#2 Updated by Christoph Junghans 11 months ago
Report to gcc here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93750
Using "-std=gnu++11" instead of "-std=c++11" helps.
#3 Updated by Christoph Junghans 11 months ago
- File build_ppc64le.log.txt build_ppc64le.log.txt added
Adding
diff --git a/cmake/gmxSimdFlags.cmake b/cmake/gmxSimdFlags.cmake index 83b3e97ffb..f739628557 100644 --- a/cmake/gmxSimdFlags.cmake +++ b/cmake/gmxSimdFlags.cmake @@ -398,7 +398,7 @@ function(gmx_find_simd_ibm_vsx_flags C_FLAGS_RESULT CXX_FLAGS_RESULT C_FLAGS_VAR int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);}" TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS SIMD_IBM_VSX_C_FLAGS SIMD_IBM_VSX_CXX_FLAGS - "-mvsx" "-maltivec -mabi=altivec" "-qarch=auto -qaltivec") + "-mvsx" "-maltivec -mabi=altivec" "-qarch=auto -qaltivec" "-maltivec -std=gnu++11") if(${SIMD_IBM_VSX_C_FLAGS_RESULT}) set(${C_FLAGS_VARIABLE} "${TOOLCHAIN_C_FLAGS} ${SIMD_IBM_VSX_C_FLAGS}" CACHE INTERNAL "C flags required for IBM VSX instructions")
helps with the CMake check, but then it fails down the road with:
[ 40%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/awh/biasstate.cpp.o cd /builddir/build/BUILD/gromacs-2019.5/serial/src/gromacs && /usr/bin/c++ -DGMX_DOUBLE=0 -DHAVE_CONFIG_H -DUSE_STD_INTTYPES_H -Dlibgromacs_EXPORTS -I/builddir/build/BUILD/gromacs-2019.5/serial/src -I/builddir/build/BUILD/gromacs-2019.5/src -isystem /builddir/build/BUILD/gromacs-2019.5/src/external/thread_mpi/include -mcpu=power9 -mtune=power9 -maltivec -std=gnu++11 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -std=c++11 -DNDEBUG -funroll-all-loops -fexcess-precision=fast -fPIC -fopenmp -o CMakeFiles/libgromacs.dir/awh/biasstate.cpp.o -c /builddir/build/BUILD/gromacs-2019.5/src/gromacs/awh/biasstate.cpp In file included from /builddir/build/BUILD/gromacs-2019.5/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx.h:51, from /builddir/build/BUILD/gromacs-2019.5/src/gromacs/simd/simd.h:147, from /builddir/build/BUILD/gromacs-2019.5/src/gromacs/awh/biasstate.cpp:64: /builddir/build/BUILD/gromacs-2019.5/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_double.h: In member function 'double gmx::BiasState::updateProbabilityWeightsAndConvolvedBias(const std::vector<gmx::DimParams>&, const gmx::Grid&, std::vector<double, gmx::Allocator<double, gmx::AlignedAllocationPolicy> >*) const': /builddir/build/BUILD/gromacs-2019.5/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_double.h:414:5: error: impossible constraint in 'asm' 414 | __asm__ ("xvrdpi %x0,%x1" : "=wd" (res) : "wd" (x.simdInternal_)); | ^~~~~~~ /builddir/build/BUILD/gromacs-2019.5/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_double.h:742:5: error: impossible constraint in 'asm' 742 | __asm__ ("xvcvdpsxws %x0,%x1" : "=wa" (ix) : "wd" (a.simdInternal_)); | ^~~~~~~ /builddir/build/BUILD/gromacs-2019.5/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_double.h:414:5: error: impossible constraint in 'asm' 414 | __asm__ ("xvrdpi %x0,%x1" : "=wd" (res) : "wd" (x.simdInternal_)); | ^~~~~~~ make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:2231: src/gromacs/CMakeFiles/libgromacs.dir/awh/biasstate.cpp.o] Error 1
#4 Updated by Christoph Junghans 11 months ago
- Target version set to 2019.6
#5 Updated by Erik Lindahl 11 months ago
- Assignee changed from Paul Bauer to Erik Lindahl
- Priority changed from Normal to Low
IBM: If you read this, when you have <1% of the market it is NOT a good idea to keep changing your ABI, change the recommended way of using SIMD, change the flags to support the SIMD instructions, and then change the way we can access the instructions you didn't yet add as intrinsics - combined with not bothering to write much documentation for it.
There might in fact be some correlation between that and the fact that virtually nobody but us has bothered supporting VSX ;-)
#6 Updated by Erik Lindahl 11 months ago
Christoph: We actually have a power9 node now since we wanted to be able to debug, so I'll see if we can fix it (no thanks to IBM, which suddenly pulled the loaner node in Stockholm 1.5 years ago ;-)
#7 Updated by Paul Bauer 11 months ago
- Target version changed from 2019.6 to 2020.2
not high priority, so more likely to be fixed in 2020 branch
sorry IBM :)
#8 Updated by Christoph Junghans 11 months ago
I just disabled VSX in fedora for the time being.
#9 Updated by Paul Bauer 9 months ago
- Status changed from New to Resolved
Applied in changeset 60a138c51ab4bcec063cb78dea55fafceca07e9a.
Disallow combination of gcc > 9 and IBM_VSX
The compiler flag is not detected for newer versions of gcc and can lead
to confusing error messages.
Fixes #3380
Change-Id: I0c5311325b2bf2bc08ab727eabd670115720b4a6