ROCm / hipfort

Fortran interfaces for ROCm libraries
https://rocm.docs.amd.com/projects/hipfort/en/latest/
Other
68 stars 37 forks source link

Source of github pages documentation #100

Closed Maetveis closed 1 year ago

Maetveis commented 1 year ago

Hi,

I'm working on #99 as part of the ROCm documentation team / effort.

I have stumbled upon the github pages based documentation for hipfort at https://rocmsoftwareplatform.github.io/hipfort/ . As far as I can see the source of this build (i.e. the Doxyfile) is not published.

Is this available somewhere or would you be able to share it? I would like to consult it as I'm missing the documentation of some of the modules compared to it in #99 (e.g. compare https://rocmsoftwareplatform.github.io/hipfort/namespaces.html with https://advanced-micro-devices-demo--99.com.readthedocs.build/projects/hipfort/en/99/doxygen/html/namespaces.html e.g. hipfort is missing).

domcharrier commented 1 year ago

Hi @Maetveis ,

The documentation page is hosted via github pages. The dedicated branch is tagged according to the ROCm release the interfaces have been based on.

The doxygen file for the most recent documentation can be found here: https://github.com/ROCmSoftwarePlatform/hipfort/blob/repo-docs-build-5.0.0/docs/Doxyfile

Maetveis commented 1 year ago

Thanks, building from there I get the same output as what's hosted on github pages. Thanks for the help, I will see what's the difference between #99.

If I saw correctly from the commits you worked on this yourself too, in case may I ask some questions?

I see an explicit preprocessing (with gfortran) of the fortran files, but doxygen can also run the preprocessor during its build, what is the reason for this explicit step? (I'm not super familiar with fortran, and how well doxygen supports it, so I'm not sure, but this could be the reason why the modules don't show for me?)

domcharrier commented 1 year ago

I see an explicit preprocessing (with gfortran) of the fortran files, but doxygen can also run the preprocessor during its build, what is the reason for this explicit step? (I'm not super familiar with fortran, and how well doxygen supports it, so I'm not sure, but this could be the reason why the modules don't show for me?)

The Doxyfile uses doxygen's

PREDEFINED = USE_FPOINTER_INTERFACES USE_CUDA_NAMES

preprocessor option (https://github.com/ROCmSoftwarePlatform/hipfort/blob/repo-docs-build-5.0.0/docs/Doxyfile#L24) Is this what you mean?

I assume this triggers the gfortran call.

Any other tools involved aside from doxygen on your side?

Maetveis commented 1 year ago

preprocessor option (https://github.com/ROCmSoftwarePlatform/hipfort/blob/repo-docs-build-5.0.0/docs/Doxyfile#L24) Is this what you mean?

No I'm referring to this bash script called from the Makefile: https://github.com/ROCmSoftwarePlatform/hipfort/blob/1722b907995cccc5a330993c8e8d229930e916f2/docs/clean-module-files.sh#L2-L3

Do you know why this step was required before running doxygen?

domcharrier commented 1 year ago

Ah, I see. I don't remember exactly why I did that but:

It could be because the Fortran sources use C preprocessor directives (macros starting with # are not part of the Fortran standard). To use that feature with gfortran, you need to specify the -cpp switch.

It appears I wasn't able to find a way to get doxygen to enable this non-standard feature of gfortran.

Note further that there is a difference in the predefined macros. In the clean-module-files.sh, we have

-DUSE_FPOINTER_INTERFACES -UUSE_CUDA_NAMES

which is correct IMO.

Maetveis commented 1 year ago

In the end I added the same pre-processing as you had, just driven from python (in f7335fc4e7635a9a64bbe36fe128aa2f0ac868db). Thank you very much for the help I'll close this issue.