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

Code issues when building w/ win32 threads #73

Open
greatwolf opened this issue Aug 18, 2016 · 4 comments
Open

Code issues when building w/ win32 threads #73

greatwolf opened this issue Aug 18, 2016 · 4 comments

Comments

@greatwolf
Copy link

It appears there are quite a few problems with the latest head resulting in a broken build when compiling under windows. Here are the issues I've encountered so far in no particular order:

  • THThread.c uses USE_WIN32_THREADS but the CMake file actually defines USE_WIN_THREADS=1 causing incorrect preprocessing. This is easily fixed by changing one of them to match.
  • The restrict keyword is a c99 feature but THThread.c is being compiled without using -std=c99 resulting in errors.
  • In THThread.c, THREAD_FUNCTION isn't defined anywhere but pthread_create attempts to cast into it nonetheless resulting in compile errors. According to MSDN _beginthreadex needs unsigned ( __stdcall *start_address )( void * ) for the 3rd argument. Perhaps THREAD_FUNCTION should be defined to that?
  • threads.c #include <dlfcn.h> but that header doesn't exist under windows. Not sure what the fix should be here.

Please advise on how best to address the above issues.

Thanks

@greatwolf
Copy link
Author

Looks like there's an outstanding Pull Request #21 from last year that fixes most of the problems I've encountered above. Why hasn't this been merged into the master branch yet?

@honghuCode
Copy link

honghuCode commented Aug 25, 2016

Has Question solved?@greatwolf ,i have encounted a same problems in windows platform

@greatwolf
Copy link
Author

greatwolf commented Aug 25, 2016

@honghuCode unfortunately no, I haven't heard anything back from the torch maintainers yet. :(
For time being I'm just using lua-lanes for my concurrency needs while programming in lua.

@soumith
Copy link
Member

soumith commented Aug 25, 2016

If you could rebase #21 to on top of master, i can merge

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

3 participants