Compiling GMP 6.0.0a failed (Solaris 11/SPARC): '__gmpn_clz_tab' undeclared

Marc Glisse marc.glisse at inria.fr
Mon Dec 8 16:20:56 UTC 2014


On Mon, 1 Dec 2014, André Schneider wrote:

> Hi all,
>
> I have successfully compiled GMP 5.1.2 and 5.1.3 in the
> same environment:
>
>    Solaris 11/SPARC
>    GCC 4.8.1
>    setenv CFLAGS   "-O2 -m64 -mcpu=niagara4"
>    setenv LDFLAGS  "-m64 -mcpu=niagara4 -L${PREFIX}/lib64
> -L${PREFIX}/lib -Wl,-rpath=${PREFIX}/lib64 -Wl,-rpath=${PREFIX}
> /lib"
>
>    ultrasparc-sun-solaris2.11
>
> If I compile GMP 6.0.0a a NEW error occures (configure, make):
>
>    ./configure --prefix=/usr/local/gcc-4.9.2
>
> --------------------------------------------------------------------
> ...
>    using ABI="64"
>      CC="gcc -std=gnu99"
>      CFLAGS="-O2 -m64 -mcpu=niagara4"
>      CPPFLAGS="-I/usr/local/gcc-4.9.2/include"
>      MPN_PATH=" sparc64/ultrasparc1234 sparc64 generic"
> ...
> configure: summary of build options:
>
>  Version:           GNU MP 6.0.0
>  Host type:         ultrasparc-sun-solaris2.11
>  ABI:               64
>  Install prefix:    /usr/local/gcc-4.9.2
>  Compiler:          gcc -std=gnu99
>  Static libraries:  yes
>  Shared libraries:  yes
> --------------------------------------------------------------------
>
>    make
>
> --------------------------------------------------------------------
> ...
> libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..
> -D__GMP_WITHIN_GMP -I.. -DOPERATION_divrem_1
> -I/usr/local/gcc-4.9.2/include -O2 -m64 -mcpu=niagara4 -c divrem_1.c
> -fPIC -DPIC -o .libs/divrem_1.o
> In file included from divrem_1.c:32:0:
> divrem_1.c: In function '__gmpn_divrem_1':
> ../gmp.h:251:18: error: '__gmpn_clz_tab' undeclared (first use in this
> function)
> #define __MPN(x) __gmpn_##x
> --------------------------------------------------------------------
>
> Do you have any ideas?

Hmm, we use clz_tab in mpn/sparc64/sparc64.h, but we don't define 
COUNT_LEADING_ZEROS_NEED_CLZ_TAB (and since we provide count_leading_zeros 
it isn't defined automatically), so clz_tab isn't provided.

There is a netbsd sparc64 platform that works (I am not seeing it at 
https://gmplib.org/devel/tm-date.html today, but I am sure I saw it after 
your post), so there must be something slightly different in your 
configuration, but it does look like we are missing a #define somewhere.

Also, in config.guess, we can recognize ultrasparct4 on linux (via 
/proc/cpuinfo) but not on solaris (the lists for prtconf and sysctl stop 
at UltraSPARC-T3). Can you try editing config.guess, search for T3, add 
the obvious T4 version where it is missing (2 places), and see if GMP 
recognizes your cpu better?

-- 
Marc Glisse


More information about the gmp-bugs mailing list