You are on page 1of 1

Fortran l mt ngn ng n gin nhng kh mnh, nu so snh vi C/C++ hay mt s ngn

ng khc th Fortran n gin hn rt nhiu. Bi vit ny gii thiu cch ci t Fortran trn
Linux v cch compiler n.
u tin vo trang ch ca G95 (http://g95.org) download gi g95-x86-linux.tgz
Chuyn sang quyn root vo to th mc g95 nh sau:
#mkdir /usr/local/g95
Di chuyn vo th mc g95:
#cd /usr/local/g95
#mv /tmp/g95-x86-linux.tgz .
#tar xzvf g95-x86-linux.tgz
Di /usr/local/g95 c mt th muc g95-install c to ra, trong th mc ny c th mc bin
cha file tin hnh compiler.
Tip theo to lin kt n /usr/local/bin
#cd /usr/local/g95
#ln -ivs /g95-install/bin/*g95* /usr/local/bin
Kt thc phn ci t.
By gi th to mt file hello.f90 c ni dung sau:

program hello
write(*, *) hello
end program hello
Cch compiler
%g95 hello.f90
Nu khng xut hin li th mt file c tn a.out c to ra. Tip theo chy file ny:
%./a.out
trn mn hnh s hin th hello.
Nh vy bn han thnh vic ci t v compiler vi Fortran 90/95.

You might also like