open-mmlab / denseflow

Extracting optical flow and frames
https://open-mmlab.github.io/
MIT License
307 stars 61 forks source link

encounter issue when installing #3

Closed wangzheallen closed 4 years ago

wangzheallen commented 4 years ago

https://github.com/open-mmlab/denseflow/blob/master/INSTALL.md when I ran ./zzdenseflow.sh, I got

CMake Error at CMakeLists.txt:67 (install): install TARGETS given no ARCHIVE DESTINATION for static library target "zzdenseflow".

when I read CMakeFiles/CMakeError.log, I got

/usr/bin/cc -fPIC CMakeFiles/cmTC_b7f79.dir/CheckSymbolExists.c.o -o cmTC_b7f79 CMakeFiles/cmTC_b7f79.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x1b): undefined reference topthread_create' collect2: error: ld returned 1 exit status CMakeFiles/cmTC_b7f79.dir/build.make:86: recipe for target 'cmTC_b7f79' failed

innerlee commented 4 years ago

did you export BOOST_ROOT=$ZZROOT before install denseflow?

innerlee commented 4 years ago

Another try is to remove all anaconda related things in your PATH and LD_LIBRARY_PATH.

Conda is often a trouble when compiling & installing.

wangzheallen commented 4 years ago

Thanks for answering! After adding all the include path, lib path and bin path, I have the following compiling error.

libzzdenseflow.a(denseflow_gpu.cpp.o): In function DenseFlow::calc_optflows_imp(FlowBuffer const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, bool, cv::cuda::Stream&)': denseflow_gpu.cpp:(.text+0x296b): undefined reference tocv::cuda::OpticalFlowDual_TVL1::create(double, double, double, int, int, double, int, double, double, bool)' denseflow_gpu.cpp:(.text+0x2a08): undefined reference to cv::cuda::FarnebackOpticalFlow::create(int, double, bool, int, int, int, double, int)' denseflow_gpu.cpp:(.text+0x2a9f): undefined reference tocv::cuda::BroxOpticalFlow::create(double, double, double, int, int, int)' collect2: error: ld returned 1 exit status

innerlee commented 4 years ago

is the opencv compiled with cuda?

wangzheallen commented 4 years ago

is the opencv compiled with cuda?

I mv anaconda3 to anaconda3_bk (also disable all anaconda in .bashrc) and check the python I am using is /usr/bin/python2.7, then recompile everything following https://github.com/open-mmlab/denseflow/blob/master/INSTALL.md

innerlee commented 4 years ago

Could you check if OpenCV is compiled with CUDA?

You may run zzopencv again, and look at its summary when it prints.

wangzheallen commented 4 years ago

Reran zzopencv and getting following summary (only copy cuda related):

-- CUDA detected: 10.0 -- CUDA NVCC target flags: -gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-D_FORCE_INLINES -- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /usr/local/lib/libopenblas.so -- LAPACK(OpenBLAS): Support is enabled.

-- NVIDIA CUDA: YES (ver 10.0, CUFFT CUBLAS FAST_MATH) -- NVIDIA GPU arch: 30 35 37 50 52 60 61 70 75 -- NVIDIA PTX archs:

-- cuDNN: YES (ver 7.5.1)

-- OpenCL: YES (no extra features) -- Include path: /home/ubuntu/app/src/opencv/3rdparty/include/opencl/1.2 -- Link libraries: Dynamic load

-- Python (for build): /usr/bin/python

-- Install to: /home/ubuntu/app

innerlee commented 4 years ago

Looks like opencv is okay. Could rm the denseflow dir in $ZZROOT/src/denseflow and rerun the installation? In the meantime, look at its output, and find which opencv it is using.

I guess it finds the wrong opencv (without cuda). Also, did you export OpenCV_DIR=$ZZROOT before installing denseflow?

wangzheallen commented 4 years ago

Thanks for the kind answer! Below are keys to solve the problems.

  1. add ARCHIVE DESTINATION lib, before LIBRARY DESTINATION lib in CMakelist.txt
  2. clean everything (anaconda )before start installing. I delete all the app directory and reinstall everything follow https://github.com/open-mmlab/denseflow/blob/master/INSTALL.md
  3. I export PATH, INCLUDE_PATH, LD_LIBRARY_PATH, CPLUS_INCLUDE_PATH, before installing Opencv.
innerlee commented 4 years ago

Glad you solved it! If the CMakelist.txt or the install scripts could be improved, would you mind make a pr?