MRedies / NPY-for-Fortran

A FORTRAN module to write Numpy's *.npy and *.npz files
MIT License
40 stars 9 forks source link

Support for `--int64` compilations with ifort #9

Closed breengles closed 1 year ago

breengles commented 1 year ago

Hi! First of all, let me thank you for your really nice work :hugs: I naively tried to compile it within my project with --int64 flag and found that ifort (dunno if it happens with gfortran) does not work, for example here:

.../npy.f90(944): error #6633: The type of the actual argument differs from the type of the dummy argument.
      write (p_un) dict_str(var_type, shape(tensor5))
--------------------------------------^

I assume this is due to shape(tensor5) yields now int64 values instead of int32 as expected by dict_str (and a couple of other functions for other variables) so now I am wondering if it can be re-written to be independent of particular kind of int. It seems like we should not care much about a particular integer kind of shape in parsers, e.g., shape_str, aren't we? I would really appreciate it if you can shed some light here so I (or somebody else) can spend some spare time here :)

MRedies commented 1 year ago

Hi,

I don't use fortran anymore and I don't have the spare time to look at it. But if you make PR I can merge it. The stdlib fortran project:

https://github.com/fortran-lang/stdlib

Took over parts of the code a while ago. You can see if their code does the trick.

breengles commented 1 year ago

Oh, got it, def will check that! Thanks for the quick reply!