lanl / qmd-progress

PROGRESS: Parallel, Rapid O(N) and Graph-based Recursive Electronic Structure Solver.
https://qmd-progress.readthedocs.io/
Other
20 stars 13 forks source link

Does not compile with gcc9 or gcc10 #168

Closed ckoe-bccms closed 2 years ago

ckoe-bccms commented 3 years ago

Hello !

I can compile the library with gcc version 8.3.0.

Using the same commands as with gcc 8.3.0 to to compile qmd-progress gives this error with gcc 9.3.0 and gcc 10.2.0

 [ 69%] Building Fortran object src/CMakeFiles/progress.dir/prg_partition_mod.F90.o /home1/ckoe/src/NEGRE/qmd-progress-1.1.0/src/prg_partition_mod.F90:1293:150:

 1287 |        do i = 1, totalParts
      |                           2                                                                                                                           
......
 1293 |              call prg_get_largest_Hedge_in_part(gp, xadj, adjncy, partNumber, core_count, CH_count, Halo_count, sumCubes, maxCH, smooth_maxCH, pnorm, i, largest_Hedge)
      |                                                                                                                                                      1
Error: Variable ‘i’ at (1) not definable inside loop beginning at (2) as INTENT(INOUT) argument to subroutine ‘prg_get_largest_hedge_in_part’

Of course BML is rebuilt each time for each compiler before trying to compile qmd-progress.

Attached is the build.log. build.log

Best Regards

Christof

nicolasbock commented 3 years ago

Thanks for the report! I will have a look.

payerle commented 2 years ago

I am also seeing this issue (with gcc 9.4.0). Is there any update on this?

I confess my Fortran is rusty and outdated, and I am a sysadmin and not an actual user of the qmd-progress code, but it looks to me like the issue is due to the parameter search_part being needlessly declared as intent(inout) in prg_get_largest_Hedge_in_part (in file src/prg_partition_mod.F9).

Unless I am missing something, search_part is only used in that procedure in the argument of an if statement, and is not modified inside that procedure, so search_part really only needs to be intent(in) (or no intent specified, in which case if I understand correctly will effectively treat as intent(in) in this case).

Can someone who actually understands the code more than I do confirm that this looks reasonable?

cnegre commented 2 years ago

Hi Tom,

Can you send a link to the line where it complains?

Thanks

payerle commented 2 years ago

I did not scan the full build.log from @ckoe-bccms , but the error he copied in text looks identical to what I see (i.e. same error message, also in qmd-progress-1.1.0/src/prg_partition_mod.F90:1293:150, for loop at 1287)

I have successfully compiled qmd-progress with gcc@9.4.0 after applying this patch, but I am not a qmd-progress user nor do I understand what the code is doing, and I have not kept up with Fortran after fortran90 or so.

nicolasbock commented 2 years ago

@ckoe-bccms and @payerle , we are building the library in CI with gcc-10.3.0 and do not run into this issue [1]. But if you compare the error message with the code in the current master you'll notice that your code is different. Could you tell us what version you are compiling?

[1] https://github.com/lanl/qmd-progress/runs/4751452661?check_suite_focus=true#step:5:221

ckoe-bccms commented 2 years ago

Hello,

the version I tried to compile came from a archive named qmd_progress_1.1.0.tar.gz with md5

29264ada871727ab5d98d7b5465678e0  qmd_progress_1.1.0.tar.gz

This is the official release archive available from github. I should have mentioned the version in the original report. As far as I can see at least line 1293 in the current master is different.

This was a dependency for trying to build an O(N) dftb+ version using bml as far as I remember. I am not sure if there was a hard requirement on the 1.1.0 version of qmd-progress somewhere in the dependency chain. Possibly not, however I did not try master at the time because it was not clear to me if master was supposed to work and which state master was in.

Hope this clears up the confusion. Thank you @nicolasbock for looking into this !

nicolasbock commented 2 years ago

Thanks for the information @ckoe-bccms . I have release v1.2.0. Could you try that version and let us know if that addresses this issue? Thanks!

ckoe-bccms commented 2 years ago

Hello,

I first tried to build with gcc 9.3 and gcc 10.2 against bml-2.1.2 which appears to be quite recent. This does not work. This is with gcc/gfortran 9.3, errors with gcc 10.2 they appear to be the same:

[ 45%] Building Fortran object src/CMakeFiles/progress.dir/prg_densitymatrix_mod.F90.o
/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/src/prg_densitymatrix_mod.F90:570:15:

  570 |     bml_type = bml_get_deep_type(ham_bml)
      |               1
Error: Function ‘bml_get_deep_type’ at (1) has no IMPLICIT type
/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/src/prg_densitymatrix_mod.F90:302:15:

  302 |     bml_type = bml_get_deep_type(ham_bml)
      |               1
Error: Function ‘bml_get_deep_type’ at (1) has no IMPLICIT type
/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/src/prg_densitymatrix_mod.F90:221:15:

  221 |     bml_type = bml_get_deep_type(ham_bml)
      |               1
Error: Function ‘bml_get_deep_type’ at (1) has no IMPLICIT type
/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/src/prg_densitymatrix_mod.F90:136:15:

  136 |     bml_type = bml_get_deep_type(ham_bml)
      |               1
Error: Function ‘bml_get_deep_type’ at (1) has no IMPLICIT type
/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/src/prg_densitymatrix_mod.F90:56:15:

   56 |     bml_type = bml_get_deep_type(ham_bml)
      |               1
Error: Function ‘bml_get_deep_type’ at (1) has no IMPLICIT type
make[2]: *** [src/CMakeFiles/progress.dir/prg_densitymatrix_mod.F90.o] Error 1
make[2]: Leaving directory `/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/build'

I believe the build does not even reach to location of the previous error. Or maybe I am doing something completely wrong ? I forgot what I was doing a year ago to be frank.

payerle commented 2 years ago

Sorry, I've been a bit busy. I also was trying to compile version 1.1.0. Again, I am not an user of qmd-progress, just was compiling for my users, so I don't quite understand all of the differences in the loop between 1.1.0 and master. However, it does look like it should fix the original error as the loop variable is no longer being passed directly as the search_part parameter to prg_get_largest_Hedge_in_part, and instead the dummy variable "it" is being passed (at least when prg_get_largest_hedge_in_part is being called).

Although it might behoove you to check the definition of the search_part parameter in prg_get_largest_Hedge_in_part, because unless my Fortran is really off (which is a possibility), it looks like the parameter is only used as input, not in/out.

nicolasbock commented 2 years ago

@ckoe-bccms Could you give me some more details on what you were compiling?

Thanks!

nicolasbock commented 2 years ago

@payerle You are right, and version v1.2.0 we just released should address this particular issue. Could you please retry building the library with the most recent version and report back whether you are running into any issues?

Thanks!

ckoe-bccms commented 2 years ago

build.log Hello.

Excuse the shell session, but I hope it contains everything you need. The build.log is also attached.


login 10:19 ~/src/NEGRE % md5sum bml_2.1.2.tar.gz 
56d5254ed5d1361fb9b3dcdfd849cdc0  bml_2.1.2.tar.gz
login 10:20 ~/src/NEGRE % tar -zxvf bml_2.1.2.tar.gz
...
login 10:21 ~/src/NEGRE % cd bml-2.1.2 
login 10:21 ~/src/NEGRE/bml-2.1.2 % ./build.sh install
Writing output to /home1/ckoe/src/NEGRE/bml-2.1.2/build.log
Running command install
mkdir: created directory ‘/home1/ckoe/src/NEGRE/bml-2.1.2/build’
mkdir: created directory ‘/home1/ckoe/src/NEGRE/bml-2.1.2/install’
-- CMake version 3.20.2
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- The Fortran compiler identification is GNU 10.2.0
...
...
...
-- Installing: /home1/ckoe/src/NEGRE/bml-2.1.2/install/include/bml_types.h
-- Installing: /home1/ckoe/src/NEGRE/bml-2.1.2/install/include/bml_utilities.h
The output was written to /home1/ckoe/src/NEGRE/bml-2.1.2/build.log
login 10:23 ~/src/NEGRE/bml-2.1.2 % cd ../
login 10:24 ~/src/NEGRE % md5sum qmd_progress_1.2.0.tar.gz
edf70d77a83ffc0954eab64603daf7c2  qmd_progress_1.2.0.tar.gz
login 10:24 ~/src/NEGRE % tar -zxvf qmd_progress_1.2.0.tar.gz
...
login 10:24 ~/src/NEGRE % cd qmd-progress-1.2.0 
login 10:25 ~/src/NEGRE/qmd-progress-1.2.0 % CMAKE_PREFIX_PATH=/home1/ckoe/src/NEGRE/bml-2.1.2/install ./build.sh compile
Writing output to /home1/ckoe/src/NEGRE/qmd-progress-1.2.0/build.log
mkdir: created directory ‘/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/build’
mkdir: created directory ‘/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/install’
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- The Fortran compiler identification is GNU 10.2.0
...
...
[ 45%] Building Fortran object src/CMakeFiles/progress.dir/prg_densitymatrix_mod.F90.o
/home1/ckoe/src/NEGRE/qmd-progress-1.2.0/src/prg_densitymatrix_mod.F90:570:15:

  570 |     bml_type = bml_get_deep_type(ham_bml)
      |               1
Error: Function ‘bml_get_deep_type’ at (1) has no IMPLICIT type
....
...
``
[build.log](https://github.com/lanl/qmd-progress/files/7895815/build.log)
`
nicolasbock commented 2 years ago

I can confirm this issue @ckoe-bccms . I have release bml v.2.2.0 which fixes this issue. Could you try this again with v2.2.0?

Thanks!

ckoe-bccms commented 2 years ago

Hello !

I can confirm that I apparently can build qmd-progress 1.2.0 with bml 2.2.0 using gcc 10.2. The build log is attached. Thank you very much !

build.log

nicolasbock commented 2 years ago

Perfect! I'll close this issue then. Please open a new issue in case you run into any issues.