C99 and GMP tuning

Dennis Clarke dclarke at blastwave.org
Mon Apr 16 16:25:08 UTC 2018


On 09/04/18 11:45 AM, Torbjörn Granlund wrote:
> sav_ix at ukr.net writes:
> 
>    Presumably this should lead to dropping support of old systems, which
>    compilers do not provide C99 support. On the other side, more recent
>    OSes provide better 'clock()' implementation, which accuracy
>    (depending of used OS) in times or magnitudes better, compared to
>    'getrusage()'.
> 
>    After moving to C99, can GMP Developers consider to drop use of non
>    portable 'getrusage()', 'rusage' etc. in favor of 'clock()'? The
>    advantage in addition to portability could be that the running time of
>    the tuning be shortened (need be verified).
> 
> This seems completely unrelated to C90 vs C99.


Well I was just surprised to see gmp fail to compile while using a 
strict C99 compiler ( Oracle Studio 12.6 C99 ) and with very run of
the mill CFLAGS.  This is a Fujitsu SPARC VII+ unit.


.
.
.
libtool: compile:  /opt/developerstudio12.6/bin/c99 -DHAVE_CONFIG_H -I. 
-I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_perfsqr -I/usr/local/include 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE 
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 
-xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc 
-g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-xarch=sparc -c perfsqr.c -o perfsqr.o >/dev/null 2>&1
/usr/local/bin/bash ../libtool  --tag=CC   --mode=compile 
/opt/developerstudio12.6/bin/c99 -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo perfpow | sed 's/_$//'` 
-I/usr/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
-D_LARGEFILE64_SOURCE  -errfmt=error -erroff=%none -errshort=full 
-xstrconst -xildoff -m64 -xmemalign=8s -xnolibmil -Xc -xcode=pic32 
-xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none 
-xdebugformat=dwarf -xunroll=1 -xarch=sparc -c -o perfpow.lo perfpow.c
libtool: compile:  /opt/developerstudio12.6/bin/c99 -DHAVE_CONFIG_H -I. 
-I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_perfpow -I/usr/local/include 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE 
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 
-xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc 
-g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-xarch=sparc -c perfpow.c  -KPIC -DPIC -o .libs/perfpow.o
"../gmp-impl.h", line 3701: warning:  attribute "mode" is unknown, ignored
"../gmp-impl.h", line 3702: warning:  attribute "mode" is unknown, ignored
"../gmp-impl.h", line 3703: warning:  attribute "mode" is unknown, ignored
"../gmp-impl.h", line 3704: warning:  attribute "mode" is unknown, ignored
"../gmp-impl.h", line 3705: warning:  attribute "mode" is unknown, ignored
libtool: compile:  /opt/developerstudio12.6/bin/c99 -DHAVE_CONFIG_H -I. 
-I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_perfpow -I/usr/local/include 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE 
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 
-xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc 
-g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-xarch=sparc -c perfpow.c -o perfpow.o >/dev/null 2>&1
/usr/local/bin/bash ../libtool --mode=compile --tag=CC ../mpn/m4-ccas 
--m4="/usr/local/bin/m4" /opt/developerstudio12.6/bin/c99 -c 
-DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo 
gcd_1 | sed 's/_$//'` -I/usr/local/include -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE  -errfmt=error 
-erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s 
-xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs 
-ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-xarch=sparc  `test -f 'gcd_1.asm' || echo './'`gcd_1.asm
libtool: compile:  ../mpn/m4-ccas --m4=/usr/local/bin/m4 
/opt/developerstudio12.6/bin/c99 -c -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_1 -I/usr/local/include 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE 
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 
-xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc 
-g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-xarch=sparc gcd_1.asm  -KPIC -DPIC -o .libs/gcd_1.o
/usr/local/bin/m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_gcd_1 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -DPIC 
gcd_1.asm >tmp-gcd_1.s
  /opt/developerstudio12.6/bin/c99 -c -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_1 -I/usr/local/include 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE 
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 
-xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc 
-g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-xarch=sparc tmp-gcd_1.s -KPIC -DPIC -o .libs/gcd_1.o
libtool: compile:  ../mpn/m4-ccas --m4=/usr/local/bin/m4 
/opt/developerstudio12.6/bin/c99 -c -DHAVE_CONFIG_H -I. -I.. 
-D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_1 -I/usr/local/include 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE 
-errfmt=error -erroff=%none -errshort=full -xstrconst -xildoff -m64 
-xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc 
-g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 
-xarch=sparc gcd_1.asm -o gcd_1.o >/dev/null 2>&1
gmake[2]: *** [gcd_1.lo] Error 1
gmake[2]: Leaving directory 
`/usr/local/build/gmp-6.1.2_SunOS5.10_sparc64vii+.001/mpn'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory 
`/usr/local/build/gmp-6.1.2_SunOS5.10_sparc64vii+.001'
gmake: *** [all] Error 2

$

I am guessing this is the old sparc assembly issue that we never did 
really address.

Dennis



More information about the gmp-discuss mailing list