<div dir="ltr">That seems to have fixed the problem.<div><br></div><div>Thanks,</div><div><br></div><div>--Vijay</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 28, 2017 at 5:26 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In include/<a href="http://gambit.h.in" rel="noreferrer" target="_blank">gambit.h.in</a> could you use<br>
<br>
#ifdef __GNUC__<br>
#if (__GNUC__*10000+__GNUC_MINOR__<wbr>*100+__GNUC_PATCHLEVEL__)><wbr>50000<br>
#define ___USE_builtin_op_overflow<br>
#endif<br>
#endif<br>
<br>
and let me know if this works for you?<br>
<br>
Note the >50000 test rather than >=50000.<br>
<span class="HOEnZb"><font color="#888888"><br>
Marc<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> On Jun 28, 2017, at 7:47 AM, Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:<br>
><br>
> Hmmm…<br>
><br>
> I think the test #if __GNUC__ >= 5 is incorrect… probably the support for those builtins started at some minor version of the major version 5. I’ll dig to see when they appeared and fix the test.  If you can’t wait, just change the 5 by 6.<br>
><br>
> Marc<br>
><br>
><br>
><br>
>> On Jun 28, 2017, at 7:31 AM, Vijay Mathew <<a href="mailto:vijay.the.lisper@gmail.com">vijay.the.lisper@gmail.com</a>> wrote:<br>
>><br>
>> $ gcc -v<br>
>><br>
>> Using built-in specs.<br>
>> COLLECT_GCC=gcc<br>
>> COLLECT_LTO_WRAPPER=/usr/<wbr>local/libexec/gcc/x86_64-<wbr>apple-darwin14.0.0/5.0.0/lto-<wbr>wrapper<br>
>> Target: x86_64-apple-darwin14.0.0<br>
>> Configured with: ../gcc-5-20141005/configure --enable-languages=c++,fortran<br>
>> Thread model: posix<br>
>> gcc version 5.0.0 20141005 (experimental) (GCC)<br>
>><br>
>> On Wed, Jun 28, 2017 at 12:22 PM, Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:<br>
>> Please do a “gcc -v”.  The __builtin_add_overflow should be predefined by gcc so it is strange that it is not found.  This should be true of the LLVM gcc and the GNU gcc.  Moreover, there is a test in include/<a href="http://gambit.h.in" rel="noreferrer" target="_blank">gambit.h.in</a> to check if it can be used:<br>
>><br>
>> #ifdef __GNUC__<br>
>> #if __GNUC__ >= 5<br>
>> #define ___USE_builtin_op_overflow<br>
>> #endif<br>
>> #endif<br>
>><br>
>> #ifdef __clang__<br>
>> #if __has_builtin(__builtin_add_<wbr>overflow) && __has_builtin(__builtin_sub_<wbr>overflow) && __has_builtin(__builtin_mul_<wbr>overflow)<br>
>> #define ___USE_builtin_op_overflow<br>
>> #endif<br>
>> #endif<br>
>><br>
>> Marc<br>
>><br>
>><br>
>><br>
>>> On Jun 28, 2017, at 1:18 AM, Vijay Mathew <<a href="mailto:vijay.the.lisper@gmail.com">vijay.the.lisper@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi,<br>
>>><br>
>>> I am trying to build the latest development source (gambit-v4_8_8-devel) on Mac OS X (darwin14.5.0). I am running into the following error while configuring the source:<br>
>>><br>
>>> In file included from _num.c:705:0:<br>
>>> _num.c: In function ‘long int ___H__20___num(___processor_<wbr>state)’:<br>
>>> ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not declared in this scope<br>
>>> #define ___FIXADDP(x,y)(___EXPECT_<wbr>FALSE(__builtin_add_overflow((<wbr>___WORD)(x),(___WORD)(y),&___<wbr>temp))?___FAL:___temp)<br>
>>>                                                                                                  ^<br>
>>> ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’<br>
>>> #define ___SET_R3(val)___R3=(val);<br>
>>>                              ^<br>
>>> ../include/gambit.h:2880:25: note: in expansion of macro ‘___EXPECT_FALSE’<br>
>>> #define ___FIXADDP(x,y)(___EXPECT_<wbr>FALSE(__builtin_add_overflow((<wbr>___WORD)(x),(___WORD)(y),&___<wbr>temp))?___FAL:___temp)<br>
>>>                         ^<br>
>>> _num.c:22107:14: note: in expansion of macro ‘___FIXADDP’<br>
>>>    ___SET_R3(___FIXADDP(___R1,___<wbr>R2))<br>
>>>              ^<br>
>>> ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not declared in this scope<br>
>>> #define ___FIXMULP(x,y)(___EXPECT_<wbr>FALSE(__builtin_mul_overflow((<wbr>___WORD)(x),___INT(y),&___<wbr>temp))?___FAL:___temp)<br>
>>>                                                                                               ^<br>
>>> ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’<br>
>>> #define ___SET_R3(val)___R3=(val);<br>
>>>                              ^<br>
>>> ../include/gambit.h:2890:25: note: in expansion of macro ‘___EXPECT_FALSE’<br>
>>> #define ___FIXMULP(x,y)(___EXPECT_<wbr>FALSE(__builtin_mul_overflow((<wbr>___WORD)(x),___INT(y),&___<wbr>temp))?___FAL:___temp)<br>
>>>                         ^<br>
>>> _num.c:22698:14: note: in expansion of macro ‘___FIXMULP’<br>
>>>    ___SET_R3(___FIXMULP(___R1,___<wbr>R2))<br>
>>>              ^<br>
>>> ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not declared in this scope<br>
>>> #define ___FIXSUBP(x,y)(___EXPECT_<wbr>FALSE(__builtin_sub_overflow((<wbr>___WORD)(x),(___WORD)(y),&___<wbr>temp))?___FAL:___temp)<br>
>>>                                                                                                  ^<br>
>>> ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’<br>
>>> #define ___SET_R3(val)___R3=(val);<br>
>>>                              ^<br>
>>> ../include/gambit.h:2907:25: note: in expansion of macro ‘___EXPECT_FALSE’<br>
>>> #define ___FIXSUBP(x,y)(___EXPECT_<wbr>FALSE(__builtin_sub_overflow((<wbr>___WORD)(x),(___WORD)(y),&___<wbr>temp))?___FAL:___temp)<br>
>>>                         ^<br>
>>> _num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’<br>
>>>    ___SET_R3(___FIXSUBP(___R1,___<wbr>R2))<br>
>>>              ^<br>
>>><br>
>>> The complete configure command is:<br>
>>><br>
>>> ./configure --enable-single-host --enable-multiple-threaded-vms --bindir=${MY_HOME}/platform/<wbr>gsc/bin --includedir=${MY_HOME}/<wbr>platform/gsc/include --libdir=${MY_HOME}/platform/<wbr>gsc/lib<br>
>>><br>
>>> If the `--enable-multiple-threaded-<wbr>vms` option is removed, I get a different error:<br>
>>><br>
>>> gcc -Wno-unused -Wno-write-strings -O1 -fwrapv -fno-strict-aliasing -fno-trapping-math -fno-math-errno -fschedule-insns2 -fomit-frame-pointer -fPIC -fno-common -mieee-fp -mpc64    -I"../include"  -o "gsi"    _gsi.o _gsi_.o "../lib/libgambit.a"  libgambitgsi.a<br>
>>> Undefined symbols for architecture x86_64:<br>
>>>  "___builtin_add_overflow", referenced from:<br>
>>>      ____H__20___num in libgambit.a(_num.o)<br>
>>>      ____H__20___system in libgambit.a(_system.o)<br>
>>>  "___builtin_mul_overflow", referenced from:<br>
>>>      ____H__20___num in libgambit.a(_num.o)<br>
>>>  "___builtin_sub_overflow", referenced from:<br>
>>>      ____H__20___num in libgambit.a(_num.o)<br>
>>> ld: symbol(s) not found for architecture x86_64<br>
>>><br>
>>> What am I doing wrong?<br>
>>><br>
>>> Thanks,<br>
>>><br>
>>> --Vijay<br>
>>> ______________________________<wbr>_________________<br>
>>> Gambit-list mailing list<br>
>>> <a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
>>> <a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.<wbr>ca/mailman/listinfo/gambit-<wbr>list</a><br>
>><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>