Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

online Fortran compiler

5,989 views
Skip to first unread message

Beliavsky

unread,
Jun 22, 2013, 7:52:21 PM6/22/13
to
There now exist sites that will compile and run Fortran programs online using gfortran (provided the programs run very fast). This could be useful if you want to test a language feature or are on a machine without a compiler.

Two sites with online gfortran are

http://ideone.com/ (4.7.2)
http://www.compileonline.com/ (4.4.3)

They are able to compile and run the toy program

program xran
implicit none
integer :: iter,niter=2
integer, parameter :: n = 1000000
real :: xx(n)
call random_seed()
do iter=1,niter
call random_number(xx)
print*,"iter,#obs, mean, rms, mean, min =",iter,n,sum(xx)/n, &
sum(xx**2)/n,minval(xx),maxval(xx)
end do
print*,"#iter=",niter
end program xran

FX

unread,
Jun 23, 2013, 5:57:24 AM6/23/13
to
> There now exist sites that will compile and run Fortran programs online
> using gfortran (provided the programs run very fast). This could be
> useful if you want to test a language feature or are on a machine
> without a compiler.

Thanks for the link. I'dd add two things:

1. Another utility of such on-line compiler is as a source checker
(similar to the very good Lahey source checker): quickly verify is a
given construct is standard, or if a specific extension is accepted by
the compiler.

2. Such nice projects are obviously made possible by the open source
nature of the compiler, and the great effort of gfortran volunteers.

--
FX

Daniel Feenberg

unread,
Jun 23, 2013, 8:28:43 AM6/23/13
to
On Saturday, June 22, 2013 7:52:21 PM UTC-4, Beliavsky wrote:
> There now exist sites that will compile and run Fortran programs online using gfortran (provided the programs run very fast). This could be useful if you want to test a language feature or are on a machine without a compiler.
>
> Two sites with online gfortran are
>
> http://ideone.com/ (4.7.2)
> http://www.compileonline.com/ (4.4.3)
>
> They are able to compile and run the toy program
>
...

That is an interesting service - is there a service that will compile fortran programs for various targets and return statically linked executables?

daniel feenberg
NBER

Beliavsky

unread,
Jul 8, 2013, 10:40:30 AM7/8/13
to
Are there sites for commercial users and hobbyists where you can upload an executable and run it? I know academics doing computational research routinely rent time on supercomputers, but I wonder what a few hundred dollars will get a hobbyist or commercial user.



Zaak

unread,
Jul 8, 2013, 11:09:01 AM7/8/13
to
On Monday, July 8, 2013 10:40:30 AM UTC-4, Beliavsky wrote:
> Are there sites for commercial users and hobbyists where you can upload an executable and run it? I know academics doing computational research routinely rent time on supercomputers, but I wonder what a few hundred dollars will get a hobbyist or commercial user.

I know Amazon provides "HPC" EC2 instances that you can rent. Also, if you just want to run a serial code you might be able to get away with their cheaper EC2 instances. You choose an AMI (amazon machine image, Ubuntu etc.) and will have to set up your own development environment, most likely. So the ease of use is likely less that the sites in the original thread, but you can definitely rent time on Amazons cloud based HPC.

Zaak

unread,
Jul 8, 2013, 11:10:04 AM7/8/13
to
On Sunday, June 23, 2013 5:57:24 AM UTC-4, FX wrote:
> 1. Another utility of such on-line compiler is as a source checker
>
> (similar to the very good Lahey source checker)

Link?

Beliavsky

unread,
Jul 8, 2013, 12:38:35 PM7/8/13
to
http://www.lahey.com/check.htm

(And thanks for your other reply mentioning Amazon EC2.)

Zaak

unread,
Jul 9, 2013, 4:05:03 PM7/9/13
to
On Monday, July 8, 2013 12:38:35 PM UTC-4, Beliavsky wrote:
> http://www.lahey.com/check.htm

Wow, I knew they had a static analysis tool but didn't realize it was online for free. Do you know if:

1) this works with multi-file-source-code programs?
2) it plays nice/understands any F2003/F2008?

> (And thanks for your other reply mentioning Amazon EC2.)
NP

Zaak

unread,
Jul 9, 2013, 4:11:38 PM7/9/13
to
On Tuesday, July 9, 2013 4:05:03 PM UTC-4, Zaak wrote:
> On Monday, July 8, 2013 12:38:35 PM UTC-4, Beliavsky wrote:
>
> > http://www.lahey.com/check.htm
>
>
>
> Wow, I knew they had a static analysis tool but didn't realize it was online for free. Do you know if:
>
>
>
> 1) this works with multi-file-source-code programs?

Derp. It says right there that it can handle multiple files. I wonder if it will perform the static analysis of the entire program, though, or just each file treated individually.

> 2) it plays nice/understands any F2003/F2008?

It looks like it might be limited to F95.... not sure though

Gordon Sande

unread,
Jul 9, 2013, 4:14:11 PM7/9/13
to
On 2013-07-09 20:05:03 +0000, Zaak said:

> On Monday, July 8, 2013 12:38:35 PM UTC-4, Beliavsky wrote:
>> http://www.lahey.com/check.htm
>
> Wow, I knew they had a static analysis tool but didn't realize it was
> online for free. Do you know if:
>
> 1) this works with multi-file-source-code programs?

You submit a SINGLE Fortran source file. So it sounds like you have to
collect everything into that SINGLE file before you submit it.

manishatr...@gmail.com

unread,
Jan 28, 2015, 9:42:49 AM1/28/15
to
integer n, f, j
f=1
read*, n
if (n=0)
f=1
else
do j=1,n
f=f*i
enddo
endif
print*, f
end

FortranFan

unread,
Jan 28, 2015, 10:54:49 AM1/28/15
to
Try
program p
integer n, f, j
f=1
read *, n
if (n==0) then
f=1
else
do j=1,n
f = f*j
end do
end if
print*, f
stop
end program p

z.akbar...@gmail.com

unread,
Dec 2, 2015, 9:57:17 AM12/2/15
to
program p5
IMPLICIT NONE
INTEGER, PARAMETER :: N = 500
REAL, DIMENSION(N) :: List1 ,list2
INTEGER I

open(100,file='n.txt')
open(200,file='1.txt')
open(300,file='Ascending.txt')
open(400,file='Descending.txt')


do 2 i=1,500
read(100,*) list1(i)
2 CONTINUE


write (*, 10) List1
10 FORMAT( 500F20.11 )
write (200, '(20f14.11)' ) list1



write(*,*) '******************************************************************************************************************************************************************************************************************************* Ascending: '




CALL Bubble_Sorta( List1,N ,list2)
write(*,10)list2
write (300,'(20f14.11)' ) list2



write(*,*) '&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Descending: '


CALL Bubble_Sortb( List1,N,list2 )
write (*, 10) list2
write (400,'(20f14.11)' ) list2



close (100)
close(200)
close(300)
close(400)

CONTAINS



SUBROUTINE Bubble_Sorta( X,NUM,Y)

IMPLICIT NONE
REAL, DIMENSION(:) :: X ,Y
INTEGER :: Num
REAL Temp
INTEGER J, K
TEMP=0


do k=0,num-1
DO J = 0, Num-1
IF (X(J) > X(J+1)) THEN
Temp = X(J)
X(J) = X(J+1)
X(J+1) = Temp

END IF
END DO
END DO
Y=X
return
END SUBROUTINE


SUBROUTINE Bubble_Sortb( U,NUM ,Y)

IMPLICIT NONE
REAL, DIMENSION(:) :: U ,Y
INTEGER :: Num
REAL Temp
INTEGER J, K


do k=0,num-1
DO J = 1, Num-1
IF (U(J) < U(J+1)) THEN
Temp = U(J)
U(J) = U(J+1)
U(J+1) = Temp

END IF
END DO
END DO
Y=U
return
END SUBROUTINE


END

Beliavsky

unread,
Aug 11, 2016, 7:02:59 PM8/11/16
to
Following up on this thread 3 years later:

The site http://www.tutorialspoint.com/ lets you compile (with gfortran 5.3.1 20151207 (Red Hat 5.3.1-2)) and run programs with execution times exceeding 2 minutes. You can import and export source files and data files using Google Drive. Sites like this may be useful for
(1) students in Fortran classes, who no longer need to install compilers on their machines
(2) experienced Fortranners who don't have their computers with them while travelling
(3) people who want to test their code with gfortran without installing it.

Some other online compilation sites don't let you run programs that take more than a few seconds.

Beliavsky

unread,
Aug 12, 2016, 6:14:41 AM8/12/16
to
On Thursday, August 11, 2016 at 7:02:59 PM UTC-4, Beliavsky wrote:

> Following up on this thread 3 years later:
>
> The site http://www.tutorialspoint.com/ lets you compile (with gfortran 5.3.1 20151207 (Red Hat 5.3.1-2)) and run programs with execution times exceeding 2 minutes.

The Fortran IDE is at http://www.tutorialspoint.com/compile_fortran_online.php .

Beliavsky

unread,
Aug 12, 2016, 8:29:59 AM8/12/16
to
On Cloud9 https://c9.io/ , you get an Ubuntu workspace with 512MB of RAM and 2GB of disk space. Gfortran can be installed with sudo apt-get install gfortran .

Stefano Zaghi

unread,
Aug 12, 2016, 12:39:42 PM8/12/16
to
Dear Beliavsky,

>On Cloud9 https://c9.io/ , you get an Ubuntu workspace with 512MB of RAM and 2GB of disk space. Gfortran can be installed with sudo apt-get install gfortran .

A really great online resource is the continuous integration service of Travis CI, where you have a complete virtual machine for doing almost anything... I routinely exploit Travis for automatic compile, run test suite, do coverage analysis, build API doc, deploy API doc on the web... for all my poor Fortran projects, e.g. see

https://travis-ci.org/szaghi/FLAP

that is Travis output of this Fortran project

https://github.com/szaghi/FLAP/blob/master/README.md

Setup Travis to use GNU gfortran 6.x.y is easy.

My best regards.

Beliavsky

unread,
Aug 12, 2016, 12:52:05 PM8/12/16
to
Thanks, but for non-open-source projects like mine Travis costs at least $129 per month.

Stefano Zaghi

unread,
Aug 12, 2016, 1:25:19 PM8/12/16
to
Sorry, I forget to mention the cost for non free project, my bad.

My best regards.
0 new messages