Hi,
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:
In file included from _num.c:705:0: _num.c: In function ‘long int ___H__20___num(___processor_state)’: ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not declared in this scope #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2880:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:22107:14: note: in expansion of macro ‘___FIXADDP’ ___SET_R3(___FIXADDP(___R1,___R2)) ^ ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not declared in this scope #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp)
^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2890:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ _num.c:22698:14: note: in expansion of macro ‘___FIXMULP’ ___SET_R3(___FIXMULP(___R1,___R2)) ^ ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not declared in this scope #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2907:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’ ___SET_R3(___FIXSUBP(___R1,___R2)) ^
The complete configure command is:
./configure --enable-single-host --enable-multiple-threaded-vms --bindir=${MY_HOME}/platform/gsc/bin --includedir=${MY_HOME}/platform/gsc/include --libdir=${MY_HOME}/platform/gsc/lib
If the `--enable-multiple-threaded-vms` option is removed, I get a different error:
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 Undefined symbols for architecture x86_64: "___builtin_add_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ____H__20___system in libgambit.a(_system.o) "___builtin_mul_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) "___builtin_sub_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ld: symbol(s) not found for architecture x86_64
What am I doing wrong?
Thanks,
--Vijay
Afficher les réponses par date
This works:
162 1:39 git clone https://github.com/gambit/gambit.git 163 1:44 cd gambit 164 1:44 ./configure 165 1:45 make -j4 current-gsc-boot 167 1:51 ./configure --enable-single-host --enable-multiple-threaded-vms --enable-prefix=/User/lucier/local/ 168 1:51 make -j4 from-scratch 169 1:58 make -j4 doc 170 1:59 make check 171 2:00 history [Bradley-Luciers-MacBook-Pro:~/programs/gambit] lucier% uname -a Darwin Bradley-Luciers-MacBook-Pro.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64 [Bradley-Luciers-MacBook-Pro:~/programs/gambit] lucier% gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/gcc-7.1.0/libexec/gcc/x86_64-apple-darwin16.5.0/7.1.0/lto-wrapper Target: x86_64-apple-darwin16.5.0 Configured with: ../../gcc-7.1.0/configure --prefix=/usr/local/gcc-7.1.0 Thread model: posix gcc version 7.1.0 (GCC)
So, different OS version and (maybe) different version of gcc (and the —enable-prefix was a mistake), but … did you try these steps?
Brad
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/gambit.h.in to check if it can be used:
#ifdef __GNUC__ #if __GNUC__ >= 5 #define ___USE_builtin_op_overflow #endif #endif
#ifdef __clang__ #if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow) #define ___USE_builtin_op_overflow #endif #endif
Marc
On Jun 28, 2017, at 1:18 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
Hi,
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:
In file included from _num.c:705:0: _num.c: In function ‘long int ___H__20___num(___processor_state)’: ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not declared in this scope #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2880:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:22107:14: note: in expansion of macro ‘___FIXADDP’ ___SET_R3(___FIXADDP(___R1,___R2)) ^ ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not declared in this scope #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2890:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ _num.c:22698:14: note: in expansion of macro ‘___FIXMULP’ ___SET_R3(___FIXMULP(___R1,___R2)) ^ ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not declared in this scope #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2907:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’ ___SET_R3(___FIXSUBP(___R1,___R2)) ^
The complete configure command is:
./configure --enable-single-host --enable-multiple-threaded-vms --bindir=${MY_HOME}/platform/gsc/bin --includedir=${MY_HOME}/platform/gsc/include --libdir=${MY_HOME}/platform/gsc/lib
If the `--enable-multiple-threaded-vms` option is removed, I get a different error:
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 Undefined symbols for architecture x86_64: "___builtin_add_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ____H__20___system in libgambit.a(_system.o) "___builtin_mul_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) "___builtin_sub_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ld: symbol(s) not found for architecture x86_64
What am I doing wrong?
Thanks,
--Vijay _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
$ gcc -v
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/5.0.0/lto-wrapper Target: x86_64-apple-darwin14.0.0 Configured with: ../gcc-5-20141005/configure --enable-languages=c++,fortran Thread model: posix gcc version 5.0.0 20141005 (experimental) (GCC)
On Wed, Jun 28, 2017 at 12:22 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
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/gambit.h.in to check if it can be used:
#ifdef __GNUC__ #if __GNUC__ >= 5 #define ___USE_builtin_op_overflow #endif #endif
#ifdef __clang__ #if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow) #define ___USE_builtin_op_overflow #endif #endif
Marc
On Jun 28, 2017, at 1:18 AM, Vijay Mathew vijay.the.lisper@gmail.com
wrote:
Hi,
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:
In file included from _num.c:705:0: _num.c: In function ‘long int ___H__20___num(___processor_state)’: ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not
declared in this scope
#define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2880:25: note: in expansion of macro
‘___EXPECT_FALSE’
#define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
_num.c:22107:14: note: in expansion of macro ‘___FIXADDP’ ___SET_R3(___FIXADDP(___R1,___R2)) ^ ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not
declared in this scope
#define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((
___WORD)(x),___INT(y),&___temp))?___FAL:___temp)
^
../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2890:25: note: in expansion of macro
‘___EXPECT_FALSE’
#define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((
___WORD)(x),___INT(y),&___temp))?___FAL:___temp)
^
_num.c:22698:14: note: in expansion of macro ‘___FIXMULP’ ___SET_R3(___FIXMULP(___R1,___R2)) ^ ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not
declared in this scope
#define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2907:25: note: in expansion of macro
‘___EXPECT_FALSE’
#define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
_num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’ ___SET_R3(___FIXSUBP(___R1,___R2)) ^
The complete configure command is:
./configure --enable-single-host --enable-multiple-threaded-vms
--bindir=${MY_HOME}/platform/gsc/bin --includedir=${MY_HOME}/platform/gsc/include --libdir=${MY_HOME}/platform/gsc/lib
If the `--enable-multiple-threaded-vms` option is removed, I get a
different error:
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
Undefined symbols for architecture x86_64: "___builtin_add_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ____H__20___system in libgambit.a(_system.o) "___builtin_mul_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) "___builtin_sub_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ld: symbol(s) not found for architecture x86_64
What am I doing wrong?
Thanks,
--Vijay _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Hmmm…
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.
Marc
On Jun 28, 2017, at 7:31 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
$ gcc -v
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/5.0.0/lto-wrapper Target: x86_64-apple-darwin14.0.0 Configured with: ../gcc-5-20141005/configure --enable-languages=c++,fortran Thread model: posix gcc version 5.0.0 20141005 (experimental) (GCC)
On Wed, Jun 28, 2017 at 12:22 PM, Marc Feeley feeley@iro.umontreal.ca wrote: 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/gambit.h.in to check if it can be used:
#ifdef __GNUC__ #if __GNUC__ >= 5 #define ___USE_builtin_op_overflow #endif #endif
#ifdef __clang__ #if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow) #define ___USE_builtin_op_overflow #endif #endif
Marc
On Jun 28, 2017, at 1:18 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
Hi,
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:
In file included from _num.c:705:0: _num.c: In function ‘long int ___H__20___num(___processor_state)’: ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not declared in this scope #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2880:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:22107:14: note: in expansion of macro ‘___FIXADDP’ ___SET_R3(___FIXADDP(___R1,___R2)) ^ ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not declared in this scope #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2890:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ _num.c:22698:14: note: in expansion of macro ‘___FIXMULP’ ___SET_R3(___FIXMULP(___R1,___R2)) ^ ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not declared in this scope #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2907:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’ ___SET_R3(___FIXSUBP(___R1,___R2)) ^
The complete configure command is:
./configure --enable-single-host --enable-multiple-threaded-vms --bindir=${MY_HOME}/platform/gsc/bin --includedir=${MY_HOME}/platform/gsc/include --libdir=${MY_HOME}/platform/gsc/lib
If the `--enable-multiple-threaded-vms` option is removed, I get a different error:
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 Undefined symbols for architecture x86_64: "___builtin_add_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ____H__20___system in libgambit.a(_system.o) "___builtin_mul_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) "___builtin_sub_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ld: symbol(s) not found for architecture x86_64
What am I doing wrong?
Thanks,
--Vijay _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
In include/gambit.h.in could you use
#ifdef __GNUC__ #if (__GNUC__*10000+__GNUC_MINOR__*100+__GNUC_PATCHLEVEL__)>50000 #define ___USE_builtin_op_overflow #endif #endif
and let me know if this works for you?
Note the >50000 test rather than >=50000.
Marc
On Jun 28, 2017, at 7:47 AM, Marc Feeley feeley@iro.umontreal.ca wrote:
Hmmm…
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.
Marc
On Jun 28, 2017, at 7:31 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
$ gcc -v
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/5.0.0/lto-wrapper Target: x86_64-apple-darwin14.0.0 Configured with: ../gcc-5-20141005/configure --enable-languages=c++,fortran Thread model: posix gcc version 5.0.0 20141005 (experimental) (GCC)
On Wed, Jun 28, 2017 at 12:22 PM, Marc Feeley feeley@iro.umontreal.ca wrote: 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/gambit.h.in to check if it can be used:
#ifdef __GNUC__ #if __GNUC__ >= 5 #define ___USE_builtin_op_overflow #endif #endif
#ifdef __clang__ #if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow) #define ___USE_builtin_op_overflow #endif #endif
Marc
On Jun 28, 2017, at 1:18 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
Hi,
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:
In file included from _num.c:705:0: _num.c: In function ‘long int ___H__20___num(___processor_state)’: ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not declared in this scope #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2880:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:22107:14: note: in expansion of macro ‘___FIXADDP’ ___SET_R3(___FIXADDP(___R1,___R2)) ^ ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not declared in this scope #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2890:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ _num.c:22698:14: note: in expansion of macro ‘___FIXMULP’ ___SET_R3(___FIXMULP(___R1,___R2)) ^ ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not declared in this scope #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2907:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’ ___SET_R3(___FIXSUBP(___R1,___R2)) ^
The complete configure command is:
./configure --enable-single-host --enable-multiple-threaded-vms --bindir=${MY_HOME}/platform/gsc/bin --includedir=${MY_HOME}/platform/gsc/include --libdir=${MY_HOME}/platform/gsc/lib
If the `--enable-multiple-threaded-vms` option is removed, I get a different error:
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 Undefined symbols for architecture x86_64: "___builtin_add_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ____H__20___system in libgambit.a(_system.o) "___builtin_mul_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) "___builtin_sub_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ld: symbol(s) not found for architecture x86_64
What am I doing wrong?
Thanks,
--Vijay _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
That seems to have fixed the problem.
Thanks,
--Vijay
On Wed, Jun 28, 2017 at 5:26 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
In include/gambit.h.in could you use
#ifdef __GNUC__ #if (__GNUC__*10000+__GNUC_MINOR__*100+__GNUC_PATCHLEVEL__)>50000 #define ___USE_builtin_op_overflow #endif #endif
and let me know if this works for you?
Note the >50000 test rather than >=50000.
Marc
On Jun 28, 2017, at 7:47 AM, Marc Feeley feeley@iro.umontreal.ca
wrote:
Hmmm…
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.
Marc
On Jun 28, 2017, at 7:31 AM, Vijay Mathew vijay.the.lisper@gmail.com
wrote:
$ gcc -v
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-
apple-darwin14.0.0/5.0.0/lto-wrapper
Target: x86_64-apple-darwin14.0.0 Configured with: ../gcc-5-20141005/configure
--enable-languages=c++,fortran
Thread model: posix gcc version 5.0.0 20141005 (experimental) (GCC)
On Wed, Jun 28, 2017 at 12:22 PM, Marc Feeley feeley@iro.umontreal.ca
wrote:
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/ gambit.h.in to check if it can be used:
#ifdef __GNUC__ #if __GNUC__ >= 5 #define ___USE_builtin_op_overflow #endif #endif
#ifdef __clang__ #if __has_builtin(__builtin_add_overflow) &&
__has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_ overflow)
#define ___USE_builtin_op_overflow #endif #endif
Marc
On Jun 28, 2017, at 1:18 AM, Vijay Mathew vijay.the.lisper@gmail.com
wrote:
Hi,
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:
In file included from _num.c:705:0: _num.c: In function ‘long int ___H__20___num(___processor_state)’: ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not
declared in this scope
#define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2880:25: note: in expansion of macro
‘___EXPECT_FALSE’
#define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
_num.c:22107:14: note: in expansion of macro ‘___FIXADDP’ ___SET_R3(___FIXADDP(___R1,___R2)) ^ ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not
declared in this scope
#define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((
___WORD)(x),___INT(y),&___temp))?___FAL:___temp)
^
../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2890:25: note: in expansion of macro
‘___EXPECT_FALSE’
#define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((
___WORD)(x),___INT(y),&___temp))?___FAL:___temp)
^
_num.c:22698:14: note: in expansion of macro ‘___FIXMULP’ ___SET_R3(___FIXMULP(___R1,___R2)) ^ ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not
declared in this scope
#define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2907:25: note: in expansion of macro
‘___EXPECT_FALSE’
#define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((
___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp)
^
_num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’ ___SET_R3(___FIXSUBP(___R1,___R2)) ^
The complete configure command is:
./configure --enable-single-host --enable-multiple-threaded-vms
--bindir=${MY_HOME}/platform/gsc/bin --includedir=${MY_HOME}/platform/gsc/include --libdir=${MY_HOME}/platform/gsc/lib
If the `--enable-multiple-threaded-vms` option is removed, I get a
different error:
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
Undefined symbols for architecture x86_64: "___builtin_add_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ____H__20___system in libgambit.a(_system.o) "___builtin_mul_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) "___builtin_sub_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ld: symbol(s) not found for architecture x86_64
What am I doing wrong?
Thanks,
--Vijay _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Great! I think your version, i.e.
gcc version 5.0.0 20141005 (experimental) (GCC)
may be a prerelease of 5.0.0 (given it is “experimental”). Anyway, I’ll enable the builtin for >= 5.0.1 so that should work…
Marc
On Jun 28, 2017, at 8:11 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
That seems to have fixed the problem.
Thanks,
--Vijay
On Wed, Jun 28, 2017 at 5:26 PM, Marc Feeley feeley@iro.umontreal.ca wrote: In include/gambit.h.in could you use
#ifdef __GNUC__ #if (__GNUC__*10000+__GNUC_MINOR__*100+__GNUC_PATCHLEVEL__)>50000 #define ___USE_builtin_op_overflow #endif #endif
and let me know if this works for you?
Note the >50000 test rather than >=50000.
Marc
On Jun 28, 2017, at 7:47 AM, Marc Feeley feeley@iro.umontreal.ca wrote:
Hmmm…
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.
Marc
On Jun 28, 2017, at 7:31 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
$ gcc -v
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/5.0.0/lto-wrapper Target: x86_64-apple-darwin14.0.0 Configured with: ../gcc-5-20141005/configure --enable-languages=c++,fortran Thread model: posix gcc version 5.0.0 20141005 (experimental) (GCC)
On Wed, Jun 28, 2017 at 12:22 PM, Marc Feeley feeley@iro.umontreal.ca wrote: 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/gambit.h.in to check if it can be used:
#ifdef __GNUC__ #if __GNUC__ >= 5 #define ___USE_builtin_op_overflow #endif #endif
#ifdef __clang__ #if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow) #define ___USE_builtin_op_overflow #endif #endif
Marc
On Jun 28, 2017, at 1:18 AM, Vijay Mathew vijay.the.lisper@gmail.com wrote:
Hi,
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:
In file included from _num.c:705:0: _num.c: In function ‘long int ___H__20___num(___processor_state)’: ../include/gambit.h:2880:98: error: ‘__builtin_add_overflow’ was not declared in this scope #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2880:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXADDP(x,y)(___EXPECT_FALSE(__builtin_add_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:22107:14: note: in expansion of macro ‘___FIXADDP’ ___SET_R3(___FIXADDP(___R1,___R2)) ^ ../include/gambit.h:2890:95: error: ‘__builtin_mul_overflow’ was not declared in this scope #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2890:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXMULP(x,y)(___EXPECT_FALSE(__builtin_mul_overflow((___WORD)(x),___INT(y),&___temp))?___FAL:___temp) ^ _num.c:22698:14: note: in expansion of macro ‘___FIXMULP’ ___SET_R3(___FIXMULP(___R1,___R2)) ^ ../include/gambit.h:2907:98: error: ‘__builtin_sub_overflow’ was not declared in this scope #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ ../include/gambit.h:4296:30: note: in definition of macro ‘___SET_R3’ #define ___SET_R3(val)___R3=(val); ^ ../include/gambit.h:2907:25: note: in expansion of macro ‘___EXPECT_FALSE’ #define ___FIXSUBP(x,y)(___EXPECT_FALSE(__builtin_sub_overflow((___WORD)(x),(___WORD)(y),&___temp))?___FAL:___temp) ^ _num.c:23679:14: note: in expansion of macro ‘___FIXSUBP’ ___SET_R3(___FIXSUBP(___R1,___R2)) ^
The complete configure command is:
./configure --enable-single-host --enable-multiple-threaded-vms --bindir=${MY_HOME}/platform/gsc/bin --includedir=${MY_HOME}/platform/gsc/include --libdir=${MY_HOME}/platform/gsc/lib
If the `--enable-multiple-threaded-vms` option is removed, I get a different error:
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 Undefined symbols for architecture x86_64: "___builtin_add_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ____H__20___system in libgambit.a(_system.o) "___builtin_mul_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) "___builtin_sub_overflow", referenced from: ____H__20___num in libgambit.a(_num.o) ld: symbol(s) not found for architecture x86_64
What am I doing wrong?
Thanks,
--Vijay _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list