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

CMake targets for the C shared library #126

Open
Tafnab opened this issue Mar 25, 2024 · 3 comments
Open

CMake targets for the C shared library #126

Tafnab opened this issue Mar 25, 2024 · 3 comments
Assignees

Comments

@Tafnab
Copy link
Contributor

Tafnab commented Mar 25, 2024

Since StringZilla depends upon AVX or AVX-512 (as the case may be), does it automatically fail-over if the processor it's running on doesn't have AVX-512?

For example, if I build on a machine with AVX-512 and run on one with AVX, will StringZilla just work, no problems?

@ashvardanian
Copy link
Owner

Yes, @Tafnab, that's the "Dynamic Dispatch" part. If you add c/lib.c to you build pipeline, it will include all the backends into the binary, and will then pick the best one available at run time. If you only use the headers, that won't work. We can probably improve the CMake to expose multiple targets (related to #85), but I am always afraid of refactoring CMake 😅

@Tafnab
Copy link
Contributor Author

Tafnab commented Mar 26, 2024

@ashvardanian: I'm really interested in using it only for C++. c/lib.c looks like C++ will like it also.
So what you're saying is that, in my C++ program (main somewhere), I should include this file, as well as the headers.

@ashvardanian
Copy link
Owner

Yes @Tafnab, that would be the way to do it, until I merge #85 and #136 - which may take a few weeks - refactoring CMake is a nightmare 😭

@ashvardanian ashvardanian changed the title What is the plan for build once and run on any x86 processor? CMake targets for the C shared library Apr 17, 2024
@ashvardanian ashvardanian self-assigned this Apr 17, 2024
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

No branches or pull requests

2 participants