anand
July 10, 2009, 12:23am
1
i get this error when tryihng to compile a simple cuda file on a fc11 box with nvcc v2.2:
% nvcc -I/usr/local/cuda/include -o helloworld.o -c helloworld.cu
/usr/lib/gcc/x86_64-redhat-linux/4.4.0/…/…/…/…/include/c++/4.4.0/ext/atomicity.h(50): error: identifier “__sync_fetch_and_add” is undefined
% nvcc --version
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2009 NVIDIA Corporation
Built on Thu_Apr__9_05:05:52_PDT_2009
Cuda compilation tools, release 2.2, V0.2.1221
any pointers much appreciated! thanks in advance!
Fedora 11 is not currently supported. Does this reproduce on a support Linux distribution?
anand
July 10, 2009, 6:00pm
3
True its not ‘really’ supported, but using this compiler option gets it going nicely (all examples work now): (mentioned here as well: http://forums.nvidia.com/index.php?showtopic=99139)
nvcc --compiler-bindir=/tmp/gcc3.4
The latest Ubuntu 9.10 installs GCC 4.4. This then causes the same “__sync_fetch_and_add” is undefined error as above… likely due to the GCC change and not the OS change.
Ubuntu 9.04 with GCC 4.3 had no problems.