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

run build_win.cmd build failed, could not find "pthread.h" on windows branch #5840

Open
afterimagex opened this issue Aug 11, 2017 · 16 comments

Comments

@afterimagex
Copy link

Please use the caffe-users list for usage, installation, or modeling questions, or other requests for help.
Do not post such requests to Issues. Doing so interferes with the development of Caffe.

Please read the guidelines for contributing before submitting this issue.

Issue summary

Determining if the include file pthread.h exists failed with the following output:
Change Dir: E:/caffe-windows/build/CMakeFiles/CMakeTmp

Run Build Command:"E:/Anaconda2/Library/bin/ninja.exe" "cmTC_41e79"
[1/2] Building C object CMakeFiles\cmTC_41e79.dir\CheckIncludeFile.c.obj

FAILED: CMakeFiles/cmTC_41e79.dir/CheckIncludeFile.c.obj

C:\PROGRA2\MICROS1.0\VC\bin\amd64\cl.exe /nologo /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_41e79.dir\CheckIncludeFile.c.obj /FdCMakeFiles\cmTC_41e79.dir\ /FS -c CheckIncludeFile.c

CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory

ninja: build stopped: subcommand failed.

Steps to reproduce

If you are having difficulty building Caffe or training a model, please ask the caffe-users mailing list. If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.

[168/218] Building CXX object python\CMakeFiles\pycaffe.dir\caffe_caffe.cpp.obj
FAILED: python/CMakeFiles/pycaffe.dir/caffe/_caffe.cpp.obj
C:\PROGRA2\MICROS1.0\VC\bin\amd64\cl.exe /nologo /TP -DBOOST_ALL_NO_LIB -DCAFFE_VERSION=1.0.0 -DCMAKE_WINDOWS_BUILD -DGLOG_NO_ABBREVIATED_SEVERITIES -DGOOGLE_GLOG_DLL_DECL=__declspec(dllimport) -DGOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS=__declspec(dllimport) -DH5_BUILT_AS_DYNAMIC_LIB=1 -DUSE_CUDNN -DUSE_LEVELDB -DUSE_LMDB -DUSE_OPENCV -Dpycaffe_EXPORTS -Iinclude -I. -IE:\Anaconda2\include -IE:\Anaconda2\lib\site-packages\numpy\core\include -IC:\Users\seeta-xpc.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\include\boost-1_61 -IC:\Users\seeta-xpc.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -IC:\Users\seeta-xpc.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\include\opencv -I..\include -IC:\Users\seeta-xpc.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\Include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /FS /MD /O2 /Ob2 /DNDEBUG /FS /showIncludes /Fopython\CMakeFiles\pycaffe.dir\caffe_caffe.cpp.obj /Fdpython\CMakeFiles\pycaffe.dir\ /FS -c ..\python\caffe_caffe.cpp
C:\Users\seeta-xpc.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\include\boost-1_61\boost/python/detail/caller.hpp(55): warning C4244: 'return': conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data
.\caffe/export.hpp(7): fatal error C1083: Cannot open include file: 'caffe/include_symbols.hpp': No such file or directory
ninja: build stopped: subcommand failed.
ERROR: Build failed

Your system configuration

Operating system: Windows10
Compiler: Ninja Cmake VS2015
CUDA version (if applicable): 8.0
CUDNN version (if applicable): 5.1
BLAS: script get
Python or MATLAB version (for pycaffe and matcaffe respectively): Anaconda2.7-x64 matlab2016b

@yunau
Copy link

yunau commented Aug 17, 2017

I have the same error.

.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\include\boost-1_61\boost/python/detail/caller.hpp(55): warning C4244: 'return': conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data
.\caffe/export.hpp(7): fatal error C1083: Cannot open include file: 'caffe/include_symbols.hpp': No such file or directory
ninja: build stopped: subcommand failed.
ERROR: Build failed

@willyd
Copy link
Contributor

willyd commented Aug 17, 2017

Not sure why CMake is looking for pthread.h.

Can you post (upload a txt file) the complete output of the following command:

ninja caffe.lib 

@willyd
Copy link
Contributor

willyd commented Aug 22, 2017

It seems that CMake 3.9.1 is causing that sort of issues with the Ninja generator on CI builds. Best workaround might be to use the VS generator or downgrade CMake to 3.9.0 or 3.8.x.

@skylarjhdownes
Copy link

I tried building with CMake 3.8.2 instead of 3.9.1 The build wasn't stopped by an error in the command prompt, but the Cannot open include file: 'pthread.h' error still showed up in CMakeError.log.

Is CMakeError.log only generated when the build fails? Both builds have generated the dlls I need, but I'm not sure if the 3.8.2 build is succeeding or just failing silently.

@skylarjhdownes
Copy link

skylarjhdownes commented Aug 23, 2017

In my 3.8.2 build folder, running
caffe\build\lib>ninja caffe.lib
gives me the output
ninja: error: loading 'build.ninja': The system cannot find the file specified.

@marcosly
Copy link

I have the same error ,did you figure it out or have other methods to install caffe in windows

@skylarjhdownes
Copy link

skylarjhdownes commented Sep 11, 2017

For me the successful path was to add

set(CMAKE_C_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe")
set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe")

to the top of CMakeLists.txt, then to run .\scripts\build_win.cmd
I just needed the .dll files (I also set the CMAKE_BUILD_SHARED_LIBS flag), so getting those compiled was where I stopped.

@afterimagex
Copy link
Author

i give it up...
i change the project to https://github.com/Microsoft/caffe and build success

@flyinskyin2013
Copy link

flyinskyin2013 commented Dec 18, 2017

I solved it.
In your caffe/build dir,you can find include_symbols.hpp file(Problem: This dir do not pass to cl.exe by '-I' parameter,But this file created by build_win.cmd script。 )。Then,It is easy to go cool。

Do copy include_symbols.hpp file to caffe/include/caffe/ ,then you will solved it。
Hope to help you。

@ghost
Copy link

ghost commented Jan 6, 2018

I have met this problem,too.
错误 C1083 无法打开包括文件: “caffe/include_symbols.hpp”: No such file or directory device_query E:\caffe-build\caffe\export.hpp 7
And I search for the directory,but I couldn't find it anywhere.

Finally,I find the one project named caffe.bin_install_prerequisites in the right area of vs2015's solution view. When I finish building this project ,I find the include_symbols.hpp file in my directory: {caffe-build-dir}/caffe/include_symbols.hpp.

Last, I want to remember you that you should build the ALL_BUILD Target

@yinyue1011
Copy link

@xmagicer Dear friend, I have also met this problem. I have rebuilt the project "caffe.bin_install_prerequisties", but there is still no "include_symbols.hpp" in my directory(caffe-build-dir/caffe). There is only "export.hpp" in my directory. Do you had any other operations?

@Site1997
Copy link

Thanks to @willyd !
I downgrade CMake(ver 3.10) to CMake(3.6.4), and it seems to be working fine till now.

@BaeMinCheon
Copy link

I solved it

in my case, I'd git-cloned at D:\...\[STUDY] Caffe\...\ so location was D:\...\[STUDY] Caffe\...\caffe\
building caffe many times, I do changed many many options but C1083 still there
and after I eventually moved to D:\...\TEST\...\ building has been successful

as you see, that folder name [STUDY] Caffe was the problem
you shouldn't put the blank in folder name
I've struggled with this shit for 2 days...uninstalling and installing VS & Python

@russoen
Copy link

russoen commented Sep 12, 2018

This helped me:
https://groups.google.com/forum/#!topic/caffe-users/kWuf4L0dwmM

@taojianggit
Copy link

taojianggit commented Dec 13, 2018

This helped me:
https://groups.google.com/forum/#!topic/caffe-users/kWuf4L0dwmM

yeah, just use vs2015, rather not Ninja

@EMCL
Copy link

EMCL commented Apr 6, 2019

hi,
i have solved this by changing folder permission to full control to caffe build folder.

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