Hi,
according to the nvcc man-page, there is a optimization flag (–optimize or -O). My code compiles fine if I don’t use any optimization flags, or set them to --optimize 0. However, when I try to use the optimizer flags (–optimize 2), I get compile errors such as these below:
/usr/include/string.h:43: error: inline function ‘void* memcpy(void*, const void*, size_t)’ cannot be declared weak
/usr/include/bits/string3.h:49: error: inline function ‘void* memcpy(void*, const void*, size_t)’ cannot be declared weak
/usr/local/cuda/bin/…/include/math_functions.h:422: error: inline function ‘int __signbit(double)’ cannot be declared weak
/usr/include/bits/mathcalls.h:350: error: inline function ‘int __signbit(double)’ cannot be declared weak
My complete nvcc command looks as follows: nvcc -c -arch sm_13 --ptxas-options=-v -m64 --optimize 2
Any ideas what is causing these compilation errors, and how to get around them (while still using nvcc optimization)? Any help is greatly appreciated!
Thanks,
Michael