error: identifier "__builtin_bswap32" is undefined
I had this error when compiling cuda code.
I'm using Lion and Xcode 4.1. Cuda driver version is 4.0.50
Any help is highly appreicated. thanks
Yifei
MacBookPro6,2, Mac OS X (10.7.1)
I had this error when compiling cuda code.
I'm using Lion and Xcode 4.1. Cuda driver version is 4.0.50
Any help is highly appreicated. thanks
Yifei
MacBookPro6,2, Mac OS X (10.7.1)
Make sure you are using the old GCC compiler with this code. It looks like cuda is assuming the presence of GCC and that is no longer guaranteed on MacOS X.
Thanks. But where is the old GCC located and how do I force Lion to use it?
It is located in the same place as the other compilers. That isn't important. Just change it in the build settings to "GCC 4.2".
ok, I've made cmake to use "g++-4.2", which can be seen from below:
-- Check for working CXX compiler: /usr/bin/g++-4.2
-- Check for working CXX compiler: /usr/bin/g++-4.2 -- works
I double checked the above output is different from before, which was
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
But the problem persists:
/usr/local/cuda/bin/nvcc ~/vecadd.** -c -o ~/cuda_test/./cudaTest_generated_vecadd.**.o -m64 -Xcompiler ,\"-g\" -DNVCC -I/usr/local/cuda/include -I/usr/local/cuda/include
/usr/include/libkern/i386/_OSByteOrder.h(60): error: identifier "__builtin_bswap32" is undefined
/usr/include/libkern/i386/_OSByteOrder.h(74): error: identifier "__builtin_bswap64" is undefined
Where did you get those kernel sources? Those are ancient. What OS are you planning to deploy on? That is the kernel version you need to build against.
etresoft,
I just want to be able to run some cuda examples on my own machine. I have no clue where those kernel sources are from. It's cuda compiler 'nvcc' that decides to use them.
Where are the correct kernel sources should be used then?
yifli wrote:
I just want to be able to run some cuda examples on my own machine. I have no clue where those kernel sources are from.
I suggest you find out.
Where are the correct kernel sources should be used then?
That depends on what you want to do. If you just want examples on your own machine. Get the matching xnu sources from Apple. Hopefully cuda will be compatible. The fact that it ships with and installs something that is years old isn't a good sign.
error: identifier "__builtin_bswap32" is undefined