Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable doxygen in cmake build #1281

Merged

Conversation

MatthewMasarik-NOAA
Copy link
Collaborator

@MatthewMasarik-NOAA MatthewMasarik-NOAA commented Jul 30, 2024

Pull Request Summary

Enables doxygen documention within the cmake build system.

Description

Doxygen support is added to the build system via:

  • A cache variable (ENABLE_DOCS) is added to the main CMakeLists.txt file, which is currently set to OFF by default.
  • A cmake module is added (EnableDoxygen) which takes an output directory as an argument. Default is set as docs.
  • EnableDoxygen adds a target (enable_docs) to the build system. If doxygen is not found on the system, the target will fail, otherwise doxygen will be run and the output location of index.html is displayed during cmake config.
  • There are only changes to the cmake build files to handle doxygen documentation, so there are no answer changes expected.

Usage

Steps to generate doxygen documentation from the WW3 root directory:

mkdir build && cd build
cmake -DSWITCH=<path-to-switch> -DENABLE_DOCS=ON -S .. -B .
cmake --build . --target enable_docs                         # make enable_docs

View html docs in browser (ex, firefox) for default output location

firefox docs/html/index.html
  • Tested using doxygen v1.8.17.
  • Note that it's not necessary to build the model to generate the doxygen documentation. Specifying the target enable_docs will just run doxygen on the source files. However, the dependencies (i.e, Fortran compiler, NetCDF, etc) still need to be available due to checks within the build system.

Please also include the following information:

  • Add any suggestions for a reviewer:
  • Mention any labels that should be added:
    • documentation, new feature
  • Are answer changes expected from this PR?
    • No.

Issue(s) addressed

Commit Message

Enable doxygen documentation in the cmake build system

Check list

Testing

  • How were these changes tested?
    • By building the doxygen documentation and verifying output in a browser (ubuntu 20.04, doxygen 1.8.17, mozilla firefox 128.0). The current default doxygen documentation homepage:
doxygen_ww3_homepage
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?)
    • No. Documentation is not tested.
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)?
    • N/A.
  • Please indicate the expected changes in the regression test output, (Note the list of known non-identical tests.)
    • N/A.
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):
    • N/A.

@MatthewMasarik-NOAA
Copy link
Collaborator Author

Thanks for your review @edwardhartnett

@AlexanderRichert-NOAA
Copy link
Contributor

You could consider using the 'required' keyword for find_package(Doxygen), or use a fatal error if not found, that way if it's not found it should get caught sooner and more conspicuously. But I've tested building the docs (and tested Doxygen not found) and it looks good.

@MatthewMasarik-NOAA
Copy link
Collaborator Author

You could consider using the 'required' keyword for find_package(Doxygen), or use a fatal error if not found, that way if it's not found it should get caught sooner and more conspicuously. But I've tested building the docs (and tested Doxygen not found) and it looks good.

Thanks @AlexanderRichert-NOAA, that's a great suggestion. I'll update 'find_package' to use the 'required' keyword.

Copy link
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving based on @edwardhartnett and @AlexanderRichert-NOAA review

@MatthewMasarik-NOAA
Copy link
Collaborator Author

Approving based on @edwardhartnett and @AlexanderRichert-NOAA review

Thank you for reviewing @JessicaMeixner-NOAA

@MatthewMasarik-NOAA MatthewMasarik-NOAA merged commit abc77b9 into NOAA-EMC:develop Aug 1, 2024
22 checks passed
ukmo-ccbunney added a commit to ukmo-waves/WW3 that referenced this pull request Sep 4, 2024
* origin/develop:
  Enable doxygen documentation in the cmake build system (NOAA-EMC#1281)
  Simplify MPI ifdefs in subroutine W3MPIO (NOAA-EMC#1266)
  Add depth scaling value to SMC regression tests. (NOAA-EMC#1264)
  Updates to NCEP regtests for Orion Rocky9 OS(NOAA-EMC#1263)
  Fix code stability issue in ww3_outp (NOAA-EMC#1258)
  Fix GNU regtest CI failure (NOAA-EMC#1253)
ukmo-ccbunney added a commit to ukmo-waves/WW3 that referenced this pull request Sep 4, 2024
* origin/develop:
  Enable doxygen documentation in the cmake build system (NOAA-EMC#1281)
  Simplify MPI ifdefs in subroutine W3MPIO (NOAA-EMC#1266)
  Add depth scaling value to SMC regression tests. (NOAA-EMC#1264)
  Updates to NCEP regtests for Orion Rocky9 OS(NOAA-EMC#1263)
  Fix code stability issue in ww3_outp (NOAA-EMC#1258)
  Fix GNU regtest CI failure (NOAA-EMC#1253)
ukmo-ccbunney added a commit to ukmo-waves/WW3 that referenced this pull request Sep 4, 2024
* feature/gpu/w3srce_refactor:
  Enable doxygen documentation in the cmake build system (NOAA-EMC#1281)
  Simplify MPI ifdefs in subroutine W3MPIO (NOAA-EMC#1266)
  Add depth scaling value to SMC regression tests. (NOAA-EMC#1264)
  Updates to NCEP regtests for Orion Rocky9 OS(NOAA-EMC#1263)
  Fix code stability issue in ww3_outp (NOAA-EMC#1258)
  Fix GNU regtest CI failure (NOAA-EMC#1253)
  Add option to use NetCDF output instead of binary for point output (NOAA-EMC#1230)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add doxygen to the build
4 participants