ankurhanda / gvnn

gvnn: Geometric Vision with Neural Networks
445 stars 71 forks source link

How to install the package? Building NVCC (Device) object CMakeFiles fund some error. #21

Closed ixiaoli closed 6 years ago

ixiaoli commented 6 years ago

hi,@ankurhanda , The following is the output after command "luarocks make gvnn-scm-1.rockspec" cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/hpj/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/hpj/torch/install/lib/luarocks/rocks/gvnn/scm-1" && make

-- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Torch7 in /home/hpj/torch/install -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Found OpenMP: -fopenmp -- Compiling with OpenMP support -- Found CUDA: /usr (found suitable version "7.5", minimum required is "4.0") -- Configuring done -- Generating done -- Build files have been written to: /home/hpj/gvnn/build Scanning dependencies of target gvnn [ 25%] Building C object CMakeFiles/gvnn.dir/init.c.o [ 50%] Linking C shared module libgvnn.so [ 50%] Built target gvnn [ 75%] Building NVCC (Device) object CMakeFiles/cugvnn.dir/cugvnn_generated_init.cu.o /usr/include/string.h: In function ‘void __mempcpy_inline(void, const void, size_t)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char ) memcpy (dest, src, n) + n; ^ CMake Error at cugvnn_generated_init.cu.o.cmake:267 (message): Error generating file /home/hpj/gvnn/build/CMakeFiles/cugvnn.dir//./cugvnn_generated_init.cu.o

CMakeFiles/cugvnn.dir/build.make:63: recipe for target 'CMakeFiles/cugvnn.dir/cugvnn_generated_init.cu.o' failed make[2]: [CMakeFiles/cugvnn.dir/cugvnn_generated_init.cu.o] Error 1 CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/cugvnn.dir/all' failed make[1]: [CMakeFiles/cugvnn.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

Error: Build error: Failed building. THX~

ankurhanda commented 6 years ago

Did you google it? https://github.com/BVLC/caffe/issues/4046

ixiaoli commented 6 years ago

hi!@ankurhanda I add that flag to my CMakeLists.txt it fixed the problem and compiles fine. ie. Add this near the front: set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} \"-D_FORCE_INLINES\" ") thank you!