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

Add ifdef to disable pthreads usage #240

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

Sokolmish
Copy link
Contributor

@Sokolmish Sokolmish commented Apr 20, 2024

Hello. I used nanoflann in my project and got a linker error because of pthreads usage (std::async). Since I don't use parallel construction and don't want to link my code with pthreads, I've just removed these calls from the library. I think that it might be convenient for others to do the same by just adding a define before including the header, so I made this PR.

I was thinking about adding the possibility to disable multi-threading to CMake, but I'm not an expert on it. If you think that it is necessary, I'll figure it out and add it to the PR.

Also, I've included in the readme all the ifdefs I found in the header.

@jlblancoc jlblancoc merged commit 3900193 into jlblancoc:master Apr 22, 2024
6 checks passed
@jlblancoc
Copy link
Owner

LGTM, thanks! I think it's not worth changing cmake for this, since interested users may just define the preprocessor symbol from their side if needed.

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.

2 participants