PGI安装时出现ERROR: unknown glibc version (2.4),的解决方法

本人在安装PGI时出现ERROR: unknown glibc version (2.4)的错误,经过网友的指教,终于成功完成安装。

看着PGI能顺利工作,心里确实很爽,在这里也把自己的一点所获与大家分享。

以本人所用的PGI-7.1.4为例,第一次安装后出现上述错误,但是发现此时PGI文件已经被成功写入指定的区域了,然后在安装路径下(本人使用/home/name/pgi/)下找到/linux86/7.1/中的makelocal文件,打开后按以下方式更改:

修改后的makelocalrc如下(修改部分已用整行长注释条标出):

#! /bin/sh
##
##
Copyright 1990-2000, The Portland Group, Incorporated.
## Copyright
2000-2005, STMicroelectronics, Incorporated.
## All rights reserved.
##

## STMICROELECTRONICS, INCORPORATED PROPRIETARY INFORMATION
## This
software is supplied under the terms of a license agreement
## or
nondisclosure agreement with STMicroelectronics and may not be
## copied or
disclosed except in accordance with the terms of that
## agreement.
##

# Just in case
PATH=/usr/bin:/bin:$PATH
TMPDIR=${TMPDIR:-/tmp}

usage() {
echo "Usage: $0 [-x|-n] installdir"
echo
echo
"Example: $0 -x /usr/pgi/linux86/6.1"
quit 1
}

quit() {
#
Cleanup scratch files.
rm -rf $scratch
exit $1
}

copy_files() {
# $1 is source dir, $2 is destination dir
if test
-n "$1"; then
if test -d "$1"; then
if test ! -d $2 ; then
mkdir $2

fi
( cd $1 ; tar cf - * | ( cd $2; tar xpf - ))
fi
fi
}

pretty_print() {
echo [email protected] | awk -F^ ‘{printf("%20-s %s\n",$1,$2);}‘

}

print_line() {
echo $1 $2 $3 $4 $5 $6 >> $newrc
}

get_glibc_version() {
# Determine the GNU LIBC version.

if
test -r /lib64/libc.so.6 ; then
LIBC=/lib64/libc.so.6 # should only exist on
a 64-bit Linux OS.
elif test -r /lib/libc.so.6 ; then

LIBC=/lib/libc.so.6 # should exist on any Linux OS.
else
echo
"ERROR: /lib/libc.so.6: not found or no read permission"
quit
fi

x=`strings $LIBC | grep ‘GNU C Library‘ | cut -d, -f1 | awk ‘{print
$7}‘`
if test -n "$x" ; then

#########################################################################################

GLIBC_VERSION=2.4.4 ##原来是"$x"
else
GLIBC_VERSION=2.4.4 ##原来是空的

########################################################################################

fi
unset x
return
}

get_linker_version() {
x=`grep
collect2 $out | sed q | sed -e ‘s/.* -dynamic-linker //‘ -e ‘s/ .*//‘`
if
test -n "$x" ; then
LINKER=$x
else
LINKER=
fi
unset x

return
}

get_specs_file() {
# This command pipeline should
be I18N-capable.
x=`awk ‘/gcc.*specs/ {print $NF}‘ $out`
if test -n "$x"
; then
SPECSFILE=$x
else
SPECSFILE=
fi
unset x
return

}

# Stop if not Linux.

opsys=`uname -s | tr ‘[A-Z]‘ ‘[a-z]‘`

if test "$opsys" != "linux" ; then
echo
echo "$0: `uname -n` is not
running Linux"
quit 1
fi

pgi50=1
noexec=1
ofile=0

use_pthreads=1
no_m32_support=0
check_crt_files=0

set_hammer_empty=0
gcc=gcc
g77=g77

scratch=$TMPDIR/PGI-INSTALL.$$
if test ! -d $scratch ; then
mkdir
$scratch
fi

while test -n "$1"; do
case $1 in
-n ) noexec=1
;;
-x ) noexec=0 ;;
-o ) ofile=1 ; noexec=0 ;;
-gcc ) shift; gcc=$1
;;
-g77 ) shift; g77=$1 ;;
* ) start=$1 ;;
esac
shift
done

if test -z "$start" ; then
usage
fi

if test ! -d $start
; then
echo "$0: $start: directory not found"
usage
fi

if
test "$start" = "." ; then
start=`pwd`
fi

if test "$pgi50" -eq 1
; then
# Example: 5.0 and above:
# start = /usr/pgi/linux86/5.0
#
installdir = /usr/pgi/linux86
# version = 5.0
# base =
/usr/pgi/linux86/5.0
# target = linux86
installdir=`dirname $start`

version=`basename $start`
base=$start
target=`basename $installdir`

else
# Example: 4.1 and below:
# start = /usr/pgi
# installdir =
/usr/pgi
# base = /usr/pgi/linux
# version = 5.0
# target = linux86

installdir=$start
version=`cat $start/.release`
base=$start/linux86

target="linux86"
fi

# Define target-specific options needed
below.

arch=`uname -m`
case "${target}:${arch}" in

linux86:x86_64 )
gccopt="-o $scratch/a.out -m32 -v"
g77opt=$gccopt

subdir="/32"
check_crt_files=1
use_64bit_rcfiles=11

install_64_bit=0
lib=/lib
usrlib=/usr/lib
;;
linux86:* )

set_hammer_empty=1
gccopt="-o $scratch/a.out -v"
g77opt=$gccopt

use_64bit_rcfiles=10
install_64_bit=0
lib=/lib
usrlib=/usr/lib

;;
linux86-64:x86_64 )
gccopt="-o $scratch/a.out -v"

g77opt=$gccopt
lib=/lib64
usrlib=/usr/lib64
install_64_bit=1

use_64bit_rcfiles=0
;;
linux86-64:* )
echo "ERROR: target
doesn‘t match architecture"
exit 1
;;
esac

localrc=$base/bin/localrc
newrc=$scratch/localrc.$$

# Find
the version of GLIBC used on this system so that the appropriate
# files are
copied from lib-linux86-g* to lib and/or liblf.

LIBC=$lib/libc.so.6

if test ! -f $LIBC ; then
echo "ERROR: file $LIBC: not found."
quit
1
fi

get_glibc_version # sets GLIBC_VERSION

case
"$GLIBC_VERSION" in
2.3.* )
glibc=232
LIB=$base/lib-linux86-g232

LIBLF=$LIB-lf
INC=$base/include-g23
;;
2.2.9* )
glibc=2293

LIB=$base/lib-linux86-g2293
LIBLF=$LIB-lf
INC=$base/include-g222

;;
2.2.5 )
glibc=225
LIB=$base/lib-linux86-g225

LIBLF=$LIB-lf
INC=$base/include-g222
;;
2.2.4 )
glibc=224

LIB=$base/lib-linux86-g224
LIBLF=$LIB-lf
INC=$base/include-g222

;;
2.2.2 )
glibc=222
LIB=$base/lib-linux86-g22
LIBLF=$LIB-lf

INC=$base/include-g222
;;
2.1.9* | 2.2*)
glibc=22

LIB=$base/lib-linux86-g22
LIBLF=$LIB-lf
INC=$base/include-g22
;;

2.1.[23] )
glibc=212
LIB=$base/lib-linux86-g212
;;
2.1.1 )

glibc=211
LIB=$base/lib-linux86-g211
;;

####################################################################################

2.4.4) ##这都是加上的 其实只要改GLIBC_VERSION
glibc=232 ##对应上面半括号中较新版本版本号即可

LIB=$base/lib-linux86-g232
LIBLF=$LIB-lf
INC=$base/include-g23

;;

#####################################################################################

* )
echo "ERROR: unknown glibc version ($GLIBC_VERSION)."
quit 1

;;
esac

# PGI software needs some of the gcc libraries. Run gcc
to determine
# to determine which linker and libraries are actually being
used.

type $gcc > /dev/null 2>&1
if test $? -eq 1 ; then

echo "ERROR: gcc not found;"
echo " successful use of compilers requires
existence of gcc libraries"
quit 1
fi

cfile=$scratch/hello-$$.c

ffile=$scratch/hello-$$.f

cat > $cfile <<EOF_HELLO_C

#include <stdio.h>
#include <stdlib.h>
main(){
printf("Hello world!\n"); exit(0); }
EOF_HELLO_C

cat > $ffile
<<EOF_HELLO_F
program hello
write(*,100)
100 format(‘Hello
world!‘)
end
EOF_HELLO_F

out=$scratch/gccrun.$$
$gcc $gccopt
$cfile > $out 2>&1

if test ! -s $out ; then
echo "ERROR:
gcc failed to execute for reasons unknown."
quit 1
fi

########################################################################

####$gccbase=`$gcc -print-search-dirs | sed -e ‘s/^install: //‘ -e 1q`

####if test -d $gccbase$subdir ; then
#### GCCDIR="$gccbase$subdir"
##原有的
####fi
####gccversion=`$gcc -dumpversion`

#######################################################################

libgcc=`$gcc -print-libgcc-file-name`
gccbase=`dirname $libgcc`

GCCDIR="$gccbase$subdir" ##自己加的
gccversion=`basename $gccbase`

##########################################################################

# Check and see whether directory that gcc claims to exist actually

# does exist.

if test ! -d $gccbase ; then
echo "ERROR:
directory $gccbase: not found;"
echo " successful use of compilers requires
existence of gcc libraries!"
quit 1
fi

if test -d
${gccbase}include ; then
GCCINC=${gccbase}include
else
unset GCCINC

fi

# Find the linker

get_linker_version # returns LINKER

if test ! -x $LINKER ; then
echo "ERROR: Linker $LINKER: not found"

quit 1
fi

# Which g77? PGI software needs the g77 libraries, so
look for the g77 libs.

type $g77 >/dev/null 2>&1
if test
$? -eq 1 ; then
echo "WARNING: g77 not found; this may cause problems during
use"
G77DIR=‘""‘
else
out=$scratch/g77run.$$
$g77 $g77opt $ffile
> $out 2>&1
libgcc=`$g77 -print-libgcc-file-name`

g77base=`$g77 -print-search-dirs | sed -e ‘s/^install: //‘ -e 1q`
if
test -d $g77base$subdir ; then
G77DIR="$g77base$subdir"
else

G77DIR=‘""‘
fi
f2c=`cat $out | grep lf2c`
g2c=`cat $out | grep
lg2c`
if test -n "$f2c" ; then
G77LIB="-lf2c"
fi
if test -n
"$g2c" ; then
G77LIB="-lg2c"
fi
fi

if test -n "$G77LIB" ;
then
print_line "set LFC=$G77LIB;"
fi

# Which dynamic linker?

if test "$LINKER" != "/lib/ld-linux.so.1" ; then
print_line "set
LDSO=$LINKER;"
fi

# CDK uses its own libmpich.a.

if test -f
"$base/bin/mpirun" ; then
print_line "set MPILIB=$base/lib;"

MPILIB=$base/lib/libmpich.a
fi

print_line "set GCCDIR=$GCCDIR;"

print_line "set GCCINC=$GCCINC;"
print_line "set G77DIR=$G77DIR;"

#Add setaff_bind.o and -lnuma at link line
x=$base
x=`echo $x |
sed -e ‘s/.*86-64.*/86-64/‘`
if test "$x" = "86-64" ; then
if test -e
$usrlib/libnuma.so ; then
print_line ‘set
NUMAOBJS=$COMPLIBOBJ/setaff_bind.o;‘
print_line "set NUMALIBS=-lnuma;"

fi
fi

if test $pgi50 -eq 0 ; then
print_line "set
STDRPATH=-rpath \$PGI/linux86/lib;"
fi

print_line ‘set LOCALRC=YES;‘

if test "$noexec" -eq 1 ; then
pretty_print ‘PGI directory‘ ^
$installdir
pretty_print ‘PGI version‘ ^ $version
pretty_print ‘PATH
entry‘ ^ "$base/bin"
pretty_print ‘System linker‘ ^ $LINKER
pretty_print
‘GCC directory‘ ^ $GCCDIR
pretty_print ‘GCC headers‘ ^ $GCCINC

pretty_print ‘G77 directory‘ ^ $G77DIR
pretty_print ‘G77 headers‘ ^
$G77LIB

if test -n "$GLIBC_VERSION" ; then
pretty_print ‘GNU C
version‘ ^ $GLIBC_VERSION
pretty_print ‘PGI glibc libs‘ ^ $LIB

pretty_print ‘PGI glibc headers‘ ^ $INC
else
pretty_print ‘Glibc
version‘ ^ ‘no‘
fi

if test -n "$LIBLF" ; then
pretty_print
‘Large file support‘ ^ $LIBLF
else
pretty_print ‘Large file support‘ ^
‘no‘
fi

if test -n "$MPILIB" ; then
pretty_print ‘MPILIB‘ ^
$MPILIB
fi

if test $use_pthreads -eq 1 ; then
pretty_print
‘Threads‘ ^ "$usrlib/libpthread.{a,so}"
else
pretty_print ‘Threads‘ ^
"$base/lib/libpgthread.{a,so}"
fi

if test $no_m32_support -eq 1 ;
then
pretty_print ‘gcc supports -m32‘ ^ ‘no‘
else
pretty_print ‘gcc
supports -m32‘ ^ ‘yes‘
fi

quit 0
fi

# Make the necessary
changes to meet glibc dependencies.

if test -n "$glibc" ; then

copy_files $LIB $base/lib

case "$glibc" in
22* | 23* )

copy_files $INC $base/include
print_line "set THROW=__THROW=;"
;;

21* )
;;
esac

# Large file support.

if test -n
"$LIBLF" ; then
copy_files $LIBLF $base/liblf
else
rm -rf
$base/liblf
fi

# Newer distributions of Linux do not need
PGI-compiled versions of
# threads libraries.

if test $use_pthreads
-eq 1 ; then
# Only create a symlink if the target file exists and
# the
link does not.
if test -e $usrlib/libpthread.a ; then
if test ! -h
$base/lib/libpgthread.a ; then
ln -s $usrlib/libpthread.a
$base/lib/libpgthread.a
fi
fi
if test -e $lib/libpthread.so.0 ; then

if test ! -h $base/lib/libpgthread.so ; then
ln -s $lib/libpthread.so.0
$base/lib/libpgthread.so
fi
fi
fi

# Adjust header files
based on the gcc version.

need_stddef=1
case "$gccversion" in

3.3* )
copy_files $base/include-gcc33 $base/include
;;
3.4* )

copy_files $base/include-gcc34 $base/include
need_stddef=0
;;

4.* )
copy_files $base/include-gcc40 $base/include
need_stddef=1

;;
* )
;;
esac

if test $need_stddef -eq 0 ; then
rm
-f $base/include/stddef.h
fi

# Changes for 32-bit installs.

if test $set_hammer_empty -eq 1 ; then
print_line "set HAMMER=;"

print_line "set X86_64=;"
fi

if test $install_64_bit -eq 0 ;
then
if test -f /etc/redhat-release ; then
grep ‘release 9‘
/etc/redhat-release > /dev/null 2>&1
if test $? -eq 0; then

print_line "set LBSTAT=-lpthread -lpthread_nonshared;"
fi
fi
fi

# Stock distributions may need extra help in finding crt files.

if test $check_crt_files -eq 1 ; then
if test ! -f
/usr/lib64/32/crt1.o ; then
print_line "set DEFLIBDIR=/usr/lib;"

print_line "set DEFSTDOBJDIR=/usr/lib;"
print_line "set
EXTRAASARGS=--32;"
fi
fi

# For production installations, recover
some space by unneeded files.

if test "$version" != "dev" ; then
rm
-rf $base/include-g*
echo $GLIBC_VERSION > $base/glibc_version
fi

# Fix the 32/64-bit .*rc files.

if test $use_64bit_rcfiles -eq
11 ; then
files=`ls -1 $base/bin/.pg*-64 2>/dev/null`
for i in $files
; do
x=`echo $i | sed -e ‘s/-64$//‘`
mv -f $i $x
done
rm -f
$base/bin/.pg*-32 > /dev/null 2>&1
elif test $use_64bit_rcfiles
-eq 10; then
files=`ls -1 $base/bin/.pg*-32 2>/dev/null`
for i in
$files ; do
x=`echo $i | sed -e ‘s/-32$//‘`
mv -f $i $x
done
rm
-f $base/bin/.pg*-64 > /dev/null 2>&1
fi
fi

# Add
timestamp and username.

print_line ‘# makelocalrc executed by ‘ `whoami`
`date`

# If $ofile is set, then display the file to stdout. Otherwise,
write
# it to $localrc.

if test $ofile -eq 1 ; then
echo "#####
localrc contents #####"
cat $newrc
echo "############################"

rm -f $newrc
else
if test -f $localrc ; then
mv -f $localrc
$localrc.bak
chmod -f 0644 $localrc.bak
fi
mv -f $newrc $localrc

chmod -f 0644 $localrc
fi

# Copy omp_lib.mod from lib directory
to include directory
echo
if test -f $base/lib/omp_lib.mod ; then
cp
-f $base/lib/omp_lib.mod $base/include/omp_lib.mod
fi
if test -f
$base/lib/omp_lib_kinds.mod ; then
cp -f $base/lib/omp_lib_kinds.mod
$base/include/omp_lib_kinds.mod
fi
quit 0

将此修改过的文件保存到另一位置,为下一步做好准备,在这里,重要的一点是要将此makelocal设置为可执行文件,否则重新安装后PGI在运行过程中会出现“需要运行makelocal来完成安装的提示”。然后用修改过的文件替换原始的解压缩后的PGI安装文件的相应的makelocal文件,重新安装PGI,就可以了!

时间: 2024-10-18 13:22:11

PGI安装时出现ERROR: unknown glibc version (2.4),的解决方法的相关文章

在WSL中安装swool报错 error: unrecognized command line option &#39;-V&#39; 的解决方法

Windows Subsystem for Linux Ubuntu中使用pecl安装swool时遇到错误"error: C compiler cannot create executables"."error: unrecognized command line option '-V'" 解决方法 先看解决方法, 将gcc版本降低到4.8即可,因为高版本gcc取消了-V参数: sudo apt install gcc-4.8 -y sudo update-alte

YUM安装提示PYCURL ERROR 6 - "Couldn&#39;t错误的解决办法

当编译PHP时出现如下错误时,找不到头绪 这时,打开DNS   vim /etc/resolv.conf   添加一行nameserver 192.168.1.1 完成上一步,则解决该问题 YUM安装提示PYCURL ERROR 6 - "Couldn't错误的解决办法

androidstudio打包时出现错误Error:Execution failed for task &#39;:app:transformClassesWithDexForRelease&#39;解决方法

今天在android studio上打包项目时,遇到了Error:Execution failed for task ':app:transformClassesWithDexForRelease这么个错误,记得之前也遇到过这种问题,却如何想不起怎么解决的,只好再次在网上查资料,总算是解决了 这个问题的原因倒是简单的很,是因为我项目中应用的jar包重复,我在build.gradle文件的dependencies中重复依赖了libs下的jar包,将下边的删除即可 androidstudio打包时出

在执行ab压力测试时出现socket: Too many open files (24)的解决方法

当入行压力测试时出现下列错误 [[email protected] ~]# ab -n 3000 -c 3000 http://192.168.0.2/This is ApacheBench, Version 2.3 <$Revision: 655654 $>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, htt

xp 中的IIS安装成功之后,访问网页显示没有权限访问解决方法

在做xp的IIS发布网站时遇到一个问题就是当你访问网站的时候,显示没有权限访问网站,但是我已经开启了匿名访问网站了,怎么还没有权限访问呢?后来经过上网搜资料解决,当时很多网上都说没打开匿名访问,当时我就仔细查看了一下,我又点开网站的目录安全性,查看匿名访问是否被选中,当时我点进去之后发现匿名访问已经被选中了啊.为什么还不能上呢.后来我才发现原来是因为匿名访问的用户错了,一开始安装的IIS的匿名访问用户是7BKSBRPUUJY1Z9N\IWAM_7BKSBRPUUJY1Z9N,主要是IWAM账号是

win8换win7安装之选中的的磁盘采用GPT分区形式解决方法

今天被坑了,给一个同事安装win8系统时,到一半说不能安装在GPT分区上面,下面讲如何解决: 把GPT磁盘转换为MBR磁盘,安装系统到提示你不能安装在那个磁盘的一步, 在选择分区界面,按下SHIFT+F10调出命令提示符 键入 diskpart 打开diskpart工具 ★选择目标磁盘 list disk--------------------列出系统拥有的磁盘 select disk 0 --------------选择0号磁盘,请根据磁盘大小,自行判断你的目标磁盘 ★清空目标磁盘,并转换为M

开发JAVA9以上的项目时,出现ClassNotFoundException: javax.xml.bind.JAXBException的解决方法

一.问题描述: 开发JAVA9以上的项目时,出现ClassNotFoundException: javax.xml.bind.JAXBException的解决方法 二.问题样例 三.解决方案 打开mvnrepository搜索jaxb打开第1个,然后即(http://mvnrepository.com/artifact/javax.xml.bind/jaxb-api/2.3.0)然后复制下列内容到Maven项目的pom.xml的dependences中. <dependency> <gr

使用ZjDroid时出现了R.java不存在的错误解决方法

ZjDroid是什么? 请看这篇文章: Android动态逆向分析工具ZjDroid--脱壳神器 今天第一次使用这个的时候出现了下图所示的错误: 提示:import com.android.reverse.R;没有这个类 之后clean了之后再从新build还是没有出现,gen文件夹下依然没有R.java这个文件. 之后选择Android tools 选择fix project properties之后还是没有效果. 试了一天仍然没有解决,之后我跟新了一下Android SDK tools,之前

Python安装模块出错(ImportError: No module named setuptools)解决方法

Python安装模块出错(ImportError: No module named setuptools)解决方法 (   言 Python第三方模块中一般会自带setup.py文件,在Windows环境下,我们只需要使用命令 cd c:\Temp\foo python setup.py install 两个命令就可以完成第三方模块的安装了.第一个cd命令将当前目前切换到待安装的第三方模块的目录下(这里假设第三方模块解压后的目录为c:\Temp\foo),第二个命令就执行安装了.安装的过程中可能