DeepGraphLearning / graphvite

GraphVite: A General and High-performance Graph Embedding System
https://graphvite.io
Apache License 2.0
1.21k stars 151 forks source link

nvcc fatal: redefinition of argument 'std' #75

Closed mginabluebox closed 3 years ago

mginabluebox commented 3 years ago

Hi,

I was building graphvite from source but met the following errors during make:

[ 50%] Building CUDA object src/CMakeFiles/graphvite.dir/graphvite.cu.o
cd /scratch/tj810/gvl_project/graphvite/build/src && /share/apps/cuda/10.1.105/bin/nvcc  -Dgraphvite_EXPORTS -I/scratch/tj810/gvl_project/env/include -I/scratch/tj810/gvl_project/env/lib/python3.7/site-packages -I/scratch/tj810/gvl_project/env/include/python3.7m -I/scratch/tj810/gvl_project/graphvite/include -std=c++11 -gencode arch=compute_70,code=sm_70 -O3 -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -Xcompiler=-fno-fat-lto-objects -std=c++03 -x cu -c /scratch/tj810/gvl_project/graphvite/src/graphvite.cu -o CMakeFiles/graphvite.dir/graphvite.cu.o
nvcc fatal   : redefinition of argument 'std'
make[2]: *** [src/CMakeFiles/graphvite.dir/graphvite.cu.o] Error 1
make[2]: Leaving directory `/scratch/tj810/gvl_project/graphvite/build'
make[1]: *** [src/CMakeFiles/graphvite.dir/all] Error 2
make[1]: Leaving directory `/scratch/tj810/gvl_project/graphvite/build'
make: *** [all] Error 2

Thanks in advance!

Edit: I was able to get rid of this error by commenting out CMAKE_CUDA_FLAGS line setting -std=c++11. However, I got a new error at the end of make :

[100%] Linking CUDA shared library ../lib/libgraphvite.so
/usr/bin/ld: cannot find -lfaiss
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libgraphvite.so] Error 1
make[1]: *** [src/CMakeFiles/graphvite.dir/all] Error 2
make: *** [all] Error 2

I was building without faiss using the -DNO_FAISS option for cmake.

KiddoZhu commented 3 years ago

Sorry for the very late reply.

This is a bug in CMakeLists.txt. You can remove faiss.so from target link libraries in src/CMakeLists.txt. It should work.

KiddoZhu commented 3 years ago

Fixed in https://github.com/DeepGraphLearning/graphvite/commit/e067c59146f676e3eee3eee6106dce7ccc7cf9e4

mginabluebox commented 3 years ago

Thank you! I ended up successfully installing through conda on a better computing system but happy to see the bug's fixed.