-
Notifications
You must be signed in to change notification settings - Fork 1.7k
pfm: Use a more standard CMake approach for finding libpfm #1628
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
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
fantastic! i wonder if this is why the CI bots fail the pfm tests... cc @macandy13 |
|
CI failures are unrelated |
|
thanks! |
| set_package_properties(PFM PROPERTIES | ||
| URL http://perfmon2.sourceforge.net/ | ||
| DESCRIPTION "a helper library to develop monitoring tools" | ||
| PURPOSE "Used to program specific performance monitoring events") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should remain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added back with a followup commit
| Eric Fiselier <[email protected]> | ||
| Eugene Zhuk <[email protected]> | ||
| Evgeny Safronov <[email protected]> | ||
| Fabien Pichot <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know almost-sorted files is not fun to deal with,
but would it please be possible to not re-sort it here,
but just add new entries to the right-ish place?
| if (PFM_FOUND AND NOT TARGET PFM::libpfm) | ||
| add_library(PFM::libpfm UNKNOWN IMPORTED) | ||
| set_target_properties(PFM::libpfm PROPERTIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a convention on the names of imported targets?
If not, i think PFM::PFM might be better-ish?
LebedevRI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please, this is nice.
Hm, I don't see test failures related to pfm. I also think the pfm tests are never actually run on the CI machines, because they do not support performance counters at all (which is what I tried in one of the recent prs but sadly had to remove from the pr again). Am I missing something? |
|
i was suggesting that the current version of this code that doesn't do a great job of finding pfm might be the reason why the CI machines can't run the tests. maybe with this change they can? |
|
When I tried the tests, the problem was not that libpfm wasn't found (I was using bazel for doing this), it was that the underlying VM does not report any performance counters at all. The pfm tests actually expect that the system at least reports a few standard ones. Do you have a link to the error you were seeing? |
|
i didn't check any errors, i was just being optimistic. |
|
Ok. For the record, this is the failure I was seeing when trying to enable pfm CI tests: https://github.com/google/benchmark/actions/runs/5484545652/jobs/9992228532#step:5:2830 |
This PR is trying to address #1627
I reworked
FindPFM.cmaketo usefind_libraryandfind_pathinstead ofcheck_library_existsandcheck_include_file. The main problem with these two is that they expect CFLAGS and LDFLAGS to be set correctly before the call.The module now creates an
IMPORTEDtargetPFM::libpfmand we can link to it as expected.