facebookarchive / caffe2

Caffe2 is a lightweight, modular, and scalable deep learning framework.
https://caffe2.ai
Apache License 2.0
8.42k stars 1.94k forks source link

Makefile:126: recipe for target 'cmTC_75f91/fast' failed #2297

Closed FlouriteJ closed 6 years ago

FlouriteJ commented 6 years ago

System information

CMake summary output

******** Summary ********
-- General:
--   CMake version         : 3.5.1
--   CMake command         : /usr/bin/cmake
--   Git version           : unknown
--   System                : Linux
--   C++ compiler          : /usr/bin/c++
--   C++ compiler version  : 5.4.0
--   Protobuf compiler     : /usr/bin/protoc
--   Protobuf include path : /usr/include
--   Protobuf libraries    : optimized;/usr/lib/x86_64-linux-gnu/libprotobuf.so;debug;/usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread
--   BLAS                  : Eigen
--   CXX flags             :  -DONNX_NAMESPACE=onnx_c2 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization
--   Build type            : Release
--   Compile definitions   :
--
--   BUILD_BINARY          : ON
--   BUILD_DOCS            : OFF
--   BUILD_PYTHON          : ON
--     Python version      : 2.7.12
--     Python includes     : /usr/include/python2.7
--   BUILD_SHARED_LIBS     : ON
--   BUILD_TEST            : ON
--   USE_ATEN              : OFF
--   USE_ASAN              : OFF
--   USE_CUDA              : ON
--     CUDA version        : 7.5
--     CuDNN version       : 5.1.10
--     CUDA root directory : /usr
--     CUDA library        : /usr/lib/x86_64-linux-gnu/libcuda.so
--     CUDA NVRTC library  : /usr/lib/x86_64-linux-gnu/libnvrtc.so
--     CUDA runtime library: /usr/lib/x86_64-linux-gnu/libcudart.so
--     CUDA include path   : /usr/include
--     NVCC executable     : /usr/bin/nvcc
--     CUDA host compiler  : /usr/bin/cc
--   USE_EIGEN_FOR_BLAS    : 1
--   USE_FFMPEG            : OFF
--   USE_GFLAGS            : ON
--   USE_GLOG              : ON
--   USE_GLOO              : ON
--   USE_LEVELDB           : ON
--     LevelDB version     : 1.18
--     Snappy version      : 1.1.3
--   USE_LITE_PROTO        : OFF
--   USE_LMDB              : ON
--     LMDB version        : 0.9.17
--   USE_METAL             : OFF
--   USE_MKL               :
--   USE_MOBILE_OPENGL     : OFF
--   USE_MPI               : OFF
--   USE_NCCL              : ON
--   USE_NERVANA_GPU       : OFF
--   USE_NNPACK            : ON
--   USE_OBSERVERS         : ON
--   USE_OPENCV            : ON
--     OpenCV version      : 2.4.9.1
--   USE_OPENMP            : OFF
--   USE_PROF              : OFF
--   USE_REDIS             : OFF
--   USE_ROCKSDB           : OFF
--   USE_THREADS           : ON
--   USE_ZMQ               : OFF
-- Configuring incomplete, errors occurred!
See also "/home/yqz/caffe2/caffe2/build/CMakeFiles/CMakeOutput.log".
See also "/home/yqz/caffe2/caffe2/build/CMakeFiles/CMakeError.log".

[CMakeError.log](https://github.com/caffe2/caffe2/files/1821647/CMakeError.log)
[CMakeLists.txt](https://github.com/caffe2/caffe2/files/1821648/CMakeLists.txt)
[CMakeOutput.log](https://github.com/caffe2/caffe2/files/1821649/CMakeOutput.log)

I tried /issues/2144, but it didn't help.

pjh5 commented 6 years ago

This line "-- Configuring incomplete, errors occurred!" means that the cmake command did not work, but the real cause of the error is not in this output. Can you post the full cmake output?

Our build system is essentially two commands, cmake which configures the files, finds packages, and generates makefiles, and then make, which compiles and links Caffe2 together. The cmake command did not work for you because it could not find some of the packages that it needed.

FlouriteJ commented 6 years ago

Full cmake output

@pjh5 -- Does not need to define long separately. -- std::exception_ptr is supported. -- NUMA is available -- Current compiler supports avx2 extention. Will build perfkernels. -- Caffe2: Found protobuf with old-style protobuf targets. -- Caffe2 protobuf include directory: -- The BLAS backend of choice:Eigen -- Found NNPACK (include: /usr/local/include, library: /usr/local/lib/libnnpack.a) -- Found PTHREADPOOL (library: /usr/local/lib/libpthreadpool.a) -- Found CPUINFO (library: /usr/local/lib/libcpuinfo.a) INFOFound external NNPACK installation. CMake Error at cmake/Dependencies.cmake:97 (add_subdirectory): The source directory

/home/yqz/caffe2/caffe2/third_party/cpuinfo

does not contain a CMakeLists.txt file. Call Stack (most recent call first): CMakeLists.txt:101 (include)

CMake Error at cmake/Dependencies.cmake:102 (set_property): set_property could not find TARGET cpuinfo. Perhaps it has not yet been created. Call Stack (most recent call first): CMakeLists.txt:101 (include)

-- Caffe2: Cannot find gflags automatically. Using legacy find. -- Caffe2: Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so) -- Caffe2: Cannot find glog automatically. Using legacy find. -- Caffe2: Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so) CMake Error at cmake/Dependencies.cmake:152 (add_subdirectory): The source directory

/home/yqz/caffe2/caffe2/third_party/googletest

does not contain a CMakeLists.txt file. Call Stack (most recent call first): CMakeLists.txt:101 (include)

CMake Error at cmake/Dependencies.cmake:159 (add_subdirectory): The source directory

/home/yqz/caffe2/caffe2/third_party/benchmark

does not contain a CMakeLists.txt file. Call Stack (most recent call first): CMakeLists.txt:101 (include)

-- Found lmdb (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so) -- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so) -- Found Snappy (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so) -- Found Numa (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnuma.so) -- OpenCV found (/usr/share/OpenCV) -- Found system Eigen at /usr/local/include/eigen3 -- NumPy ver. 1.14.0 found (include: /usr/local/lib/python2.7/dist-packages/numpy/core/include) -- Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR) -- Caffe2: CUDA detected: 7.5 -- Found cuDNN: v5.1.10 (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so) -- Automatic GPU detection returned 6.1 6.1. -- Added CUDA NVCC flags for: sm_61 -- Could NOT find NCCL (missing: NCCL_INCLUDE_DIRS NCCL_LIBRARIES) CMake Error at /usr/share/cmake-3.5/Modules/ExternalProject.cmake:1915 (message): No download info given for 'nccl_external' and its source directory:

/home/yqz/caffe2/caffe2/third_party/nccl

is not an existing non-empty directory. Please specify one of:

-- Could NOT find CUB (missing: CUB_INCLUDE_DIR) -- Could NOT find Gloo (missing: Gloo_INCLUDE_DIR Gloo_LIBRARY) CMake Error at cmake/Dependencies.cmake:417 (add_subdirectory): The source directory

/home/yqz/caffe2/caffe2/third_party/gloo

does not contain a CMakeLists.txt file. Call Stack (most recent call first): CMakeLists.txt:101 (include)

CMake Warning at cmake/Dependencies.cmake:457 (message): mobile opengl is only used in android or ios builds. Call Stack (most recent call first): CMakeLists.txt:101 (include)

CMake Warning at cmake/Dependencies.cmake:533 (message): Metal is only used in ios builds. Call Stack (most recent call first): CMakeLists.txt:101 (include)

CMake Error at cmake/Dependencies.cmake:566 (add_subdirectory): The source directory

/home/yqz/caffe2/caffe2/third_party/onnx

does not contain a CMakeLists.txt file. Call Stack (most recent call first): CMakeLists.txt:101 (include)

CMake Error at cmake/public/utils.cmake:7 (get_target_property): get_target_property() called with non-existent target "onnx". Call Stack (most recent call first): cmake/Dependencies.cmake:569 (caffe2_interface_library) CMakeLists.txt:101 (include)

-- GCC 5.4.0: Adding gcc and gcc_s libs to link line -- Include NCCL operators -- Including image processing operators -- Excluding video processing operators due to no opencv -- Excluding mkl operators as we are not using mkl -- MPI operators skipped due to no MPI support -- Include Observer library -- Using lib/python2.7/dist-packages as python relative installation path -- Automatically generating missing init.py files.

-- **** Summary **** -- General: -- CMake version : 3.5.1 -- CMake command : /usr/bin/cmake -- Git version : unknown -- System : Linux -- C++ compiler : /usr/bin/c++ -- C++ compiler version : 5.4.0 -- Protobuf compiler : /usr/bin/protoc -- Protobuf include path : /usr/include -- Protobuf libraries : optimized;/usr/lib/x86_64-linux-gnu/libprotobuf.so;debug;/usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread -- BLAS : Eigen -- CXX flags : -DONNX_NAMESPACE=onnx_c2 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization -- Build type : Release -- Compile definitions :

-- BUILD_BINARY : ON -- BUILD_DOCS : OFF -- BUILD_PYTHON : ON -- Python version : 2.7.12 -- Python includes : /usr/include/python2.7 -- BUILD_SHARED_LIBS : ON -- BUILD_TEST : ON -- USE_ATEN : OFF -- USE_ASAN : OFF -- USE_CUDA : ON -- CUDA version : 7.5 -- CuDNN version : 5.1.10 -- CUDA root directory : /usr -- CUDA library : /usr/lib/x86_64-linux-gnu/libcuda.so -- CUDA NVRTC library : /usr/lib/x86_64-linux-gnu/libnvrtc.so -- CUDA runtime library: /usr/lib/x86_64-linux-gnu/libcudart.so -- CUDA include path : /usr/include -- NVCC executable : /usr/bin/nvcc -- CUDA host compiler : /usr/bin/cc -- USE_EIGEN_FOR_BLAS : 1 -- USE_FFMPEG : OFF -- USE_GFLAGS : ON -- USE_GLOG : ON -- USE_GLOO : ON -- USE_LEVELDB : ON -- LevelDB version : 1.18 -- Snappy version : 1.1.3 -- USE_LITE_PROTO : OFF -- USE_LMDB : ON -- LMDB version : 0.9.17 -- USE_METAL : OFF -- USE_MKL : -- USE_MOBILE_OPENGL : OFF -- USE_MPI : OFF -- USE_NCCL : ON -- USE_NERVANA_GPU : OFF -- USE_NNPACK : ON -- USE_OBSERVERS : ON -- USE_OPENCV : ON -- OpenCV version : 2.4.9.1 -- USE_OPENMP : OFF -- USE_PROF : OFF -- USE_REDIS : OFF -- USE_ROCKSDB : OFF -- USE_THREADS : ON -- USE_ZMQ : OFF -- Configuring incomplete, errors occurred! See also "/home/yqz/caffe2/caffe2/build/CMakeFiles/CMakeOutput.log". See also "/home/yqz/caffe2/caffe2/build/CMakeFiles/CMakeError.log".

manketon commented 6 years ago

@pjh5 I encountered the same problem in the same environment. We need your help, thank you! CMakeError.log: Determining if the pthread_create exist failed with the following output: Change Dir: /dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_ef45c/fast" /usr/bin/make -f CMakeFiles/cmTC_ef45c.dir/build.make CMakeFiles/cmTC_ef45c.dir/build make[1]: Entering directory '/dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_ef45c.dir/CheckSymbolExists.c.o /usr/bin/cc -o CMakeFiles/cmTC_ef45c.dir/CheckSymbolExists.c.o -c /dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp/CheckSymbolExists.c Linking C executable cmTC_ef45c /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ef45c.dir/link.txt --verbose=1 /usr/bin/cc CMakeFiles/cmTC_ef45c.dir/CheckSymbolExists.c.o -o cmTC_ef45c -rdynamic CMakeFiles/cmTC_ef45c.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x16): undefined reference topthread_create' collect2: error: ld returned 1 exit status CMakeFiles/cmTC_ef45c.dir/build.make:97: recipe for target 'cmTC_ef45c' failed make[1]: [cmTC_ef45c] Error 1 make[1]: Leaving directory '/dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_ef45c/fast' failed make: [cmTC_ef45c/fast] Error 2

File /dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp/CheckSymbolExists.c: / /

include

int main(int argc, char** argv) { (void)argv;

ifndef pthread_create

return ((int*)(&pthread_create))[argc];

else

(void)argc; return 0;

endif

}

Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_0629d/fast" /usr/bin/make -f CMakeFiles/cmTC_0629d.dir/build.make CMakeFiles/cmTC_0629d.dir/build make[1]: Entering directory '/dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_0629d.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_0629d.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c Linking C executable cmTC_0629d /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0629d.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_0629d.dir/CheckFunctionExists.c.o -o cmTC_0629d -rdynamic -lpthreads /usr/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status CMakeFiles/cmTC_0629d.dir/build.make:97: recipe for target 'cmTC_0629d' failed make[1]: [cmTC_0629d] Error 1 make[1]: Leaving directory '/dev/shm/minglu2/soft_common/caff_install_method/caffe2-master/build_minglu/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_0629d/fast' failed make: [cmTC_0629d/fast] Error 2

pjh5 commented 6 years ago

@FlouriteJ you need to run git submodule update . When you clone Caffe2 you must use the --recursive flag.

@FlouriteJ the error you mention in the title is not anywhere in the output you pasted. Is that another error you got? What did you run to generate that error?

FlouriteJ commented 6 years ago

@pjh5 In fact, I downloaded the zip file of master branch instead of cloning. May it be the reason of error? @pjh5 The title came from the file "CMakeError.log"(Ln 52). CMakeError.log

manketon commented 6 years ago

@FlouriteJ Tt is the reason. I do the same as you.