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

[API] Add getVersion function #2436

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

SeoHyungjun
Copy link
Member

An API has been added to check the version of nntrainer through the project version of meson build.

Available via ml::train::getVersion.

issue : #2435
Signed-off-by: SeoHyungjun [email protected]

@taos-ci
Copy link
Collaborator

taos-ci commented Jan 29, 2024

📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2436. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/.

@taos-ci
Copy link
Collaborator

taos-ci commented Jan 29, 2024

:octocat: cibot: @SeoHyungjun, api/ccapi/include/common.h does not include Doxygen tags such as @file @brief @author @bug. You must include the Doxygen tags in the source code. Please refer to a Doxygen manual at http://github.com/nnstreamer/TAOS-CI/blob/main/ci/doc/doxygen-documentation.md

@taos-ci
Copy link
Collaborator

taos-ci commented Jan 29, 2024

:octocat: cibot: @SeoHyungjun, The last line of a text file must have a newline character. Please append a new line at the end of the line in api/ccapi/meson.build.

@taos-ci
Copy link
Collaborator

taos-ci commented Jan 29, 2024

:octocat: cibot: @SeoHyungjun, The last line of a text file must have a newline character. Please append a new line at the end of the line in api/ccapi/meson.build.

@taos-ci
Copy link
Collaborator

taos-ci commented Jan 29, 2024

:octocat: cibot: @SeoHyungjun, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://ci.nnstreamer.ai/nntrainer/ci/repo-workers/pr-checker/2436-202401291951130.077958106994629-13393324353a1201438a992451899b501201bb12/.

@SeoHyungjun SeoHyungjun force-pushed the add_getVersion_api branch 2 times, most recently from 5a98c25 to 0a3b24f Compare January 29, 2024 10:58
@taos-ci
Copy link
Collaborator

taos-ci commented Jan 29, 2024

:octocat: cibot: @SeoHyungjun, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://ci.nnstreamer.ai/nntrainer/ci/repo-workers/pr-checker/2436-202401291958470.78793692588806-0a3b24fb1a2fab046b76eccd465e92697e57b582/.

Copy link
Member

@DonghakPark DonghakPark left a comment

Choose a reason for hiding this comment

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

LGTM! except android build error

nntrainer_version_split = nntrainer_version.split('.')

add_project_arguments('-DVERSION="' + nntrainer_version + '"', language: ['c', 'cpp'])
add_project_arguments('-DVERSION_MAJOR=' + nntrainer_version_split[0], language: ['c', 'cpp'])
Copy link
Contributor

Choose a reason for hiding this comment

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

NNTRAINER_VERSION_MAJOR or VERSION_MAJOR ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The version information is stored as an argument in meson.build in the root.
However, in api/ccapi/meson.build, we define variables to add to the header.
It appears that the values defined in meson.build in the root cannot be used when creating headers.

project arguments

  • add_project_arguments('-DVERSION_MAJOR=' + nntrainer_version_split[0], language: ['c', 'cpp'])

Definition for creating header

  • version_conf.set('NNTRAINER_VERSION_MAJOR', nntrainer_version_split[0])

Copy link
Contributor

Choose a reason for hiding this comment

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

It appears that the values defined in meson.build in the root cannot be used when creating headers.

But,, project arguments are global var. please check scope

Project arguments
Project arguments work similar to global arguments except that they are valid only within the current subproject. The usage is simple:

add_project_arguments('-DMYPROJ=projname', language : 'c')
This would add the compiler flags to all C sources in the current project.

Copy link
Member Author

Choose a reason for hiding this comment

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

Modified to use only one.

In the case of andoird, separate settings were required, so it was added.

@EunjuYang
Copy link
Contributor

LGTM!

Copy link
Contributor

@lhs8928 lhs8928 left a comment

Choose a reason for hiding this comment

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

LGTM

@SeoHyungjun SeoHyungjun force-pushed the add_getVersion_api branch 2 times, most recently from 58d0f6a to 61bdf1b Compare January 30, 2024 04:39
Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@SeoHyungjun, 💯 All CI checkers are successfully verified. Thanks.

@SeoHyungjun SeoHyungjun force-pushed the add_getVersion_api branch 2 times, most recently from b1c252f to 226d9ab Compare January 31, 2024 03:34
An API has been added to check the version of nntrainer through the
project version of meson build.

Available via ml::train::getVersion.

issue : nnstreamer#2435
Signed-off-by: SeoHyungjun <[email protected]>
Copy link
Collaborator

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

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

@SeoHyungjun, 💯 All CI checkers are successfully verified. Thanks.

Copy link
Contributor

@djeong20 djeong20 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +144 to +150
std::string version = std::to_string(VERSION_MAJOR);
version += ".";
version += std::to_string(VERSION_MINOR);
version += ".";
version += std::to_string(VERSION_MICRO);

return version;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::string version = std::to_string(VERSION_MAJOR);
version += ".";
version += std::to_string(VERSION_MINOR);
version += ".";
version += std::to_string(VERSION_MICRO);
return version;
return std::to_string(VERSION_MAJOR) + "." + std::to_string(VERSION_MINOR) + "." + std::to_string(VERSION_MICRO);

not a big deal, but a suggestion.

Copy link
Member

@skykongkong8 skykongkong8 left a comment

Choose a reason for hiding this comment

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

Good PR!

@jijoongmoon jijoongmoon merged commit 11ed4a0 into nnstreamer:main Feb 2, 2024
32 of 33 checks passed
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.

None yet

9 participants