Skip to content

Allow string lengths to be set at compile time#175

Merged
andrewcoughtrie merged 10 commits intoMetOffice:mainfrom
t00sa:longer-name-support
May 15, 2025
Merged

Allow string lengths to be set at compile time#175
andrewcoughtrie merged 10 commits intoMetOffice:mainfrom
t00sa:longer-name-support

Conversation

@t00sa
Copy link
Collaborator

@t00sa t00sa commented Apr 30, 2025

Add a cmake option to allow string length to be changed at compile time from their default value of 100 characters. This is necessary because psyclone inserts timers with longer names.

t00sa added 2 commits April 30, 2025 15:56
Protect the default string buffer size of 100 with a pre-processor
directive and add a build option to allow the size to be changed at
compile time using a cmake directive.
Document the new STRING_LENGTH option in the build instructions and
include details of the value if the option is not set.
@t00sa t00sa linked an issue Apr 30, 2025 that may be closed by this pull request
t00sa added 3 commits May 14, 2025 11:39
This makes various improvements including:

* Changing the STRING_LENGTH option setting to check the value passed
  by the user by applying a sensible minimum.  Issue a warning if the
  value is too small.
* Move the hashtable macros from the source file to the header, making
  them available to other components
* Add a test to check that the framework exits with an error if the
  label is too long
According to clang-format, line 129 in test_hashtable.cpp should not
be wrapped!
@t00sa t00sa requested a review from andrewcoughtrie May 14, 2025 14:49
Copy link
Collaborator

@andrewcoughtrie andrewcoughtrie left a comment

Choose a reason for hiding this comment

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

A few things to look at nothing major though.

Comment on lines 100 to 101
- Maximum length of the identifier string. Default if
unspecified is truncate strings at 100 characters.
Copy link
Collaborator

Choose a reason for hiding this comment

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

More correct to say default is 100 and vernier will error if length is greater than 100

t00sa and others added 4 commits May 15, 2025 08:55
Whitespace clean-up

Co-authored-by: Andrew Coughtrie <24609575+andrewcoughtrie@users.noreply.github.com>
Co-authored-by: Andrew Coughtrie <24609575+andrewcoughtrie@users.noreply.github.com>
Co-authored-by: Andrew Coughtrie <24609575+andrewcoughtrie@users.noreply.github.com>
@t00sa t00sa requested a review from andrewcoughtrie May 15, 2025 08:24
Copy link
Collaborator

@andrewcoughtrie andrewcoughtrie left a comment

Choose a reason for hiding this comment

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

The changes look good but there is a failure in the testing when the string length is set to 256 in my case, so that needs fixing.

Scope must be INFERFACE not PRIVATE otherwise STRING_LENGTH setting
will not be propagated to the test harness.
@t00sa t00sa requested a review from andrewcoughtrie May 15, 2025 12:45
Copy link
Collaborator

@andrewcoughtrie andrewcoughtrie left a comment

Choose a reason for hiding this comment

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

This all looks good to me now.

@andrewcoughtrie andrewcoughtrie merged commit b008cff into MetOffice:main May 15, 2025
10 checks passed
@t00sa t00sa deleted the longer-name-support branch May 20, 2025 12:21
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.

Increase default string length to 256

2 participants