CV_XADD breaks build in OSX10.9 Maverick + CUDA + clang (Bug #3469)
Description
Since OSX10.9 gcc is completely removed as system compiler so CUDA_HOST_COMPILER now has to be /usr/bin/clang.
Although this doesn't give the dumpspecs problem, compilation of cuda files still doesn't work (noticed on gpu_mat.cu as the first to be compiled).
As Clang is used, CV_XADD now resolves to be defined as __c11_atomic_fetch_add, which does not seem to work well with mvcc:
/Users/*/src/opencv/modules/core/include/opencv2/core/cvstd.hpp(451): error: type name is not allowed
/Users/*/src/opencv/modules/core/include/opencv2/core/cvstd.hpp(451): error: identifier "_Atomic" is undefined
/Users/*/src/opencv/modules/core/include/opencv2/core/cvstd.hpp(451): error: expected an expression
/Users/*/src/opencv/modules/core/include/opencv2/core/cvstd.hpp(451): error: identifier "__c11_atomic_fetch_add" is undefined
(plus a number of similar errors in different files)
A local workaround to use CV_XADD as __sync_fetch_and_add, instead does solve the problem.
Additional compiler info:
clang -v
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
/usr/local/cuda/bin/nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2013 NVIDIA Corporation
Built on Thu_Sep__5_10:17:14_PDT_2013
Cuda compilation tools, release 5.5, V5.5.0
Related issues
related to Bug #3911: Cannot use OpenCV 2.4.9 in a CUDA 6 project with nvcc com... | Done | 2014-07-27 |
Associated revisions
Fix for bug #3469 CV_XADD failing in clang+nvcc combination
Fix for bug #3469 CV_XADD failing in clang+nvcc combination
Taken from 3f0765523113ae7fc1b300f27dd78c642bb2b6c7
Merge pull request #3469 from a-wi:Fill_ellipse_arc_v3
History
Updated by Miroslav Kobetski about 11 years ago
Submitted a pull request for a small fix, that solved the problem for me.
Updated by Anna Kogan about 11 years ago
Miroslav, thank you for solving the issue!
- Status changed from New to Done
Updated by Anna Kogan about 11 years ago
- Assignee changed from Roman Donchenko to Miroslav Kobetski