custom-op
custom-op copied to clipboard
nvcc fatal : Unknown option 'fPIC'
The following error is reported when compiling:
$make time_two_op
nvcc -std=c++11 -c -o tensorflow_time_two/python/ops/_time_two_ops.cu.o tensorflow_time_two/cc/kernels/time_two_kernels.cu.cc -I/usr/local/lib/python3.6/dist-packages/tensorflow_core/include -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -O2 -std=c++11 -L/usr/local/lib/python3.6/dist-packages/tensorflow_core -l:libtensorflow_framework.so.1 -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -DNDEBUG --expt-relaxed-constexpr nvcc fatal : Unknown option 'fPIC' Makefile:35: recipe for target 'tensorflow_time_two/python/ops/_time_two_ops.cu.o' failed make: *** [tensorflow_time_two/python/ops/_time_two_ops.cu.o] Error 1
This problem is also reproducible on my side.
# make time_two_test
2020-09-29 23:28:14.648088: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
2020-09-29 23:28:16.572897: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
nvcc -std=c++11 -c -o tensorflow_time_two/python/ops/_time_two_ops.cu.o tensorflow_time_two/cc/kernels/time_two_kernels.cu.cc -I/usr/local/lib/python3.6/dist-packages/tensorflow/include -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -O2 -std=c++11 -L/usr/local/lib/python3.6/dist-packages/tensorflow -l:libtensorflow_framework.so.2 -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -DNDEBUG --expt-relaxed-constexpr
nvcc fatal : Unknown option 'fPIC'
Makefile:35: recipe for target 'tensorflow_time_two/python/ops/_time_two_ops.cu.o' failed
make: *** [tensorflow_time_two/python/ops/_time_two_ops.cu.o] Error 1
nvcc -Xcompiler -std=*** is ok