[onert] Fix compilation on Ubuntu 25.10 with GCC 15.2.0#16356
Open
arkq wants to merge 1 commit intoSamsung:masterfrom
Open
[onert] Fix compilation on Ubuntu 25.10 with GCC 15.2.0#16356arkq wants to merge 1 commit intoSamsung:masterfrom
arkq wants to merge 1 commit intoSamsung:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a compilation error on Ubuntu 25.10 with GCC 15.2.0 caused by a namespace collision. The standard library now includes a rsqrt() function, which conflicts with test case namespaces named rsqrt. The fix adds a prefix to all generated test namespaces to avoid such collisions.
Changes:
- Modified test generators to add namespace prefixes:
vts_gen_for VTS tests andcts_gen_for CTS tests - Updated all namespace references in generated test templates to use the prefixed names
- Added Samsung copyright notice to modified shell script
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| runtime/tests/nnapi/specs/generate_vts_test.sh | Updated shell script to generate namespaces with vts_gen_ prefix and reference them correctly |
| runtime/tests/nnapi/nnapi_test_generator/android-10/vts_generator.py | Modified VTS test generator to use vts_gen_ namespace prefix in generated code |
| runtime/tests/nnapi/nnapi_test_generator/android-10/cts_generator.py | Modified CTS test generator to use namespace prefix (contains critical typo: ctc_gen_ instead of cts_gen_) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
runtime/tests/nnapi/nnapi_test_generator/android-10/cts_generator.py
Outdated
Show resolved
Hide resolved
runtime/tests/nnapi/nnapi_test_generator/android-10/cts_generator.py
Outdated
Show resolved
Hide resolved
runtime/tests/nnapi/nnapi_test_generator/android-10/cts_generator.py
Outdated
Show resolved
Hide resolved
Trying to compile generated tests on Ubuntu 25.10 results in a
compilation error due to name clash between test case namespace
and function from the standard library:
> In file included from ../../../../runtime/tests/nnapi/src/generated/all_generated_V1_2_cts_tests.cpp:182:
> ../../../../runtime/tests/nnapi/src/generated/tests/rsqrt.mod.py.cpp:5:11: error: ‘namespace rsqrt { }’ redeclared as different kind of entity
> 5 | namespace rsqrt {
> | ^~~~~
> In file included from /usr/include/features.h:523,
> from /usr/include/x86_64-linux-gnu/c++/15/bits/os_defines.h:39,
> from /usr/include/x86_64-linux-gnu/c++/15/bits/c++config.h:727,
> from /usr/include/c++/15/cstddef:51,
> from ../../../../runtime/externals/GTEST-1.15.2/googletest/include/gtest/gtest.h:52,
> from ../../../../runtime/tests/nnapi/src/generated/tests/../../TestGenerated.h:21,
> from ../../../../runtime/tests/nnapi/src/generated/tests/abs_1D_float_nnfw.mod.py.cpp:3,
> from ../../../../runtime/tests/nnapi/src/generated/all_generated_V1_2_cts_tests.cpp:4:
> /usr/include/x86_64-linux-gnu/bits/mathcalls.h:206:1: note: previous declaration ‘double rsqrt(double)’
ONE-DCO-1.0-Signed-off-by: Arkadiusz Bokowy <a.bokowy@samsung.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trying to compile generated tests on Ubuntu 25.10 results in a compilation error due to name clash between test case namespace and function from the standard library:
ONE-DCO-1.0-Signed-off-by: Arkadiusz Bokowy a.bokowy@samsung.com