Compilation error in GRIMACES 2020.3 : error: no member named 'qsort' in namespace 'std'

GROMACS version: 2020.3
GROMACS modification: No
Here post your question

Hi All,
Was doing the “quick and dirty installation” on my mac and all was going well until…

[ 79%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/mdlib/shake.cpp.o
/Users/gazz/gromacs-2020.3/src/gromacs/mdlib/shake.cpp:237:10: error: no member named ‘qsort’ in namespace ‘std’
std::qsort(sb, ncons, sizeof(*sb), pcomp);
~~~~~^
1 error generated.

…then the make aborted.
sad face.

Has anyone had a similar issue?? Is there a fix??
This looks deep in the code. shake.cpp. I actually found the line. But I do not dare twiddle…

thanks for any help or suggestions!
Gary

Hello!

What C and C++ compilers are you using? It seems to me like they (or rather, the C++ standard library) may not be up to date, but I am no expert.

If the compilers are old, you could try updating to e.g. gcc-10. On mac, they can be easily installed using Homebrew (brew.sh).

Then run cmake with

$ cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10

and the other options from the guide.

Regards,
Petter

This seems to be a bug, I filed a bug report here

where you can follow the progress on fixing this.

I remember this already from the past, but I thought we fixed this ages
ago …

Will get fixed then for 2020.5 I think.

Cheers

Paul

Can you please try to add #include <cstdlib> to src/gromacs/mdlib/shake.cpp and check whether this fixes it?