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

Use CpuFeatures target #603

Merged
merged 4 commits into from
Sep 13, 2023
Merged

Use CpuFeatures target #603

merged 4 commits into from
Sep 13, 2023

Conversation

jsallay
Copy link
Contributor

@jsallay jsallay commented Sep 27, 2022

The build process is more flexible if we use cmake targets rather than directly linking to libraries. The target is used in other places in the CMakeLists.txt, but was not used in the target_link_libraries command.

@marcusmueller
Copy link
Member

"Build static on ubuntu-latest" fails because:

  Target "volk_static" links to:
    CpuFeatures::cpu_features
  but the target was not found. 

don't know why that happens, but not on the older ubuntus.

@jsallay
Copy link
Contributor Author

jsallay commented Sep 28, 2022 via email

@marcusmueller
Copy link
Member

hm maybe the others use a directly downloaded cpufeatures and the most current one relies on a ubuntu package?

jdemel
jdemel previously approved these changes Sep 29, 2022
Copy link
Contributor

@jdemel jdemel left a comment

Choose a reason for hiding this comment

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

LGTM. I was under the impression we would do this everywhere. Also, I assumed cpu_features is an alias for CpuFeatures::cpu_features. Do we use the same approach for the dynamic library?

@jdemel jdemel dismissed their stale review September 29, 2022 02:04

Oops. This change actually breaks on ubuntu-latest. Also, could you just sign your commit to acknowledge our DCO process. That'd be great.

Copy link
Contributor

@michaelld michaelld left a comment

Choose a reason for hiding this comment

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

LGTM after this change

@jdemel jdemel mentioned this pull request Oct 9, 2022
@ashley-b
Copy link
Contributor

Any chance of this getting merged in ?

@jdemel
Copy link
Contributor

jdemel commented Sep 13, 2023

@jsallay I guess @ashley-b 's question is mostly direct at you.

I'd like to merge this as soon as all issues are fixed. That would be

  1. the DCO issue which should be trivial to fix
  2. the ubuntu-latest issue. Unfortunately, the error message is gone by now. It should be simple to trigger our CI though with a simple push with the DCO fix.

@ashley-b
Copy link
Contributor

@jsallay Thanks for the quick follow up, I just tried building it in a ubuntu container and it built with out error

lsb_release -a

Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.5 LTS
Release:	20.04
Codename:	focal

Also I noticed not all the target_link_librarys for cpu_feature have been changed to use modern CMake targets.

https://github.com/jsallay/volk/blob/823e88aec459011ebd519f50ec2caa2ccc9bcb3b/lib/CMakeLists.txt#L537

and

This block does not make sense, since both lines of the if/else seem to do the same thing
https://github.com/jsallay/volk/blob/823e88aec459011ebd519f50ec2caa2ccc9bcb3b/lib/CMakeLists.txt#L510C1-L517C6

Signed-off-by: John Sallay <jasallay@gmail.com>
Signed-off-by: John Sallay <jasallay@gmail.com>
Signed-off-by: John Sallay <jasallay@gmail.com>
@jsallay
Copy link
Contributor Author

jsallay commented Sep 13, 2023

Looks like CpuFeature::cpu_features is the consistently defined target.

@jdemel
Copy link
Contributor

jdemel commented Sep 13, 2023

@jsallay thanks for taking care of this PR. It looks good to me now. All the comments are addressed. Merging.

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.

5 participants