Caffe windows build error 'cannot open include file pthread.h'

777 views
Skip to first unread message

Andrew Kyngdon

unread,
Jan 5, 2017, 8:34:42 PM1/5/17
to Caffe Users
Hi,

Trying to build Caffe in Windows (using the official Caffe Windows branch) but I get the following error:

"C:\Projects\caffe\build\ALL_BUILD.vcxproj" (default target) (1) -> "C:\Projects\caffe\build\src\caffe\caffe.vcxproj" (default target) (3) ->
(CustomBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB606: "cmd.exe" exited with code 1. [C:\Projects\caffe\build\src\caffe\caffe.vcxproj]

The CMakeError log says that it cannot find a pthread.h file (see attached). I read but this it didn't help.

Any help would be appreciated :)

Cheers.

Windows 8.1 Enterprise x64
MS Visual Studio 2015 Professional
CMake 3.7.0
CUDA 8.0
cudnn 5.1
Python 3.5.2
CMakeError.log

Andrew Kyngdon

unread,
Jan 18, 2017, 3:26:50 PM1/18/17
to Caffe Users
Hi all,

I meant to update this. After I deleted Caffe and shut the computer down for a couple of days, I came back to it and the CMake build worked first go. Most curious as I did try deleting, restarting and installing Caffe again before I gave up.

Anyway, the installation works very well with Python 3.5, CUDA 8.0 and cuDNN 5.1.

Cheers,

Andrew

Paul Delamusica

unread,
May 25, 2017, 3:27:17 PM5/25/17
to Caffe Users
I am having the same problem on Windows 10, Anaconda2. I have to exclude gtest and test.testbin in order to get it to build. Is there an easy to use replacement for this Unix code out there?

Paul

Snarcraft Utiha

unread,
May 25, 2017, 6:13:22 PM5/25/17
to Caffe Users
Hello,
Finally have you figured out what happened ?
Because I have the same problem as you, I tried to delete Caffe and shut the computer down for 2 days^^ but nothing has changed 

Paul Delamusica

unread,
May 25, 2017, 6:25:57 PM5/25/17
to Caffe Users
No, I haven't. But my Windows 7 build doesn't seems to have this problem. Also, in gtest.h there is a line saying:
"// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0".
I haven't tried this myself. I just don't build gtest.

Paul

Thu Ngo

unread,
Oct 21, 2017, 1:13:32 AM10/21/17
to Caffe Users
I had same problem. After all, i solved this with change protoc.exe and some protobuf.proto in dependencies/libraries.
Go to this link, and download the version 3.1.0 of protoc.
Contact me thu...@gmail.com if you have not solved yet.
Reply all
Reply to author
Forward
0 new messages