Skip to content

Fix broken benchmark build - #98

Merged
daniel-otero merged 6 commits into
mainfrom
feature/SmallBenchmarkFixes
Aug 21, 2025
Merged

Fix broken benchmark build#98
daniel-otero merged 6 commits into
mainfrom
feature/SmallBenchmarkFixes

Conversation

@daniel-otero

Copy link
Copy Markdown
Contributor

Trying to run the benchmarks I've found a ninja error that didn't let me compile:

ninja: build stopped: multiple rules generate src/utils.mod.

After fixing it, linking against my system google benchmark version raised this link error:

/usr/bin/ld: PWR043.cpp:(.text.startup+0x2b2): undefined reference to `benchmark::internal::RegisterBenchmarkInternal(benchmark::internal::Benchmark*)'

The rest are minor changes.

It doesn't take that much, and avoid linking problems when the library
was compiled, for example, with a different C++ standard library.
Avoids the ninja problem where multiple checks where creating the same
module in the same folder:

    ninja: build stopped: multiple rules generate src/utils.mod.
@daniel-otero daniel-otero self-assigned this Aug 21, 2025
@daniel-otero
daniel-otero requested review from alvrogd, d-alonso and inaki-amatria and removed request for d-alonso and inaki-amatria August 21, 2025 07:17

@d-alonso d-alonso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

neat!

@alvrogd alvrogd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@daniel-otero
daniel-otero merged commit cd1cb8a into main Aug 21, 2025
1 check passed
@daniel-otero
daniel-otero deleted the feature/SmallBenchmarkFixes branch August 21, 2025 07:50

@inaki-amatria inaki-amatria left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment on lines +50 to +54
# Setup separated dirs to avoid output files clashing between checks
set_target_properties(${CHECKID} PROPERTIES
Fortran_MODULE_DIRECTORY "${CHECKID}"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How come this workflow didn't catch this error earlier?? Is GNU Make silently ignoring the conflict? 😨

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On my computer (without the fix) the Unix Makefiles generation "just works", but all the Fortran modules are in build/src, so I guess they get overwritten in the build.

Nice catch by ninja, I guess.

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.

4 participants