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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The dependency target "pycaffe" of target "pytest" does not exist ! #5177

Closed
PkuRainBow opened this Issue Jan 12, 2017 · 7 comments

Comments

Projects
None yet
7 participants
@PkuRainBow
Copy link

PkuRainBow commented Jan 12, 2017

Hi,

I use the cmake to build my caffe in windows and I meet some trouble like this 馃憤

qq 20170112203247

@willyd willyd added the windows label Jan 12, 2017

@willyd

This comment has been minimized.

Copy link
Contributor

willyd commented Jan 12, 2017

Please post the complete output of the CMake command and the CMakeCache.txt file.
Thanks.

@PkuRainBow

This comment has been minimized.

Copy link
Author

PkuRainBow commented Jan 13, 2017

@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;}
@decrow3

This comment has been minimized.

Copy link

decrow3 commented Jan 22, 2017

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:

  1. Delete numpy folder in: C:\Python27\Lib\site-packages
  2. Download the x64 numpy (unofficial) binaries in this site: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
  3. Unzip and copy the contained numpy folder back to C:\Python27\Lib\site-packages
  4. Check that it works by running 'import numpy' in IDLE(python GUI)

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

@shelhamer shelhamer closed this Apr 14, 2017

@zchrissirhcz

This comment has been minimized.

Copy link

zchrissirhcz commented Aug 14, 2018

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")
@mahcinelearning2018

This comment has been minimized.

Copy link

mahcinelearning2018 commented Aug 21, 2018

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

@zchrissirhcz

This comment has been minimized.

Copy link

zchrissirhcz commented Aug 22, 2018

@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
@PhoebeHui

This comment has been minimized.

Copy link

PhoebeHui commented Oct 25, 2018

I hit same issue, and solved by executing 'python -m pip install numpy'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment