gfortran: "Integer too big for its kind"

  • Follow


Hi,

I am trying to compile the "double double precision" ddfun90 package from

http://crd.lbl.gov/~dhbailey/mpdist/mpdist.html

with the following sample program taken from the readme file:

   program main
     use ddmodule
     implicit none
     type (dd_real) a, b
     a = 1.d0
     b = cos(a)**2 + sin(a)**2 - 1.d0
     call ddwrite(6, b)
     stop
   end program

Ok, I had to made some minor changes to the second.f routine, but that's 
not the matter. The strange thing is that, even if I use the same 
gfortran version (based on GCC 4.3.1) I can compile it without problems 
on an AMD Debian Linux machine while it fails to compile on a G4 PowerPC 
  with the error message:

gfortran -c -ffree-form ddfun90.f ddmod90.f second.f
ddfun90.f:496.43:

   z'3FC8F8B83C69A60B',  z'BC626D19B9FF8D82', &
                                           1
Error: Integer too big for integer kind 8 at (1)

The affected blocks are

data cs/ &
   z'3FEF6297CFF75CB0',  z'3C7562172A361FD3', &
   z'3FC8F8B83C69A60B',  z'BC626D19B9FF8D82', &
   z'3FED906BCF328D46',  z'3C7457E610231AC2', &
   z'3FD87DE2A6AEA963',  z'BC672CEDD3D5A610', &
   z'3FEA9B66290EA1A3',  z'3C39F630E8B6DAC8', &
   z'3FE1C73B39AE68C8',  z'3C8B25DD267F6600', &
   z'3FE6A09E667F3BCD',  z'BC8BDD3413B26456', &
   z'3FE6A09E667F3BCD',  z'BC8BDD3413B26456' /
data pi/ z'400921FB54442D18',  z'3CA1A62633145C07'/

! data cs/ &
!    9.8078528040323043D-01,   1.8546939997825006D-17, &
!    1.9509032201612828D-01,  -7.9910790684617313D-18, &
!    9.2387953251128674D-01,   1.7645047084336677D-17, &
!    3.8268343236508978D-01,  -1.0050772696461588D-17, &
!    8.3146961230254524D-01,   1.4073856984728024D-18, &
!    5.5557023301960218D-01,   4.7094109405616768D-17, &
!    7.0710678118654757D-01,  -4.8336466567264567D-17, &
!    7.0710678118654757D-01,  -4.8336466567264567D-17/
! data pi / 3.1415926535897931D+00,  1.2246467991473532D-16/


Is there any option (like -fno-range-check, but this doesn't help here) 
to circumvent this problem without corrupting the high precision (might 
this happen if I simply uncomment the second of two data blocks and 
comment-out the first after line 496? Since these data are each 18 
digits of plain decimal double precision rather than 16 digits of 
hexadecimal)? Or is ddfun90 simply buggy/incompatible with gfortran and 
I have to use the probably lower precision option provided by the second 
block?

Maybe there is even a more recent package for quad or even arbitrary 
precision arithmetics?

Many thanks in advance,

Ingo
0
Reply ingo.thies (51) 10/2/2008 9:52:27 AM

Ingo Thies wrote:

> The strange thing is that, even if I use the same
> gfortran version (based on GCC 4.3.1) I can compile it without problems
> on an AMD Debian Linux machine while it fails to compile on a G4 PowerPC

gfortran questions may be answered more efficiently on the gfortran or
gcc-help mailing lists.
You would have to give more information, such as the headers you get with
gfortran -v.  Debian comes in both 32- and 64-bit versions.  I assume you
aren't running MacOS, given all the talk about Apple rejecting the license
for gcc 4.3.
0
Reply tprince (585) 10/2/2008 1:02:49 PM


"Ingo Thies" <ingo.thies@gmx.de> wrote in message 
news:6kjjurF8b0meU1@mid.individual.net...

> Ok, I had to made some minor changes to the second.f routine, but that's 
> not the matter. The strange thing is that, even if I use the same gfortran 
> version (based on GCC 4.3.1) I can compile it without problems on an AMD 
> Debian Linux machine while it fails to compile on a G4 PowerPC with the 
> error message:

> gfortran -c -ffree-form ddfun90.f ddmod90.f second.f
> ddfun90.f:496.43:

>   z'3FC8F8B83C69A60B',  z'BC626D19B9FF8D82', &

> Error: Integer too big for integer kind 8 at (1)

> The affected blocks are

> data cs/ &
>   z'3FEF6297CFF75CB0',  z'3C7562172A361FD3', &
>   z'3FC8F8B83C69A60B',  z'BC626D19B9FF8D82', &
>   z'3FED906BCF328D46',  z'3C7457E610231AC2', &
>   z'3FD87DE2A6AEA963',  z'BC672CEDD3D5A610', &
>   z'3FEA9B66290EA1A3',  z'3C39F630E8B6DAC8', &
>   z'3FE1C73B39AE68C8',  z'3C8B25DD267F6600', &
>   z'3FE6A09E667F3BCD',  z'BC8BDD3413B26456', &
>   z'3FE6A09E667F3BCD',  z'BC8BDD3413B26456' /
> data pi/ z'400921FB54442D18',  z'3CA1A62633145C07'/

> ! data cs/ &
> !    9.8078528040323043D-01,   1.8546939997825006D-17, &
> !    1.9509032201612828D-01,  -7.9910790684617313D-18, &
> !    9.2387953251128674D-01,   1.7645047084336677D-17, &
> !    3.8268343236508978D-01,  -1.0050772696461588D-17, &
> !    8.3146961230254524D-01,   1.4073856984728024D-18, &
> !    5.5557023301960218D-01,   4.7094109405616768D-17, &
> !    7.0710678118654757D-01,  -4.8336466567264567D-17, &
> !    7.0710678118654757D-01,  -4.8336466567264567D-17/
> ! data pi / 3.1415926535897931D+00,  1.2246467991473532D-16/

> Is there any option (like -fno-range-check, but this doesn't help here) to 
> circumvent this problem without corrupting the high precision (might this 
> happen if I simply uncomment the second of two data blocks and comment-out 
> the first after line 496? Since these data are each 18 digits of plain 
> decimal double precision rather than 16 digits of hexadecimal)? Or is 
> ddfun90 simply buggy/incompatible with gfortran and I have to use the 
> probably lower precision option provided by the second block?

Have you tried modifying it so that it conforms to f08?


C:\gfortran\clf\data_test>type data_test.f90
program data_test
   double precision :: cs(16) = [&
   real(z'3FEF6297CFF75CB0',kind(cs)),  real(z'3C7562172A361FD3',kind(cs)), 
&
   real(z'3FC8F8B83C69A60B',kind(cs)),  real(z'BC626D19B9FF8D82',kind(cs)), 
&
   real(z'3FED906BCF328D46',kind(cs)),  real(z'3C7457E610231AC2',kind(cs)), 
&
   real(z'3FD87DE2A6AEA963',kind(cs)),  real(z'BC672CEDD3D5A610',kind(cs)), 
&
   real(z'3FEA9B66290EA1A3',kind(cs)),  real(z'3C39F630E8B6DAC8',kind(cs)), 
&
   real(z'3FE1C73B39AE68C8',kind(cs)),  real(z'3C8B25DD267F6600',kind(cs)), 
&
   real(z'3FE6A09E667F3BCD',kind(cs)),  real(z'BC8BDD3413B26456',kind(cs)), 
&
   real(z'3FE6A09E667F3BCD',kind(cs)),  real(z'BC8BDD3413B26456',kind(cs))]
 double precision ::  pi(2) = [&
    real(z'400921FB54442D18',kind(pi)),  real(z'3CA1A62633145C07',kind(pi))]
write(*,*) cs
write(*,*) pi
end program data_test

C:\gfortran\clf\data_test>gfortran data_test.f90 -odata_test

C:\gfortran\clf\data_test>data_test
  0.98078528040323043       1.85469399978250057E-017 
509032201612828      -
7.99107906846173126E-018  0.92387953251128674       1.76450470843366771E-017 
0.
38268343236508978      -1.00507726964615876E-017  0.83146961230254524 
1.40
738569847280239E-018  0.55557023301960218       4.70941094056167682E-017 
0.7071
0678118654757      -4.83364665672645673E-017 
710678118654757      -4.833646
65672645673E-017
   3.1415926535897931       1.22464679914735321E-016

-- 
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


0
Reply not_valid (1681) 10/2/2008 4:17:55 PM

Tim Prince wrote:

> gfortran questions may be answered more efficiently on the gfortran or
> gcc-help mailing lists.

I may have a look on that.

> You would have to give more information, such as the headers you get with
> gfortran -v.  Debian comes in both 32- and 64-bit versions.  I assume you
> aren't running MacOS, given all the talk about Apple rejecting the license
> for gcc 4.3.

I am using Mac OS 10.4.11 and GCC 4.3.1 via Fink.

-- 
Gru�,
       Ingo
0
Reply ingo.thies (51) 10/2/2008 6:14:18 PM

3 Replies
152 Views

(page loaded in 0.119 seconds)

Similiar Articles:













7/15/2012 10:51:42 AM


Reply: