Compilation of Exciting Fluorine(/Oxygen) with HDF5

Dear Exciting Developers,

I have been working through the tutorial for the BRIXS code but need help compiling the Exciting main code with HDF5.

Have I understood correctly? Compilation with HDF5 is a requirement to store the excitonic eigenvectors in .h5 format.

To build with HDF5 support, I have checked the preprocessor directive within the code: _HDF5_, and the include and link options for the parallel version of hdf5 I have available:

$ h5pfc -show
>> ftn -I/opt/cray/pe/hdf5-parallel/ -Wl,-rpath -Wl,/opt/cray/pe/hdf5-parallel/

I updated the accordingly with:

MPI_LIBS = -I/opt/cray/pe/hdf5-parallel/ -Wl,-rpath -Wl,/opt/cray/pe/hdf5-parallel/

This leads to an error during compilation


  236 |         &               chi0(1,1,iomstart,iq),(/matsizmax,matsizmax,iomstart:iomend/))
      |                                                                             1
Error: Syntax error in array constructor at (1)

that I have traced back to the following _HDF5_ block in /src/src_gw/task_chi0_r.f90 at the call on line 235:

230 #ifdef _HDF5_
231         write(cik,'(I4.4)') ik
232         path = "/qpoints/"//trim(adjustl(cik))
233         if (.not.hdf5_exist_group(fgwh5,"/qpoints",cik)) &
234         &  call hdf5_create_group(fgwh5,"/qpoints",cik)
235         call hdf5_write(fgwh5,path,"chi0", &
236         &               chi0(1,1,iomstart,iq),(/matsizmax,matsizmax,iomstart:iomend/))
237 #endif

Unfortunately, I cannot determine the error, or whether it can be mitigated with an additional compiler flag. So any help would be greatly appreciated.

As a new user to this forum I cannot upload attatchments, so I have created a GitHub repository with the output from the make command, and my file. I am compiling with GNU compilers version gcc/11.2.0.

Finally, as stated in the title of this topic, I was originally working with Exciting version Oxygen. I have also verified the same problem with compilation of Exciting version Fluorine.

Thank you very much, and best regards

Joshua Elliott

Research Scientist
Diamond Light Source
United Kingdom

Hi Joshua,

It’s nothing to do with compiler flags. When _HDF5_ is true, the block of code you shared is included in the source. And it looks like a bug to me.

This isn’t surprising, we don’t test with HDF5 in our CI and I doubt this has been touched for a few years.

(/matsizmax,matsizmax,iomstart:iomend/) is definitely invalid fortran, but I can’t actually work out what should be there from an initial inspection😅

Can you try commenting out lines 231 - 236 in your example? This is in GW and I doubt the RIXS code will use it. If it does, I’ll have to take a closer look.



Thanks for your fast reply!

I understand, and commenting out this block of code has let me compile, I have also been able to generate the .h5 file required to continue with the RIXS simulation.

So that you are aware of it, I found one other instance in the gw part of the code where the same invalid FORTRAN syntax has been used

src/src_gw/task_epsilon.f90 (Line 157-164):
162 !        call hdf5_write(fgwh5,path,"epsilon", &
163 !        &               epsilon_(1,1,1,iq),(/matsizmax,matsizmax,1:freq%nomeg/))

Best regards


Awesome, glad to hear!

Thanks for the heads-up. There is some development to completely refactor the HDF5 outputting. At which point, I am sure we will catch many problems from the current usage in the GW and BSE modules.