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

PIC for x86-64 *nix linking & a non-blocking poll in C API #90

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

soltanmm
Copy link

Two big things:

I had problems linking my files against Emokit on my x86-64 machine due to the lack of a position-independent code flag in the build files (it's either this or using wide-addressing, which is... well as far as I've heard, dumb). I added this to the top-level CMakeLists.txt using the built-in CMake macro, made available in version 2.8.9. This means that the required CMake version was upped to CMake 2.8.9. If this is a problem it should be fairly easy to add the necessary (messy) if/endif switches to make it work in earlier CMake versions.

I had major major headaches getting emokit's C API to play nicely with threads due to the blocking read if the device was unplugged in the middle of the program running. Every session would end with a segfault because the hanging thread would finally be cut off and not be able to clean up after itself because it hung around longer than any thread should reasonably hang around for. I managed to work around it, but the solution was disgusting and I hated the code. So instead, I added the more elegant solution: a non-blocking poll. I no longer feel like vomiting on my keyboard and I don't think anyone else should feel that way ever. Unless they had the fish for dinner. Then they can enjoy their food poisoning.

One minor thing:

I've removed the Findlibusb-1.0.cmake file. It wasn't being used and it was confusing for me to discern what it was doing there when I initially forked the repository, and therefore t'was culled.

Some notes:

I haven't tested this outside of Linux, and I have yet to ever use the Python API (because I'm a masochist and love C/C++/D and other evil things [D isn't evil]). If there's something broken over yonder due to this request, well, erm, I guess I wouldn't feel bad about being called a fool, but please do it with a kind firm tone, as if speaking to your goldfish. Or something.

Thanks~!

…Added flag for position independent code so that compiles would work for linking libraries on Linux.
@olorin
Copy link
Member

olorin commented Aug 13, 2013

Thanks - sounds good to me; I'll review and test when I have a chance.

@ghost ghost assigned qdot Jun 22, 2016
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.

3 participants