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

Build fails with missing 'pthread.h' in Caffe.vcxproj #19

Closed
jpsacha opened this issue Dec 3, 2015 · 3 comments
Closed

Build fails with missing 'pthread.h' in Caffe.vcxproj #19

jpsacha opened this issue Dec 3, 2015 · 3 comments

Comments

@jpsacha
Copy link
Contributor

jpsacha commented Dec 3, 2015

I am building using VS12 on Windows 7 following instructions in readme (after correction for #18). It goes for a while fine till it stop on error in Caffe.vcxproj. The actual error message is in
Caffe-prefix\src\Caffe-build\CMakeFiles\CMakeError.log:

Determining if the include file pthread.h exists failed with the following output:

...

D:\build\Caffe-prefix\src\Caffe-build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: 
   Cannot open include file: 'pthread.h': No such file or directory [D:\build\Caffe-prefix\src\Caffe-build\CMakeFiles\CMakeTmp\cmTC_12ae6.vcxproj]

Look that I need to add pthreads library somewhere. What is the proper way to to it?

@willyd
Copy link
Owner

willyd commented Dec 3, 2015

Never seen that one. By VS12 you mean 2013 right? You should not need to add pthreads but use Win32 Threads instead. The threads in caffe are checked here:

https://github.com/willyd/caffe/blob/msvc/cmake/Dependencies.cmake

See cmake doc for FindThreads:

https://cmake.org/cmake/help/v3.3/module/FindThreads.html

@jpsacha
Copy link
Contributor Author

jpsacha commented Dec 4, 2015

Thanks for the hint. It let me eventually realize that I was looking not at the cause of the problem but the last reported error that was not important.

Error above that one was

Could not find PROTOBUF Compiler

Very similar to situation described in Issue #17, so I followed advise there. Had to edit Caffe-prefix\src\Caffe-build\CMakeCache.txt and add location for PROTOBUF_PROTOC_EXECUTABLE and PROTOBUF_LIBRARY that are located in install/vsprojects/Release of the build directory, and PROTOBUF_LIBRARY_DEBUG located in install/vsprojects/Debug. It is important to have both Release and Debug defined to avoid linking errors in the default build.

@yosider
Copy link

yosider commented Nov 5, 2016

I followed the instruction for using CMake but I got the same problem...

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