I thought I would update some old code that used GMP and BigInt, to use
BigInteger and bigint. Yes it is various implementations of factorial
:-) (Yes I know about the bigint.fac function!)

I tried building Chapel master/HEAD 2018-01-05T19:03+00:00 with
CHPL_GMP=system and then rebuilt with CHPL_GMP=gmp, but got the same
result on compiling my code:


|> chpl -o factorial_test factorial.chpl factorial_test.chpl
In file included from /tmp/chpl-russel-29963.deleteme/_main.c:2:0:
/tmp/chpl-russel-29963.deleteme/chpl__header.h:266:9: error: unknown type name 
‘__mpz_struct’
 typedef __mpz_struct _tuple_1_star___mpz_struct[1];
         ^~~~~~~~~~~~
In file included from /tmp/chpl-russel-29963.deleteme/_main.c:47:0:
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘init_chpl’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:23:1: error: unknown type name 
‘__mpz_struct’; did you mean ‘__ptr_t’?
 __mpz_struct type_tmp_chpl;
 ^~~~~~~~~~~~
 __ptr_t
/tmp/chpl-russel-29963.deleteme/BigInteger.c:29:1: warning: implicit 
declaration of function ‘mpz_init’; did you mean ‘mbsinit’? 
[-Wimplicit-function-declaration]
 mpz_init(*(call_tmp_chpl));
 ^~~~~~~~
 mbsinit
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘init_chpl2’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:39:1: error: unknown type name 
‘__mpz_struct’; did you mean ‘__ptr_t’?
 __mpz_struct type_tmp_chpl;
 ^~~~~~~~~~~~
 __ptr_t
/tmp/chpl-russel-29963.deleteme/BigInteger.c:47:1: warning: implicit 
declaration of function ‘mpz_init_set’; did you mean ‘chpl__init_Sys’? 
[-Wimplicit-function-declaration]
 mpz_init_set(*(call_tmp_chpl), *(call_tmp_chpl2));
 ^~~~~~~~~~~~
 chpl__init_Sys
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘init_chpl3’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:57:1: error: unknown type name 
‘__mpz_struct’; did you mean ‘__ptr_t’?
 __mpz_struct type_tmp_chpl;
 ^~~~~~~~~~~~
 __ptr_t
/tmp/chpl-russel-29963.deleteme/BigInteger.c:63:1: warning: implicit 
declaration of function ‘mpz_init_set_si’ [-Wimplicit-function-declaration]
 mpz_init_set_si(*(call_tmp_chpl), num_chpl);
 ^~~~~~~~~~~~~~~
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘init_chpl4’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:78:1: error: unknown type name 
‘__mpz_struct’; did you mean ‘__ptr_t’?
 __mpz_struct type_tmp_chpl;
 ^~~~~~~~~~~~
 __ptr_t
/tmp/chpl-russel-29963.deleteme/BigInteger.c:119:18: warning: implicit 
declaration of function ‘mpz_init_set_str’; did you mean ‘deque_it_set_cur’? 
[-Wimplicit-function-declaration]
 call_tmp_chpl8 = mpz_init_set_str(*(call_tmp_chpl7), call_tmp_chpl4, 
((int32_t)(base_chpl)));
                  ^~~~~~~~~~~~~~~~
                  deque_it_set_cur
/tmp/chpl-russel-29963.deleteme/BigInteger.c:123:1: warning: implicit 
declaration of function ‘mpz_clear’ [-Wimplicit-function-declaration]
 mpz_clear(*(call_tmp_chpl10));
 ^~~~~~~~~
In file included from /tmp/chpl-russel-29963.deleteme/_main.c:47:0:
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘get_str_chpl’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:194:18: warning: implicit 
declaration of function ‘chpl_gmp_mpz_get_str’; did you mean 
‘chpl_gen_comm_get_strd’? [-Wimplicit-function-declaration]
 call_tmp_chpl6 = chpl_gmp_mpz_get_str(call_tmp_chpl3, *(call_tmp_chpl5));
                  ^~~~~~~~~~~~~~~~~~~~
                  chpl_gen_comm_get_strd
/tmp/chpl-russel-29963.deleteme/BigInteger.c:194:16: warning: assignment makes 
pointer from integer without a cast [-Wint-conversion]
 call_tmp_chpl6 = chpl_gmp_mpz_get_str(call_tmp_chpl3, *(call_tmp_chpl5));
                ^
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘chpl___ASSIGN_3’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:265:1: warning: implicit 
declaration of function ‘mpz_set’; did you mean ‘tzset’? 
[-Wimplicit-function-declaration]
 mpz_set(*(call_tmp_chpl), *(call_tmp_chpl2));
 ^~~~~~~
 tzset
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘chpl___ASSIGN_4’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:275:1: warning: implicit 
declaration of function ‘mpz_set_si’ [-Wimplicit-function-declaration]
 mpz_set_si(*(call_tmp_chpl), rhs_chpl);
 ^~~~~~~~~~
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function ‘chpl___ASTERISK_’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:295:1: warning: implicit 
declaration of function ‘mpz_mul’ [-Wimplicit-function-declaration]
 mpz_mul(*(call_tmp_chpl), *(call_tmp_chpl2), *(call_tmp_chpl3));
 ^~~~~~~
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function 
‘chpl___EXCLAMATION__ASSIGN_’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:311:18: warning: implicit 
declaration of function ‘mpz_cmp’; did you mean ‘memcmp’? 
[-Wimplicit-function-declaration]
 call_tmp_chpl3 = mpz_cmp(*(call_tmp_chpl), *(call_tmp_chpl2));
                  ^~~~~~~
                  memcmp
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function 
‘chpl___GREATER__ASSIGN_’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:339:18: warning: implicit 
declaration of function ‘chpl_mpz_cmp_si’; did you mean ‘chpl_fs_umask’? 
[-Wimplicit-function-declaration]
 call_tmp_chpl2 = chpl_mpz_cmp_si(*(call_tmp_chpl), b_chpl);
                  ^~~~~~~~~~~~~~~
                  chpl_fs_umask
/tmp/chpl-russel-29963.deleteme/BigInteger.c: In function 
‘chpl___ASTERISK__ASSIGN_2’:
/tmp/chpl-russel-29963.deleteme/BigInteger.c:366:1: warning: implicit 
declaration of function ‘mpz_mul_si’ [-Wimplicit-function-declaration]
 mpz_mul_si(*(call_tmp_chpl), *(call_tmp_chpl2), b_chpl);
 ^~~~~~~~~~
In file included from /tmp/chpl-russel-29963.deleteme/_main.c:48:0:
/tmp/chpl-russel-29963.deleteme/GMP.c: In function ‘chpl__init_GMP’:
/tmp/chpl-russel-29963.deleteme/GMP.c:16:1: warning: implicit declaration of 
function ‘chpl_gmp_init’; did you mean ‘chpl_rt_init’? 
[-Wimplicit-function-declaration]
 chpl_gmp_init();
 ^~~~~~~~~~~~~
 chpl_rt_init


-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to