Hi,
I use the cmake to build my caffe in windows and I meet some trouble like this 👍

Please post the complete output of the CMake command and the CMakeCache.txt file.
Thanks.
@willyd Hi, here is the error log in the CmakeError.log:
Determining if files pthread.h exist failed with the following output:
Change Dir: D:/users/v-yuhyua/cmake-caffe/caffe/build/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/v-yuhyua/AppData/Local/Continuum/Anaconda2/Library/bin/ninja.exe" "cmTC_8a703"
[1/2] Building C object CMakeFiles\cmTC_8a703.dir\CheckIncludeFiles.c.obj
FAILED: CMakeFiles/cmTC_8a703.dir/CheckIncludeFiles.c.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo /DWIN32 /D_WINDOWS /W3 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_8a703.dir\CheckIncludeFiles.c.obj /FdCMakeFiles\cmTC_8a703.dir\ /FS -c CheckIncludeFiles.c
CheckIncludeFiles.c(2) : fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
ninja: build stopped: subcommand failed.
Source:
/* */
#include <pthread.h>
int main(void){return 0;}
Hi @PkuRainBow
I had a similar problem to you, so I thought I'd share my solution. My problem occurred because I was trying to use 32bit numpy with 64bit python27.
I got the same error messages as you in console: "The dependency target 'pycaffe' of target 'pytest' does not exist", as well as in the CmakeError.log: "Cannot open include file: 'pthread.h': No such file or directory" although I am building with VS not ninja like you.
It turns out that the problem was that I had the wrong version of numpy, so numpy was found (no error message) but failed to work properly. You can check this by running 'import numpy' in IDLE(python GUI), and seeing if it fails.
My solution:
Hope this helped. Maybe a flag to check correct numpy version would be a good idea? Numpy is only officially supported on 32bit so this error is probably going to come up again
I'm late here but with same problem. In my case, this problem is caused by boost's python library not found. Solved by specifying --with-python when compiling boost:
# cd path_to_boost
bjam.exe toolset=msvc-14.0 --build-type=complete address-model=64 --with-serialization --with-system --with-date_time --with-regex --with-filesystem --with-timer --with-chrono --with-program_options --with-thread --with-python --stagedir="test"
And also setting boost folder in Dependencies.cmake before find_package(Boost:
set(BOOST_ROOT "D:/lib/boost_1_58_0")
set(Boost_INCLUDE_DIR "D:/lib/boost_1_58_0/build/install/include/boost-1_58")
set(Boost_LIBRARIES "D:/lib/boost_1_58_0/test/lib")
set(BOOST_LIBRARYDIR "D:/lib/boost_1_58_0/test/lib")
Hi @zchrissirhcz
I followed your method to fix this issue during installing caffe on windows 10.
But It is showing same error after passing your steps.
Windows 10
Cuda 9.0
Anaconda3
Boost 1.65.1
I couldn't add your line about Boost_INCLUDE_DIR, because there is no directory "build" after compile.
Please help me to fix this issue.
Thank you
@mahcinelearning2018 Do you mean there is no "build" directory after the compilation of boost? In fact, bjam or b2 will generate lib files in $BOOST_ROOT/bin.v2 and copy to $STAGE_DIR/lib, where $BOOST_ROOT is the directory of your extracted boost files, and $STAGE_DIR is $BOOST_DIR/stage by default, unless you specify it. In my example, I specify $STAGE_DIR to $BOOST_ROOT/test and will see $BOOST_ROOT/test/lib folder which containing these following files:
D:\lib\boost_1_58_0\test\lib 的目录
2018/08/14 18:46 <DIR> .
2018/08/14 18:46 <DIR> ..
2018/08/14 15:54 33,280 boost_chrono-vc140-mt-1_58.dll
2018/08/14 15:54 24,744 boost_chrono-vc140-mt-1_58.lib
2018/08/14 15:53 56,320 boost_chrono-vc140-mt-gd-1_58.dll
2018/08/14 15:53 24,894 boost_chrono-vc140-mt-gd-1_58.lib
2018/08/14 15:54 61,440 boost_date_time-vc140-mt-1_58.dll
2018/08/14 15:54 29,952 boost_date_time-vc140-mt-1_58.lib
2018/08/14 15:53 139,264 boost_date_time-vc140-mt-gd-1_58.dll
2018/08/14 15:53 30,136 boost_date_time-vc140-mt-gd-1_58.lib
2018/08/14 15:54 136,192 boost_filesystem-vc140-mt-1_58.dll
2018/08/14 15:54 102,224 boost_filesystem-vc140-mt-1_58.lib
2018/08/14 15:53 217,600 boost_filesystem-vc140-mt-gd-1_58.dll
2018/08/14 15:53 102,866 boost_filesystem-vc140-mt-gd-1_58.lib
2018/08/14 15:55 481,280 boost_program_options-vc140-mt-1_58.dll
2018/08/14 15:55 487,118 boost_program_options-vc140-mt-1_58.lib
2018/08/14 15:54 918,528 boost_program_options-vc140-mt-gd-1_58.dll
2018/08/14 15:54 501,806 boost_program_options-vc140-mt-gd-1_58.lib
2018/08/14 18:42 288,768 boost_python-vc140-mt-1_58.dll
2018/08/14 18:42 205,434 boost_python-vc140-mt-1_58.lib
2018/08/14 18:41 649,216 boost_python-vc140-mt-gd-1_58.dll
I hit same issue, and solved by executing 'python -m pip install numpy'.
Most helpful comment
Hi @PkuRainBow
I had a similar problem to you, so I thought I'd share my solution. My problem occurred because I was trying to use 32bit numpy with 64bit python27.
I got the same error messages as you in console: "The dependency target 'pycaffe' of target 'pytest' does not exist", as well as in the CmakeError.log: "Cannot open include file: 'pthread.h': No such file or directory" although I am building with VS not ninja like you.
It turns out that the problem was that I had the wrong version of numpy, so numpy was found (no error message) but failed to work properly. You can check this by running 'import numpy' in IDLE(python GUI), and seeing if it fails.
My solution:
Hope this helped. Maybe a flag to check correct numpy version would be a good idea? Numpy is only officially supported on 32bit so this error is probably going to come up again