I report a problem I encountered when I built
givaro-3.2.10rc0.tar.gz on FreeBSD/i386(Core2Duo).
I hope this report serves the improvements.
Sincerely yours,
Shunsuke, Tsuchioka
Research Institute for Mathematical Sciences Kyoto University
-----------------------------------------------------------------------------
> uname -a
FreeBSD hoge_foo 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #3: Wed Jan 30 22:02:54 JST 2008 tshun@hoge_foo:/usr/obj/usr/src/sys/hoge_foo i386
>
> gcc -v
Using built-in specs.
Target: i386-undermydesk-freebsd
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719 [FreeBSD]
I built by the following compile option:
./configure --with-gmp=/home/tshun/math/gmp --disable-shared --enable-static --prefix=/home/tshun/math/giv
"gmake" passed successfully but "gmake check" gave me the following errors:
> gmake check
<SNIP>
g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I/home/tshun/math/gmp/include -I../../src/kernel/system -I../../src/kernel/memory -I../../src/kernel/zpz -I../../src/kernel/integer -I../../src/kernel -I../../src/library/poly1 -I../../src/kernel/bstruct -I../../src/library/tools -I/home/tshun/math/gmp/include -g -O2 -Wall -MT ff_arith.o -MD -MP -MF .deps/ff_arith.Tpo -c -o ff_arith.o ff_arith.C
In file included from ff_arith.C:6:
../../src/kernel/zpz/givaro/givgfqext.h: In member function 'void GFqExtFast<TT>::builddoubletables()':
../../src/kernel/zpz/givaro/givgfqext.h:188: error: 'ulong' was not declared in this scope
../../src/kernel/zpz/givaro/givgfqext.h:188: error: expected `;' before 'ppow'
../../src/kernel/zpz/givaro/givgfqext.h:188: error: 'ppow' was not declared in this scope
../../src/kernel/zpz/givaro/givgfqext.h:189: error: expected `;' before 'powersize'
../../src/kernel/zpz/givaro/givgfqext.h:190: error: 'powersize' was not declared in this scope
../../src/kernel/zpz/givaro/givgfqext.h:236: error: expected `;' before 'binpolit'
../../src/kernel/zpz/givaro/givgfqext.h:238: error: 'binpolit' was not declared in this scope
../../src/kernel/zpz/givaro/givgfqext.h:239: error: expected type-specifier before 'ulong'
../../src/kernel/zpz/givaro/givgfqext.h:239: error: expected `>' before 'ulong'
../../src/kernel/zpz/givaro/givgfqext.h:239: error: expected `(' before 'ulong'
../../src/kernel/zpz/givaro/givgfqext.h:239: error: expected `)' before ';' token
../../src/kernel/zpz/givaro/givgfqext.h:252: error: 'binpolit' was not declared in this scope
------------------------------------------------------------------------------
Thanks for your report.
Apparently, it is a common problem with ulong and freebsd (google "ulong
freebsd").
I suggest to replace all 5 occurrences of ulong by unsigned long.
Can you try it and let us know if it solved the problem?
Jean-Guillaume, you wrote this code and it is the only place in the
library where ulong is used. Do you have any objection for this replacement?
Clément
Shunsuke Tsuchioka a écrit :
> I suggest to replace all 5 occurrences of ulong by unsigned long.
> Can you try it and let us know if it solved the problem?
>
I changed src/kernel/zpz/givgfqext.h as you told me:
> pwd
/usr/home/tshun/source/givaro-3.2.10
> diff /tmp/givaro-3.2.10/src/kernel/zpz/givgfqext.h src/kernel/zpz/givgfqext.h
188,189c188,189
< for(ulong ppow = 2; ppow < this->_characteristic; ppow <<= 1,++_pceil) {}
< ulong powersize = 1<<(_pceil * this->_exponent);
---
> for(unsigned long ppow = 2; ppow < this->_characteristic; ppow <<= 1,++_pceil) {}
> unsigned long powersize = 1<<(_pceil * this->_exponent);
236c236
< ulong binpolit = static_cast<ulong>(vect[0]);
---
> unsigned long binpolit = static_cast<unsigned long>(vect[0]);
239c239
< binpolit += static_cast<ulong>(vect[i]);
---
> binpolit += static_cast<unsigned long>(vect[i]);
>
After that, no problem occurred in "gmake check" process.
Your suggestion really solved the problem.
Thank you.
Shunsuke.