Re: Error calling __builtin_expect inside omp parallel for?
Re: Error calling __builtin_expect inside omp parallel for?
- Subject: Re: Error calling __builtin_expect inside omp parallel for?
- From: Stonewall Ballard <email@hidden>
- Date: Wed, 26 Oct 2011 11:23:16 -0400
The extra "_" is prepended by the compiler, so the linker reports it that way. See <http://stackoverflow.com/questions/2627511/why-do-c-compilers-prepend-underscores-to-external-names>. The name used in the code has two leading underscores.
- Stoney
On Oct 25, 2011, at 11:31 AM, Bayes Scott F wrote:
> Stoney,
>
> In the first and last reference to __builtin_expect in your email below, you start it with 3 "_" chars, and in the 2nd and 3rd you use 2. The sample code I found in Apple's docset contains 2, as I'd expect. Are these typos in your email, or in the code?
>
> ScottB
>
> On Oct 24, 2011, at 14:05 , Stonewall Ballard wrote:
>
>> In Xcode 4.2 on OS X 10.7.2, I've been intermittently getting an "Undefined Symbol" linker error for "___builtin_expect", caused by a use of __builtin_expect inside the standard "assert" macro, inside an "omp parallel for" block. I'm using the LLVM GCC 4.2 compiler.
>>
>> I can explicitly use __builtin_expect outside of the parallel block and it works, but inside the block, it causes this undefined symbol error most of the time.
>>
>> The actual error is:
>> ------
>> Undefined symbols for architecture x86_64:
>> "___builtin_expect", referenced from:
>> __ZN2cvL19bilateralFilter_32fERKNS_3MatERS0_iddiPNS_16ProgressReporterE.omp_fn.0 in smooth.o
>> ld: symbol(s) not found for architecture x86_64
>> collect2: ld returned 1 exit status
>> ------
>>
>> FWIW, I'm compiling a modified version of the OpenCV bilateralFilter.
>>
>> Any idea why this is happening?
>>
>> Thanks.
>>
>> - Stoney
>>
>> --
--
Stonewall Ballard
email@hidden http://stoney.sb.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden