Re: [AMBER] AmberTools20 fails to compile with gcc10 (with workaround)

From: Charo del Genio <the.paraw.gmail.com>
Date: Sun, 14 Mar 2021 14:41:06 +0000

On 14/03/2021 02:02, David A Case wrote:
> What problems are you seeing with gcc9? We test the development version
> many times a week with gcc9. I'm less sure if there are problems with the
> released version. But it would be good to hear of problems.
> ...thanks...dac

So, I've been playing with it a bit, and my current diagnosis is as follows.

First, to get it to compile with gcc10/gfortran10, I need to pass the following options in cmake:
-DCMAKE_CXX_FLAGS=-fcommon -DCMAKE_C_FLAGS=-fcommon -DCMAKE_Fortran_FLAGS='-fallow-argument-mismatch -fallow-invalid-boz -frecursive'

Also, I needed to modify mt19937.F90, as described in my previous email, and add a line in nab.c, specifically line number 91, reading
        strcat( cppstring, "-fcommon " );

Then the compilation works, but, upon testing, I get problems with PIMD, QM/MM, ADDLES, SANDER.LES and RISM. In all these cases, the problem is a segfault due to invalid memory access (not
surprisingly). In the case or RISM, however, the code sometimes does not crash, but gives wrong results, which is perhaps an even worse occurrence. By the way, this also constitutes an answer to
Florian, who wrote a short while ago.


Now, on top of this, I realized that there are other, potentially serious, problems throughout the code. In countless places, there are potential buffers overruns, references to pointers of the wrong
type, string memory accessed wrongly, and so on. Very alarmingly, in two specific files, some rows are too long and get truncated by the fortran compiler. The two files in question are wlesprm.F, in
rows 24-26, and resp.F at row 1207. However, by chance, the truncation seem to happen in a way that makes some variable names still valid. Please note that this literally means that the code may be
using the wrong variables for the calculations. In my opinion, these are quite serious problems, since they can easily cause wrong results or other issues.


Finally, I'm attaching the three RXSGLD patches as a single file, as requested. The patch can be applied from the root of the AmberTools source directory, as should be clear upon inspection. If I
remember correctly, Xiongwu (CCed on this email) checked them and said they were OK, but I will defer to him for confirmation.



Cheers,

Charo




-- 
Dr. Charo I. del Genio
Senior Lecturer in Statistical Physics
Applied Mathematics Research Centre (AMRC)
Design Hub
Coventry University Technology Park
Coventry CV1 5FB
UK
https://charodelgenio.weebly.com



_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber

Received on Sun Mar 14 2021 - 08:00:03 PDT
Custom Search