PGI installation error: Unknown glibc version (2.4), Solution

Source: Internet
Author: User

When installing PGI, I encountered the error: Unknown glibc version (2.4). After some suggestions, I finally successfully completed the installation.

It's really nice to watch PGI work smoothly. Here I will share my experience with you.

Take my PGI-7.1.4 as an example, the first installation after the above error, but found that the PGI file has been successfully written to the specified area, find the makelocal file in/linux86/7.1/in the installation path (/home/name/PGI/) and change it as follows:

The modified makelocalrc is as follows (the modified part is marked with a comment of the entire President ):

#! /Bin/sh
##
# Copyright 1990-2000, the Portland group, inmarshated.
# Copyright 2000-2005, STMicroelectronics, inreceivated.
# All Rights Reserved.
##
# STMicroelectronics, ininitialized 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 compression t in accordance with the terms of that
# Agreement.
##

# Just In Case
Path =/usr/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 # shocould only exist on a 64-bit Linux OS.
Elif test-r/lib/libc. so.6; then
Libc =/lib/libc. so.6 # shocould 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 # It turns out to be "$ X"
Else
Glibc_version = 2.4.4 # It was originally empty
######################################## ######################################## ########
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 shocould 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) # This is actually added as long as you change glibc_version
Glibc = 232 # corresponding to the later version in the brackets above
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" ## original
#### Fi
#### Gccversion = '$ gcc-dumpversion'
######################################## ###############################
Libgcc = '$ gcc-print-libgcc-file-name'
Gccbase = 'dirname $ libgcc'
Gccdir = "$ gccbase $ subdir" # self-added
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 libmp ich..

If test-F "$ base/bin/mpirun"; then
Print_line "set mpilib = $ base/LIB ;"
Mpilib = $ base/lib/libmp ich.
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
# 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.
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 instils.

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

# Fixed 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 ''whoam'' 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. 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

Save the modified file to another location and prepare for the next step. Here, it is important to set the makelocal as an executable file, otherwise, after the PGI is re-installed, a message "you need to run makelocal to complete installation" appears during the running process ". Then replace the makelocal file of the original decompressed PGI installation file with the modified file and reinstall PGI!

 

PGI installation error: Unknown glibc version (2.4), Solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.