flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.23k stars 650 forks source link

Cannot compile 1.9.1 with CUDA support #350

Open archenroot opened 7 years ago

archenroot commented 7 years ago

Hi, I am using package on Gentoo system and getting:

[ 53%] Building C object src/cpp/CMakeFiles/flann_s.dir/flann/ext/lz4hc.c.o
cd /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp && /usr/bin/x86_64-pc-linux-gnu-gcc  -DFLANN_STATIC -D_FLANN_VERSION=1.9.1 -I/tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp -I/opt/cuda/include   -DNDEBUG -march=broadwell -O2 -pipe -fopenmp   -Wall -Wno-unknown-pragmas -Wno-unused-function -fPIC -o CMakeFiles/flann_s.dir/flann/ext/lz4.c.o -c /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp/flann/ext/lz4.c
-- Removing /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/./flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o
cd /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp && /usr/bin/x86_64-pc-linux-gnu-gcc  -DFLANN_STATIC -D_FLANN_VERSION=1.9.1 -I/tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp -I/opt/cuda/include   -DNDEBUG -march=broadwell -O2 -pipe -fopenmp   -Wall -Wno-unknown-pragmas -Wno-unused-function -fPIC -o CMakeFiles/flann_s.dir/flann/ext/lz4hc.c.o -c /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp/flann/ext/lz4hc.c
/usr/bin/cmake -E remove /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/./flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o
-- Generating dependency file: /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o.NVCC-depend
/opt/cuda/bin/nvcc -M -D__CUDACC__ /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu -o /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o.NVCC-depend -m64 --std c++11 -DFLANN_STATIC -D_FLANN_VERSION=1.9.1 -Xcompiler ,\"-march=broadwell\",\"-O2\",\"-pipe\",\"-fopenmp\" -O2 -v --compiler-bindir /usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0 --compiler-options "-march=broadwell -O2 -pipe" --linker-options -O1,--as-needed,--as-needed ,-arsch -DFLANN_USE_CUDA -Xcompiler -fPIC -DNVCC -I/opt/cuda/include -I/tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1/src/cpp
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc fatal   : A single input file is required for a non-link phase when an outputfile is specified
CMake Error at flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o.Gentoo.cmake:224 (message):
  Error generating
  /tmp/portage/sci-libs/flann-1.9.1/work/flann-1.9.1_build/src/cpp/CMakeFiles/flann_cuda_s.dir/flann/algorithms/./flann_cuda_s_generated_kdtree_cuda_3d_index.cu.o

Is this release really compatible with CUDA - I am on version 8.*

AurelienBallier commented 7 years ago

Hi,

It's not a problem from flann but from Gentoo ebuild, you can update your package at line 76: -DCUDA_NVCC_FLAGS="${NVCCFLAGS}",-arsch" To: -DCUDA_NVCC_FLAGS="${NVCCFLAGS} --linker-options \"-arsch\""

See Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=607062

See ya,

Amynka commented 6 years ago

Added in gentoo.