|
其实大家都被高版本给蒙了,虽然版本高,但是安装步骤完全一样,只是它里面有一个patcher需要安装罢了,具体要装那个patcher,要看你的机子是32位还是64位的,只要与自己电脑的对应就可以。
下面是完整的安装步骤:
安装pgi
准备好 pgilinux-901[1].tar.gz、pgi_9.0-1_linux32.tar.bz2 以及 license.dat
一、安装PGI安装包
[iyunv@localhost ~]# cd /home/public
[iyunv@localhost pgi]# tar -zxvf pgilinux-901[1].tar.gz
[iyunv@localhost pgi]# tar -vxf pgi_9.0-1_linux32.tar.bz2
[iyunv@localhost pgi]# ./install
Do you accept these terms? [accept,decline]
accept
1. Single system install
2. Network install
Please choose install option(1-2):
1
Install the ACML? [y/n]
n
Installation directory?
/usr/local/pgi
Do you wish to install MPICH1?(y/n)
y
Remote execution method? [rsh,ssh]
ssh
Do you want the files in the install directory to be read-only? [y,n]
n
[iyunv@localhost pgi]# cp pgi_9.0-1_linux32_patcher /usr/local/pgi/
[iyunv@localhost local]# cd /usr/local/pgi
[iyunv@localhost pgi]# ./pgi_9.0-1_linux32_patcher
[iyunv@localhost pgi]# cp /home/public/license.dat .
[iyunv@localhost pgi]# cd
[iyunv@localhost ~]# vi .bashrc
二 bash文件设置的环境变量为
1 #set for PGI
PGI=/usr/local/pgi
export PGI
export PATH=$PGI/linux86/9.0-1/bin:$PGI/linux86/9.0-1/include:$PGI/linux86/9.0-
1/lib:$PATH
export LM_LICENSE_FILE=$PGI/license.dat
export MANPATH=$PGI/linux86/9.0-1/man:$MANPATH
2.##MANPATH设置环境变量
MPICH=/usr/local/pgi/linux86/9.0/mpi/mpich
export MPICH
export PATH=$MPICH/bin:$MPICH/lib:$MPICH/inlcude:$PATH
export MANPATH=$MPICH/man:$MANPATH
[iyunv@localhost ~]# source .bashrc
[iyunv@localhost pgi]# pgf90
pgf90-Warning-No files to process
三破解PGI
如果提示license.dat已经过期或者失效,数据和文件不匹配,则需要对PGI安装文件进行破解
install complete
$cp license.dat /home/name/Program/pgi
$tar -xvf pgi_9.0-1_linux32.tar.bz2 -C /opt/pgi
$./pgi_9.0-1_linux32_patcher##需要到/opt/pgi文件夹下执行就可
四为了试验pgi是否安装成功,可以打如下命令
$pgf90
如果有如下提示信息,说明已安装成功
$pgf90-Warning-No files to process
建议初次安装编译器的同志,安装完之后先测试一下看看能不能用,别急着去编译
模式,下面是一段测试程序,你可以试一下:(下面程序注意复制到终端时注意中英文符号对照)
[iyunv@localhost pgi]# vi hello.f90
print *, " hello world !"
end
[iyunv@localhost pgi]# pgf90 hello.f90 -o hello
[iyunv@localhost pgi]# ./hello
hello world!
测试一下gcc
vim hello.c
#include <stdio.h>
int main (void)
{
printf(“I am pratising gcc\n”);
}
gcc -c hello.c
gcc -o hello hello.o
./hello
安装netcdf
1.提示gcc: error trying to exec 'cc1plus': execvp:
The package name is 'gcc-c++'
# yum install gcc-c++
( And # 'yum search ... ' is not very helpful
with finding the package name.)
其中,yum为软件包管理器,能便于管理大量系统的更新问题。跟apt功能相似。
安装时Is this ok [y/d/N],两次确认点击Y后就会下载自动安装
|
|