crest-lab / crest

CREST - A program for the automated exploration of low-energy molecular chemical space.
https://crest-lab.github.io/crest-docs/
GNU Lesser General Public License v3.0
190 stars 42 forks source link

Compilation fails with GCC (again) #119

Closed awvwgk closed 2 years ago

awvwgk commented 2 years ago

There is a line truncation error with GFortran for

https://github.com/grimme-lab/crest/blob/37d90ad476224c323210ea0719886853e7b263d2/src/qcg/solvtool.f90#L3161

[129/174] Building Fortran object CMakeFiles/crest-exe.dir/src/qcg/solvtool.f90.o
FAILED: CMakeFiles/crest-exe.dir/src/qcg/solvtool.f90.o 
$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gfortran -I$SRC_DIR/src/qcg -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/crest-2.12 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -O3 -DNDEBUG -O3 -Jinclude -fopenmp -fpreprocessed -c CMakeFiles/crest-exe.dir/src/qcg/solvtool.f90-pp.f90 -o CMakeFiles/crest-exe.dir/src/qcg/solvtool.f90.o
$SRC_DIR/src/qcg/solvtool.f90:3161:132:

 3161 |   if(ios .ne. 0) error stop 'No xtb-IFF found. This is currently required for QCG and available at https:/github.com/grimme-lab/xtbiff/releases/tag/v1.1'
      |                                                                                                                                    1
Error: Line truncated at (1) [-Werror=line-truncation]
$SRC_DIR/src/qcg/solvtool.f90:3161:30:

 3161 |   if(ios .ne. 0) error stop 'No xtb-IFF found. This is currently required for QCG and available at https:/github.com/grimme-lab/xtbiff/releases/tag/v1.1'
      |                              1
Error: Unterminated character constant beginning at (1)
$SRC_DIR/src/qcg/solvtool.f90:1241:32:

 1241 |   call sort_ensemble(ens,ens%er,'full_ensemble.xyz')
      |                                1
Warning: Character length of actual argument shorter than of dummy argument 'fname' (17/30) at (1)
$SRC_DIR/src/qcg/solvtool.f90:89:67:

   89 |     call qcg_ensemble(env,solute,solvent,cluster,full_ensemble,tim,'ensemble')
      |                                                                   1
Warning: Character length of actual argument shorter than of dummy argument 'fname_results' (8/80) at (1)
$SRC_DIR/src/qcg/solvtool.f90:110:72:

  110 |       call qcg_ensemble(env,solute,solvent,cluster,solvent_ensemble,tim,'solvent_ensemble')
      |                                                                        1
Warning: Character length of actual argument shorter than of dummy argument 'fname_results' (16/80) at (1)
f951: some warnings being treated as errors

Fortunately, adding -ffree-line-length-none option will allow compilation without patching the source.

pprcht commented 2 years ago

Thanks. And here I thought we are in the post-"max. line length" age.

120 should take care of it.

awvwgk commented 2 years ago

Unfortunately, the Fortran standard is only slowly moving in this direction, the upcoming standard will set the line length to 10000.