Skip to content

Fixes for Fortran accessors calling C interfaces that return C strings

Jeffrey Frey requested to merge jtfrey/libpspio:issue-51-changes into develop

The C interface functions were altered to declare a return type of c_ptr rather than a static character(kind=c_char) since the C function returns a pointer to an array of characters, not a static single byte. The Fortran subroutines that call those functions were altered to use the c_to_f_string_ptr() function to copy the C string into a Fortran string.

This set of commits also includes:

  • fixes to the "make check" infrastructure
  • fix to the pspiof_info_string() subroutine to append "-Fortran" to the C package name

Testing

Successful local build testing was done against several compiler suites:

  • gcc/g++/gfortran 4.8.5
    • no C/Fortran compiler flags specified
  • gcc/g++/gfortran 12.2
    • no C/Fortran compiler flags specified
  • icc/icpc/ifort 2020u4
    • no C/Fortran compiler flags specified
  • icx/icpx/ifx 2023.0.0.25537
    • C/Fortran compiler flag "-fp-model=precise" was necessary for "make check" to succeed
      • values outside tolerance for test_mesh_init_points_log1
      • values outside tolerance for test_mesh_init_points_log2

Merge request reports