Discussion:
can you help me!
amine awad abed
2018-08-15 00:38:41 UTC
Permalink
I HAVE mac mini with Gfortran and it works perfectly.
But i install
Gfortran in a Raspberry PI model b and the example of fibbonaci using
allocate instruction it dose'nt work!


can you help me!!

thanks a lot








! EXAMPLE DE LA SUSECCION DE FIBONACCI USANDO ALLOCAT
! amine awad abed 2018 ©

implicit none
integer(kind=16),allocatable,dimension(:) :: fib_vals,c_vals
integer, allocatable,dimension(:) :: nvals
integer :: i,n

write(*,*)"dame el valor de n"
read *,n
print 5,n

5 format("Número de Elementos. ",i3)

allocate(fib_vals(n),c_vals(n),nvals(n))

open(unit=1, file="fib_val.txt")
15 format(i3,5x,i45)

fib_vals(1)=1
fib_vals(2)=2

do i=3,n
fib_vals(i)=fib_vals(i-1)+fib_vals(i-2)
end do

do i=1,n
print 10,i,fib_vals(i)
10 format("El valor de fibonacci para: ",i4, " es:",i45)
write(unit=1, fmt=15)i,fib_vals(i)
end do

close(unit=1)



deallocate(fib_vals,c_vals,nvals) !Deallocates ARREGLOS

stop
end

||=== Build file: "no target" in "no project" (compiler: unknown) ===|
||Warning: Nonexistent include directory '/home/pi/Desktop/fortran-raspberry/fibo-alloc2.os_output_dir' [-Wmissing-include-dirs]|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|5|Error: Kind 16 not supported for type INTEGER |
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|15|Error: Allocate-object is neither a data pointer nor an allocatable variable|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|37|Error: 'fib_vals' is not a variable|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|20|Error: Function 'fib_vals' has no IMPLICIT type|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|21|Error: Function 'fib_vals' has no IMPLICIT type|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|24|Error: Function 'fib_vals' has no IMPLICIT type|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|24|Error: Function 'fib_vals' has no IMPLICIT type|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|28|Error: Function 'fib_vals' has no IMPLICIT type|
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|30|Error: Function 'fib_vals' has no IMPLICIT type|
||=== Build failed: 9 error(s), 1 warning(s) (0 minute(s), 1 second(s)) ===|
Janus Weil
2018-08-15 05:23:57 UTC
Permalink
Hi Amine,
Post by amine awad abed
I HAVE mac mini with Gfortran and it works perfectly.
But i install
Gfortran in a Raspberry PI model b and the example of fibbonaci using
allocate instruction it dose'nt work!
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|5|Error: Kind 16 not supported for type INTEGER |
That sounds like your raspi doesn't support kind=16, so you should
Post by amine awad abed
integer(kind=16),allocatable,dimension(:) :: fib_vals,c_vals
into:

integer(kind=8),allocatable,dimension(:) :: fib_vals,c_vals

Hope that helps ...

Cheers,
Janus
Damian Rouson
2018-08-15 05:39:16 UTC
Permalink
If you get this to work, please post your configure line or any other
steps. I tried to install gfortran on a Raspberry Pi several months ago and
the installation failed.

Damian
Post by Janus Weil
Hi Amine,
Post by amine awad abed
I HAVE mac mini with Gfortran and it works perfectly.
But i install
Gfortran in a Raspberry PI model b and the example of fibbonaci using
allocate instruction it dose'nt work!
/home/pi/Desktop/fortran-raspberry/fibo-alloc2.f90|5|Error: Kind 16 not
supported for type INTEGER |
That sounds like your raspi doesn't support kind=16, so you should
Post by amine awad abed
integer(kind=16),allocatable,dimension(:) :: fib_vals,c_vals
integer(kind=8),allocatable,dimension(:) :: fib_vals,c_vals
Hope that helps ...
Cheers,
Janus
Loading...