kuhnmi  
                
                  
                    September 17, 2010, 12:39pm
                   
                  1 
               
             
            
              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
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
             
            
              
            
           
          
            
              
                hufo  
              
                  
                    September 22, 2010,  6:15am
                   
                  2 
               
             
            
              Hi,
These errors can appear when using gcc 4.4+
Jeremie.
             
            
              
            
           
          
            
              
                hufo  
              
                  
                    September 22, 2010,  6:15am
                   
                  3 
               
             
            
              Hi,
These errors can appear when using gcc 4.4+
Jeremie.
             
            
              
            
           
          
            
              
                kuhnmi  
              
                  
                    September 22, 2010,  5:55pm
                   
                  4 
               
             
            
              Thanks for your suggestions.
I’m using gcc-4.3 (i.e. < gcc-4.4). I also tried the suggested flags. They reduced the number of errors from
/usr/include/string.h:43: error: inline function ‘void* memcpy(void*, const void*, size_t)’ cannot be declared weak
to
/usr/include/string.h:43: error: inline function ‘void* memcpy(void*, const void*, size_t)’ cannot be declared weak
Any ideas how I can get rid of these?? I don’t use memcpy or memset in my device code, and I also don’t use them in my .cu and .cuh files.
Thanks for any hints!
             
            
              
            
           
          
            
              
                kuhnmi  
              
                  
                    September 22, 2010,  5:55pm
                   
                  5 
               
             
            
              Thanks for your suggestions.
I’m using gcc-4.3 (i.e. < gcc-4.4). I also tried the suggested flags. They reduced the number of errors from
/usr/include/string.h:43: error: inline function ‘void* memcpy(void*, const void*, size_t)’ cannot be declared weak
to
/usr/include/string.h:43: error: inline function ‘void* memcpy(void*, const void*, size_t)’ cannot be declared weak
Any ideas how I can get rid of these?? I don’t use memcpy or memset in my device code, and I also don’t use them in my .cu and .cuh files.
Thanks for any hints!