mariusmuja/flann — Issue #25: flann 1.7.1 build failed when cmake with BUILD_CUDA_LIB option ON
Author: wizzup
Created: 2012-01-17 04:32:35+00:00
State: open

Not sure if this duplicated with #21

Hi,
Please see if you can help on this issue

OS: ubuntu 11.10 x64
GCC version 4.4.6
CMake version 2.8.7

cmake command:

```bash
/usr/local/bin/cmake /opt/surfscan-dev/depend/source/flann-1.7.1 -DCMAKE_INSTALL_PREFIX=/opt/surfscan-dev/depend/install/flann-1.7.1 -DCMAKE_BUILD_TYPE=Release -DBUILD_CUDA_LIB=ON -DBUILD_C_BINDINGS=OFF -DBUILD_MATLAB_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF
```

cmake output:

```
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/lib/ccache/gcc
-- Check for working C compiler: /usr/lib/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/c++
-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.2+")
-- Found HDF5: debug;/usr/lib/libhdf5.so;debug;/usr/lib/x86_64-linux-gnu/libpthread.so;debug;/usr/lib/x86_64-linux-gnu/libz.so;debug;/usr/lib/x86_64-linux-gnu/libm.so;optimized;/usr/lib/libhdf5.so;optimized;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/lib/x86_64-linux-gnu/libz.so;optimized;/usr/lib/x86_64-linux-gnu/libm.so
-- Found GTest: /usr/lib/libgtest.a
-- Found CUDA: /usr/local/cuda (found version "4.0")
-- CUDA found (include: /usr/local/cuda/include, lib: /usr/local/cuda/lib64/libcudart.so)
-- checking for module 'tbb'
-- found tbb, version 3.0+r018
-- Found tbb: /usr/lib/libtbb.so
-- Could NOT find tbb_debug (missing: TBB_DEBUG_LIBRARIES)
-- Only the Intel TBB (release) libraries were found
You have called ADD_LIBRARY for library flann_cuda without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Install prefix: /opt/surfscan-dev/depend/install/flann-1.7.1
-- Build type: Release
-- Building C bindings: OFF
-- Building python bindings: OFF
-- Building matlab bindings: OFF
-- Building CUDA library: ON
-- Using MPI support: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/surfscan-dev/depend/build/flann-1.7.1
```

make install output:

```
[ 14%] Scanning dependencies of target flann_cpp_s
Building NVCC (Device) object src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/./flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o
Scanning dependencies of target flann_cpp-gd
Scanning dependencies of target flann_cpp_s-gd
[ 28%] Building CXX object src/cpp/CMakeFiles/flann_cpp_s.dir/flann/flann_cpp.cpp.o
[ 42%] Building CXX object src/cpp/CMakeFiles/flann_cpp-gd.dir/flann/flann_cpp.cpp.o
[ 57%] Linking CXX static library ../../lib/libflann_cpp_s.a
No such file or directory
Building CXX object src/cpp/CMakeFiles/flann_cpp_s-gd.dir/flann/flann_cpp.cpp.o
CMake Error at flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o.cmake:198 (message):
Error generating
/opt/surfscan-dev/depend/build/flann-1.7.1/src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/./flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o

make[2]: *** [src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/./flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o] Error 1
Linking CXX shared library ../../lib/libflann_cpp-gd.so
make[1]: *** [src/cpp/CMakeFiles/flann_cuda_s.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 57%] Built target flann_cpp_s
Linking CXX static library ../../lib/libflann_cpp_s-gd.a
[ 57%] Built target flann_cpp_s-gd
[ 57%] Built target flann_cpp-gd
make: *** [all] Error 2
```