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)

Posted on Sep 8, 2011 9:10 PM

Reply
7 replies

Sep 10, 2011 7:44 PM in response to etresoft

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

Sep 12, 2011 1:00 PM in response to yifli

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.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

error: identifier "__builtin_bswap32" is undefined

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.