2024年2月22日发(作者:)

1、PGI安装:

(1):把linux86-64文件复制到指定路径下,如/usr/,用命令

# tar zxvf 解压文件

(2):编译并安装

# cd /usr/linux86-64 进入安装目录

# ./install 执行安装

Do you accept these terms? [accept,decline]

accept

Install the ACML? [y/n]

n

Installation directory? [/usr/pgi]

/usr/local/pgi

Create an evaluation license? [y/n]

n

Do you want the files in the install directory to be read-only? [y,n]

n

(3):用root用户把(在使用期范围的其他版本的也可以用)复制(cp)到/usr/local/pgi下

$cp –r /usr/linux86-64/ /usr/local/pgi

2、 环境变量设置:

将环境变量登录到.bashrc(或者.bash_profile)里。下文将PGI以及NETCDF一起设置进去。在根目录root下打开隐藏文件.bash_profile

或着在终端下输入:#vi .bash_profile

(一般我们修改在/home/usr/cuit目录里:

#cd /home/usr/cuit)

出现如下内容:

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

然后添加如下语句:

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

unset USERNAME

## set pgi ## (设置PGI)

export PGI=/usr/local/pgi

export PATH=$PGI/linux86/6.0/bin:$PGI/linux86/6.0/include:$PATH

export MANPATH=$MANPATH:$PGI/linux86/6.0/man

export LM_LICENSE_FILE=$PGI/

## set netcdf ## (设置NETCDF)

export NETCDF=/usr/local/netcdf

export PATH=$NETCDF/bin:$NETCDF/include:$NETCDF/lib:$NETCDF/man:$PATH

export CC=/usr/bin/gcc

export CXX=$PGI/linux86/6.0/bin/pgCC

export FC=$PGI/linux86/6.0/bin/pgf90

export F90=$PGI/linux86/6.0/bin/pgf90

然后保存退出,用如下命令

#:wq!

#source .bash_profile

保存完后,注销一次。最后可以用命令whichpgf90来查看pgi是否安装成功。

#which pgf90

/usr/local/pgi/linux86/6.0/bin/pgf90

#pgf90

pgf90-Warning-No files to process

显示如上则pgi安装成功

3、NETCDF3.6.1安装

 NOTES:PGI安装不成功,后面的NETCDF是编译安装不上的!

 #cd /usr/local

 #mkdir netcdf

 #cd .. 回到usr目录下

 #cd .. 回到根目录

 #cd usr

 #tar zxvf

 #cd netcdf-3.6.1/src

 #./configure –prefix=/usr/local/netcdf

编译并指示安装路径

#make check

#make install 执行安装

此时NETCDF安装完成,环境变量在前一个步骤设置好,注意前面的环境变量里的路径必须与此安装路径相同