Fix atomics configure test
commit83525170216a88efaa8c2e7e57640aaab1bd12d4
authorMark Abraham <mark.j.abraham@gmail.com>
Mon, 1 Jun 2020 07:53:45 +0000 (1 07:53 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 1 Jun 2020 07:53:45 +0000 (1 07:53 +0000)
tree45d55619cd88ad8b3e077000a6b8552318f3724a
parent22298866fbc07572e4128f5973dc8c7a8d256f14
Fix atomics configure test

The previous code used an approach to setting the include path for
TEST_ATOMICS test that did not work if the path had a space in it.
This meant that atomics support in GROMACS seemed broken if the build
was from a path in the home folder of a user named like "Firstname
Lastname". This is often the case on Windows.

The new approach avoids this brittleness, adds a few comments and has
the test source code inline in the cmake code. The TMPI_TEST_ATOMICS
macro is replaced by a function so that it has a namespace, since it
now needs to set some variables that benefit from that
namespace. Also, its results were returned in internal cache variables
rather than the namespace that the former macro automatically shared,
so there was no advantage to using a macro rather than a function.

The former TEST_ATOMICS test defined TMPI_ATOMICS before the call,
which was useless and confusing. That is removed.

Removed a useless call to TMPI_TEST_ATOMICS, which had always passed
the name of a variable instead of the value it contained, and was
redundant with a proper call that immediately preceded it in the
calling code.
cmake/TestAtomics.cpp [deleted file]
cmake/ThreadMPI.cmake
docs/release-notes/2021/major/portability.rst