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

More SW infrastructure #9

Merged
merged 26 commits into from
Mar 22, 2023
Merged

Conversation

faisal-bhuiyan
Copy link
Collaborator

@faisal-bhuiyan faisal-bhuiyan commented Feb 8, 2023

Following enhancements to the OpenTurbine SW infrastructure are proposed here:

  • Create API documentation via Doxygen - Use of doxygen specific annotation embedded within C++ source code is pretty common to generate API documentation with minimal effort, e.g. in AMR wind.

  • Adopt a version number for project in CMakeLists.txt - we might consider adopting a version number for OpenTurbine using CMake. We could use the version number along with a log file (discussed below) to quickly check the build version for development as well as for releases.

  • Create a logging utility - a logging utility for recording log messages to files (alongside the console) should be a very useful development tool and the first point of debugging whenever necessary. Various open-source libraries are available for this such as spdlog, however, we could just implement our own basic logging utility with minimal effort.

  • Adopt a C++ Style guide - We are currently using the C++ style guide in the form of a clang-format as recommended in amr-wind. However, having a descriptive style guide helps to know about the thought process behind the choices made. The Google C++ style guide might be a good candidate to this end, of course with a few modifications of our own, e.g., increasing the line length from 80 characters to a more reasonable value such as 120.

Adopting a MAJOR.MINOR.PATCH/REVISION version numbering scheme for the OpenTurbine codebase.
This will enable us to report the build version in log files among other things.
Added Doxyfile and mainpage.txt files to create API documentation for the project.
CMakeLists.txt Outdated Show resolved Hide resolved
@faisal-bhuiyan faisal-bhuiyan changed the base branch from main to develop February 17, 2023 20:25
- The version info was added to CMake output as part of Pull Request Exawind#11, which made adding a separate version # information into the CMakeLists project() redundant.
@faisal-bhuiyan faisal-bhuiyan self-assigned this Feb 17, 2023
- Adopted the Google C++ Style Guide for OpenTurbine project along with several modifications
- Ran the clang-format linter on the repo *.h and *.cpp files
- Build on the google C++ style guide to customize it for OpenTurbine
- Add comments to explain the specific departures from google style
- Log class added to support logging feature to console and/or to file
- Based on a Singleton design
…main CMakeLists file

- Defs of the build type added to customize the compilation e.g. to set log severity level
- Look for build type in the list of supported types
- If none is provided or type does not match then set to RELEASE
- print the build type in a status message
- Move io related code to src/io/
- Move heat_solve related code to src/heat/
- Make necessary changes to CMakeList files to accomodate above
- Change namespace for debug_utils from openturbine::debug -> openturbine::util
- pass argument to print_vector by const &
- Two methods removed from logging capabilities since they were not used
- Changed deleted destructor and move ctors to default
- Modified the doxygen comments in log.h file to add more clarity
- changed namespace to openturbine::util
- source code folder structure
- namespace changes
@faisal-bhuiyan faisal-bhuiyan marked this pull request as ready for review March 3, 2023 22:03
@faisal-bhuiyan
Copy link
Collaborator Author

Updates to the PR:

Create API documentation via Doxygen - Use of doxygen specific annotation embedded within C++ source code is pretty common to generate API documentation with minimal effort, e.g. in AMR wind.

  • Doxygen setup files were for the project as part of this PR. The bulk of the changes made in this PR originate from this.

Adopt a version number for project in CMakeLists.txt - we might consider adopting a version number for OpenTurbine using CMake. We could use the version number along with a log file (discussed below) to quickly check the build version for development as well as for releases.

  • Based on our discussion and subsequent changes implemented in PR#11, this work became redundant.

Create a logging utility - a logging utility for recording log messages to files (alongside the console) should be a very useful development tool and the first point of debugging whenever necessary. Various open-source libraries are available for this such as spdlog, however, we could just implement our own basic logging utility with minimal effort.

  • Implemented a new feature for writing log messages using a Singleton design pattern. Replaced the use of std::cout with the log utility to print log messages to console and a text file. Unit tests were added as well.

Adopt a C++ Style guide - We are currently using the C++ style guide in the form of a clang-format as recommended in amr-wind. However, having a descriptive style guide helps to know about the thought process behind the choices made. The Google C++ style guide might be a good candidate to this end, of course with a few modifications of our own, e.g., increasing the line length from 80 characters to a more reasonable value such as 120.

  • clang-format file was updated accordingly, along with comments to describe the why for each choice made.

In addition to the above, a slight adjustment was made to the folder structure within src which imo, adds more clarity to the project.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
src/heat/heat_solve.cpp Show resolved Hide resolved
src/main.cpp Show resolved Hide resolved
@faisal-bhuiyan faisal-bhuiyan merged commit 4ad6d5d into Exawind:develop Mar 22, 2023
@faisal-bhuiyan faisal-bhuiyan deleted the sw-infra branch March 22, 2023 23:23
@faisal-bhuiyan faisal-bhuiyan added cmake Tasks and issues related to the CMake build system enhancement New feature or request code-quality Tasks such as code formatting improvements, style guideline adherence, refactoring etc. labels Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Tasks and issues related to the CMake build system code-quality Tasks such as code formatting improvements, style guideline adherence, refactoring etc. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants