grimme-lab / xtb

Semiempirical Extended Tight-Binding Program Package
https://xtb-docs.readthedocs.io/
GNU Lesser General Public License v3.0
582 stars 144 forks source link

Crash on build against gcc/gfortran #226

Closed schneiderfelipe closed 4 years ago

schneiderfelipe commented 4 years ago

Describe the bug A particular xtb build won't read any geometry input.

To Reproduce From the current master version (40a182bea8dedbadd090d5eec427e27eab34dd1e), I compiled as follows:

$ export FC=gfortran-8 CC=gcc-8
$ meson configure build --prefix /opt/xtb
$ meson setup build --buildtype release --optimization 2 -Dla_backend=openblas
$ ninja -C build test install

All tests pass:

Ok:                 78  
Expected Fail:      3   
Fail:               0   
Unexpected Pass:    0   
Skipped:            3   
Timeout:            0   

But when doing a simple optimization, an error is thrown:

$ cat h2.xyz
2

H   0.00000000000000      0.00000000000000      0.00000000000000
H   1.00000000000000      0.00000000000000      0.00000000000000
$ xtb h2.xyz --opt
      -----------------------------------------------------------      
     |                   =====================                   |     
     |                           x T B                           |     
     |                   =====================                   |     
     |                         S. Grimme                         |     
     |          Mulliken Center for Theoretical Chemistry        |     
     |                    University of Bonn                     |     
      -----------------------------------------------------------      

   * xtb version 6.3.0 (40a182b) compiled by 'schneider@apollo14' on 2020-05-22

   xtb is free software: you can redistribute it and/or modify it under
   the terms of the GNU Lesser General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   xtb is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU Lesser General Public License for more details.

   Cite this work as:
   * S. Grimme, C. Bannwarth, P. Shushkov, J. Chem. Theory Comput., 2017,
     13, 1989-2009. DOI: 10.1021/acs.jctc.7b00118
   * C. Bannwarth, S. Ehlert and S. Grimme., J. Chem. Theory Comput., 2019,
     15, 1652-1671. DOI: 10.1021/acs.jctc.8b01176
   * P. Pracht, E. Caldeweyher, S. Ehlert, S. Grimme, ChemRxiv, 2019, preprint.
     DOI: 10.26434/chemrxiv.8326202.v1

   for GFN-FF:
   * S. Spicher and S. Grimme, Angew. Chem. Int. Ed., 2020,
     DOI: 10.1002/anie.202004239

   for DFT-D4:
   * E. Caldeweyher, C. Bannwarth and S. Grimme, J. Chem. Phys., 2017,
     147, 034112. DOI: 10.1063/1.4993215
   * E. Caldeweyher, S. Ehlert, A. Hansen, H. Neugebauer, S. Spicher,
     C. Bannwarth and S. Grimme, J. Chem. Phys., 2019, 150, 154122.
     DOI: 10.1063/1.5090222

   for sTDA-xTB:
   * S. Grimme and C. Bannwarth, J. Chem. Phys., 2016, 145, 054103.
     DOI: 10.1063/1.4959605

   in the mass-spec context:
   * V. Asgeirsson, C. Bauer and S. Grimme, Chem. Sci., 2017, 8, 4879.
     DOI: 10.1039/c7sc00601b
   * J. Koopman and S. Grimme, ACS Omega 2019, 4, 12, 15120-15133.
     DOI: 10.1021/acsomega.9b02011

   for metadynamics refer to:
   * S. Grimme, J. Chem. Theory Comput., 2019, 155, 2847-2862
     DOI: 10.1021/acs.jctc.9b00143

   with help from (in alphabetical order)
   C. Bannwarth, F. Bohle, G. Brandenburg, E. Caldeweyher, M. Checinski,
   S. Dohm, S. Ehlert, S. Ehrlich, F. März, H. Neugebauer, J. Pisarek,
   P. Pracht, P. Shushkov, and S. Spicher.

 * started run on 2020/05/22 at 16:58:45.708     
########################################################################
[ERROR] Program stopped due to fatal error
-2- reading geometry input 'h2.xyz' failed
-1- io_reader_readMolecule: Could not read number of atoms, check format!
########################################################################
abnormal termination of xtb
ERROR STOP 

Error termination. Backtrace:
#0  0x151997e4438d in ???
#1  0x151997e44f25 in ???
#2  0x151997e45ffa in ???
#3  0x561ff2e977e4 in ???
#4  0x561ff2e384e6 in ???
#5  0x561ff2e30c3c in ???
#6  0x151997272b96 in ???
#7  0x561ff2e30c99 in ???
#8  0xffffffffffffffff in ???

(Single point energies, e.g., $ xtb h2.xyz, throw the same error.)

Additional context

Some versions:

$ gfortran-8 --version
GNU Fortran (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc-8 --version
gcc-8 (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ apt list libopenblas-base libopenblas-dev 
Listing... Pronto
libopenblas-base/bionic,now 0.2.20+ds-4 amd64 [installed,automatic]
libopenblas-dev/bionic,now 0.2.20+ds-4 amd64 [installed]

$ meson --version
0.54.2

$ ninja --version
1.8.2
awvwgk commented 4 years ago

This is surprising, because I'm running the CI at Travis at the very same OS and the very same compiler.

schneiderfelipe commented 4 years ago

@awvwgk Interesting. I am probably doing something wrong, do you have any clue what is it?

By the way, I just tested removing -Dla_backend=openblas (effectively compiling with MKL). Same error.

awvwgk commented 4 years ago

I could just reproduce it locally with GCC 8.4.0, something odd about this, but I will hopefully have a fix in a moment.

awvwgk commented 4 years ago

And thanks for reporting, this one slipped through the CI.