ONE_STEP_PP fails with HDF5

Issue #115 new
Ryusuke Numata created an issue

HDF5 does not recognize a .fpp file as a Fortran source, so ignores it silently. When ONE_STEP_PP=on and USE_HDF5=on, compilation fails.

One possible solution is to change the extension to .F90. But, it causes problem on systems where case-insensitive file system is used.

Comments (3)

  1. Peter Hill

    Urgh, yes I see it has an explicit check for certain file extensions:

            if [ "$ext" = ".f" -o "$ext" = ".F" -o \
                     "$ext" = ".for" -o "$ext" = ".FOR" -o \
                     "$ext" = ".ftn" -o "$ext" = ".FTN" -o \
                     "$ext" = ".f90" -o "$ext" = ".F90" -o \
                     "$ext" = ".f95" -o "$ext" = ".F95" -o \
                     "$ext" = ".f03" -o "$ext" = ".F03" -o \
                     "$ext" = ".f08" -o "$ext" = ".F08" ] ; then
    

    This is pretty gross because different compilers accept different file extensions.

    Unfortunately Fortran compiler vendors seem to have conspired to make this more difficult than it needs to be. As far as I can tell, there is no file extension that will enable preprocessing across all compilers and all file systems. Luckily, there are flags to enable preprocessing for all compilers.

    One way to proceed might be to rename all the .fpp files to .F90 and then add the preprocessing flags in the makefiles for case-insensitive file systems. I don’t think we support building on Windows, so this is likely only Mac OS

  2. Peter Hill

    Cray compilers also have an allowed list of extensions, and therefore do not support ONE_STEP_PP.

    My preferred solution is to rename all .fpp files to .F90.

  3. Log in to comment