Hi, i tried to compiler FasterTransformer v3.0 in my CUDA 10.0 environment by delete code relay on CUDA 10.1. Howerver, i got error ‘nvcc fatal : redefinition of argument ‘std’’
I used command ‘make VERBOSE=1’ and find the comand is
cd /workdir/wangxiang27/FasterTransformer/DeepLearningExamples/FasterTransformer/v3.0/build/fastertransformer/cuda && /usr/local/cuda/bin/nvcc -I/workdir/wangxiang27/FasterTransformer/DeepLearningExamples/FasterTransformer/v3.0 -I/usr/local/cuda/include -I/usr/include/python3.6m -Xcompiler -Wall -gencode=arch=compute_75,code=\"sm_75,compute_75\" -rdc=true -DWMMA --expt-extended-lambda --expt-relaxed-constexpr --std=c++14 -O3 -DNDEBUG -Xcompiler -O3 -Xcompiler=-fPIC -std=c++14 -x cu -c /workdir/wangxiang27/FasterTransformer/DeepLearningExamples/FasterTransformer/v3.0/fastertransformer/cuda/topk_kernels.cu -o CMakeFiles/topk.dir/topk_kernels.cu.o
it seems --std=c++14 and -std=c++14 cause the problem
I checked the Cmakefiles:https://github.com/NVIDIA/DeepLearningExamples/blob/master/FasterTransformer/v3.0/CMakeLists.txt and https://github.com/NVIDIA/DeepLearningExamples/blob/master/FasterTransformer/v3.0/fastertransformer/cuda/CMakeLists.txt and find set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --std=c++${CXX_STD}")
in first CMakeLists.txt and i guess -std=c++14
come from second CMakeLists.txt in code:
add_library(topk STATIC ${topk_kernel_files})
set_property(TARGET topk PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET topk PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
target_link_libraries(topk PUBLIC -lcublas -lcudart -lcurand)
So, how can i slove this problem(-O3 also appear twice)? My environment is:
-
Centos 7
-
CUDA 10.0
-
Cmake 3.17.0-rc3
-
gcc 7.5.0
Thank you very much!