- 积分
- 205
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-9-12
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2014-5-7 19:55:58
|
显示全部楼层
存在的啊,显示是这样的:
virtual-machine:/usr/lib/gcc/i686-linux-gnu$ ls
4.6 4.6.3 #4.6是蓝色,4.6.3是绿色
我把上面makelocalrc文件红色那部分都改为反引号了,再次执行就出来一大堆停不下来的东西,一直在重复include-g23,我的makelocalrc文件是这样的:
#! /bin/sh
##
## Copyright 1990-2000, The Portland Group, Incorporated.
## Copyright 2000-2006, 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.
##
##
## makelocalrc
## [installdir]
## [-n|-x|-o]
## [-net shared-directory]
## [-gcc gcccommand]
## [-g77 g77command]
## [-l licensefile]
## [-d outputdir]
## The following are for the CDK
## [-mpi1]
## [-mpi1dir dir]
## [-mpi2]
## [-mpi2dir dir]
## [-mvapich]
## [-mvapichdir dir]
## [-ofeddir dir]
##
# Just in case, add /usr/bin and /bin to PATH
PATH=/usr/bin:/bin:$PATH
LANG=en_US.UTF-8
# set TMPDIR if environment variable $TMPDIR is not set
TMPDIR=${TMPDIR:-/tmp}
# Print usage information, then quit
usage() {
echo "Usage: $0 [installdir] [switches]..."
echo "installdir the directory where the PGI compilers are installed"
echo "-d outdir directory to put localrc; default is installdir"
echo "-n show the install information, do not write a localrc file"
echo "-o create the localrc file and write to stdout"
echo "-x write the localrc file and place in outputdir"
echo "-l lic flexlm license file to add to localrc"
echo "-gcc gcc gcc command name; default is gcc"
echo "-g77 g77 g77 command name; default is g77"
echo "-net locdir perform network install with named local directory"
# echo "-mpi1 set default MPIDIR for MPICH"
# echo "-mpi1dir dir set MPIDIR directory for MPICH"
# echo "-mpi2 set default MPI2DIR for MPICH-2"
# echo "-mpi2dir dir set MPI2DIR directory for MPICH-2"
# echo "-mvapich set default MPIVDIR for MVAPICH"
# echo "-mvapichdir dir set MPIVDIR directory for MVAPICH"
# echo "-ofeddir dir set OFEDLIBDIR for Open Fabrics library"
echo
echo "Example: $0 -x /usr/pgi/linux86/7.0"
quit 1
}
# Clean up scratch files and exit
quit() {
rm -rf "$scratch"
exit $1
}
# Copy files using tar to preserve permissions and dates
# $1 is source dir, $2 is destination dir
# $1 may be in a relative path, $2 must be a full path
copy_files() {
if test -n "$1"; then
if test -d "$1"; then
if test ! -d $2 ; then
mkdir $2
fi
if test "$version" = "dev" -o "$version" = "mine" ; then
( cd $1 ; tar cf - * | ( cd $2; tar xpf - ))
else
( cd $1 ; tar chf - * | ( cd $2; tar xpf - ))
fi
fi
fi
}
# Copy a single file using tar to preserve permissions and dates
# $1 is source file, $2 is destination file
# $1 may be in a relative path, $2 must be a full path
# if $linkfiles is set, use symbolic links instead
linkfiles=
copy_one_file() {
if test -n "$1"; then
if test -f "$1"; then
b1=`dirname $1`
f1=`basename $1`
b2=`dirname $2`
f2=`basename $2`
if test ! -d $b2 ; then
mkdir $b2
else
rm -f $b2/$f2
fi
if test -n "$linkfiles" ; then
( cd $b1 ; b1=`pwd` ; cd $b2 ; ln -s $b1/$f1 $f2 )
else
( cd $b1 ; tar chf - $f1 | ( cd $b2; tar xpf - ))
( cd $b2 ; if test "$f1" != "$f2" ; then mv -f "$f1" "$f2" ; fi )
fi
fi
fi
}
# Print with columns line up
pretty_print() {
echo $@ | awk -F^ '{printf("%20-s %s\n",$1,$2);}'
}
# Print a line to the localrc file
print_line() {
echo $1 $2 $3 $4 $5 $6 >> $newrc
}
# Determine the GNU LIBC version.
get_glibc_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' | sed -e 's/.*version //' -e 's/,/ /' | awk '{print $1}'`
if test -n "$x" ; then
GLIBC_VERSION=2.4.4
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
}
# recursively create a directory tree
builddir() {
local sdir
sdir="$1"
if test -d "$sdir" ; then
if test ! -w "$sdir" ; then
echo Directory "$sdir" is not writeable.
quit 1
fi
return
fi
pdir=`dirname "$sdir"`
if test "$pdir" = "$sdir" ; then
echo Cannot create topmost directory "$pdir"
quit 1
fi
builddir "$pdir"
mkdir "$sdir"
if test $? -ne 0 ; then
echo Could not make directory "$sdir"
quit 1
fi
}
# 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
# noexec is set to not generate localrc
noexec=
# ofile is set to print localrc to stdout
ofile=0
# check_crt_files is set for a 64-bit install
# when we have to check whether 32-bit is available
check_crt_files=0
# set_hammer_empty is set for a 32-bit install, to set $HAMMER to empty
set_hammer_empty=0
# gcc, g77, gfortran are names of gcc, g77, gfortran
gcc=gcc
g77=g77
gfortran=gfortran
# start is the directory of the compilers being installed
# default value is the directory containing this script
start=
# license is name of flexlm license file, from command line
license=
# network is set if this is a network install
# locdir is the local directory
network=0
locdir=
locdirused=
locdir64used=
# outputdir is directory into which to put rcfile
# default is to put in bin directory(ies)
outputdir=
# mpich1 is directory to which to set MPIDIR, or '1' for default
mpich1=
# mpich2 is directory to which to set MPI2DIR, or '1' for default
mpich2=
# mvapich is directory to which to set MPIVDIR, or '1' for default
mvapich=
# ofedlibdir is directory to which to set OFEDLIBDIR
ofedlibdir=
# scratch is scratch directory
if test ! -d $TMPDIR ; then
echo Temporary directory $TMPDIR was not found.
echo Check the value of your environment variable TMPDIR.
quit 1
elif test ! -w $TMPDIR ; then
echo Temporary directory $TMPDIR is not writeable.
echo Check the value of your environment variable TMPDIR.
quit 1
fi
scratch=$TMPDIR/PGI-INSTALL.$$
if test ! -d "$scratch" ; then
mkdir "$scratch"
if test $? -ne 0 ; then
echo "Could not make scratch directory $scratch."
echo "Check the value of your environment variable TMPDIR."
quit 1
fi
fi
# parse command line
while test -n "$1"; do # {
case "$1" in
-n ) noexec=1 ;;
-x ) noexec=0 ;;
-o ) ofile=1 ; noexec=0 ;;
-l ) shift; license="$1" ;;
-d ) shift; outputdir="$1" ;;
-net ) shift; locdir="$1"; network=1 ;;
-lnet) locdir= ; network=1 ;; # undocumented, internal testing only
-link) linkfiles=1 ;; # undocumented, internal testing only
-gcc ) shift; gcc="$1" ;;
-g77 ) shift; g77="$1" ;;
-mpi1) mpich1=1 ;;
-mpi1dir) shift ; mpich1="$1" ;;
-mpi2) mpich2=1 ;;
-mpi2dir) shift ; mpich2="$1" ;;
-mvapich) mvapich=1 ;;
-mvapichdir) shift ; mvapich="$1" ;;
-ofeddir) shift; ofedlibdir="$1" ;;
* ) start="$1" ;;
esac
shift
done # }
if test -z "$start" -a -z "$noexec" ; then
# makelocalrc by itself isn't enough
# makelocalrc -x by itself uses makelocalrc directory as start
usage
fi
if test -z "$noexec" ; then
# default is noexec
noexec=1
fi
if test -z "$start" ; then
# default for 'start' is directory containing pginstall
start=`dirname $0`
fi
if test ! -d "$start" ; then
echo "$0: $start: directory not found"
usage
fi
if test "$start" = "." ; then
start=`pwd`
fi
if test "$outputdir" = "." ; then
outputdir=`pwd`
fi
# resolve any relative directories for start, outputdir, license
cwd=`pwd`
cd "$start"
start=`pwd`
cd $cwd
# in case $start is the bin directory, go to parent
startdir=`basename "$start"`
if test "$startdir" = "bin" ; then
start=`dirname "$start"`
fi
if test -n "$outputdir" ; then # {
if test ! -d "$outputdir "; then
echo "ERROR: output directory $outputdir not found"
quit 1
fi
cd "$outputdir"
outputdir=`pwd`
cd $cwd
else # }else{
if test -d "$start/"bin ; then
outputdir="$start"/bin
else
echo "ERROR: output directory $start/bin not found"
quit 1
fi
fi # }
if test -n "$license" ; then # {
if test ! -f "$license" ; then
echo "$0: $license: file not found"
usage
fi
licensedir=`dirname $license`
licensefile=`basename $license`
if test ! -d "$licensedir" ; then
echo "ERROR: License file directory $licensedir not found"
quit 1
fi
cd $licensedir
licensedir=`pwd`
cd $cwd
license=$licensedir/$licensefile
fi # }
# Example:
# start = /usr/pgi/linux86/7.0
# installdir = /usr/pgi/linux86
# version = 7.0
# base = /usr/pgi/linux86/7.0
# target = linux86
base="$start"
installdir=`dirname "$start"`
version=`basename "$start"`
target=`basename $installdir`
pgidir=`dirname $installdir`
# 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
oem="32-bit target on x86-64 Linux"
;;
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
oem="32-bit target on x86 Linux"
;;
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
oem="64-bit target on x86-64 Linux"
;;
linux86-64a:x86_64 )
gccopt="-o $scratch/a.out -v"
g77opt=$gccopt
lib=/lib64
usrlib=/usr/lib64
install_64_bit=1
use_64bit_rcfiles=0
oem="64-bit target on x86-64 Linux"
;;
linux86-64:* )
echo "ERROR: target doesn't match architecture"
exit 1
;;
* )
echo "ERROR: unexpected target:$target and architecture:$arch combination"
exit 1
;;
esac # }
if test $network -eq 0 ; then
# localrc file name
localrcname=localrc
else
# localrc.host file name
hostname=`hostname -s`
localrcname=localrc.$hostname
if test $noexec -eq 0 -a -n "$locdir" ; then
# turn locdir into full path, if it isn't
cd $cwd
cd $locdir
locdir=`pwd`
builddir "$locdir"
cd $cwd
fi
fi
localrc="$outputdir"/$localrcname
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, for normal
# install, or the appropriate include and lib directories are put
# on the include/lib path for network install.
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
# These are in numerical order to catch newer versions at the end
case "$GLIBC_VERSION" in # {
0.* | 1.*)
echo "ERROR: glibc version ($GLIBC_VERSION) is no longer supported."
quit 1
;;
2.0.* | 2.0.* | 2.2.*)
echo "ERROR: glibc version ($GLIBC_VERSION) is no longer supported."
quit 1
;;
2.3.* )
glibc=232
LIB=lib-linux86-g232
LIBLF=$LIB-lf
INC=include-g23
;;
2.[4-9]* )
glibc=244
LIB=lib-linux86-g232
LIBLF=$LIB-lf
INC=include-g23
;;
2.1[0-9]* )
glibc=215
LIB=lib-linux86-g232
LIBLF=$LIB-lf
INC=include-g23
;;
2.* )
echo "Unknown glibc version ($GLIBC_VERSION); treating like 2.4"
glibc=232
LIB=lib-linux86-g232
LIBLF=$LIB-lf
INC=include-g23
;;
* )
echo "ERROR: unknown glibc version ($GLIBC_VERSION)."
quit 1
;;
esac # }
cd "$start"
if test ! -d "$LIB" ; then
LIB=
fi
if test ! -d "$LIBLF" ; then
LIBLF=
fi
if test ! -d "$INC" ; then
INC=
fi
# 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 's/\/$//' -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`
gccv="$gccversion"
case "$gccv" in
*.*.*)
;;
*) gccv="$gccv"01
esac
gccversionvalue=`echo $gccv | sed -e 's/\./0/g'`
# 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 or the gfortran libraries,
# so look for the g77 libs.
which "$g77" >/dev/null 2>&1
if test $? -eq 1 ; then # {
G77DIR='""'
else # }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 # }
# Which gfortran? Look for the gfortran libs.
if test $G77DIR = '""' ; then # {
which "$gfortran" >/dev/null 2>&1
if test $? -eq 1 ; then
G77DIR='""'
else
out="$scratch"/g77run.$$
"$gfortran" $g77opt "$ffile" > "$out" 2>&1
libgcc=`"$gfortran" -print-libgcc-file-name`
g77base=`"$gfortran" -print-search-dirs | sed -e 's/^install: //' -e 1q`
if test -d "$g77base"$subdir ; then
G77DIR="$g77base$subdir"
else
G77DIR='""'
fi
g2c=`cat "$out" | grep lgfortran`
if test -n "$g2c" ; then
G77LIB="-lgfortran"
fi
fi
fi # }
if test -n "$G77LIB" ; then
print_line "set LFC=$G77LIB;"
fi
# Which dynamic linker?
print_line "set LDSO=$LINKER;"
# 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;"
print_line "set OEM_INFO=$oem \$INFOTPVAL;"
has_sched_setaffinity=0
x="$base"
x=`echo "$x" | sed -e 's/.*86-64.*/86-64/'`
if test "$x" = "86-64" ; then
libso=libso
setaff_m32=
else
libso=lib
setaff_m32='-m32'
fi
# Make symlink libpgnuma.so to system libnuma.so?
syslibnuma=0
if test -e $usrlib/libnuma.so ; then
print_line "set NUMALIBS=-lnuma ;"
syslibnuma=1
fi
# test whether sched_setaffinity exists and works here
sfile="$scratch"/sched-$$.c
sofile="$scratch"/sched-out
gccsopt="$setaff_m32 -o $sofile"
out="$scratch"/sched.$$
cat > "$sfile" <<EOF_SCHED_C
#include <sched.h>
extern void exit(int);
extern void perror(const char*);
extern int getpid(void);
static void
_mp_bind(int lcpu)
{
long mask;
mask = 1<<lcpu;
if(sched_setaffinity(getpid(),sizeof(mask),&mask)==-1){
perror("init_pthr: sched_setaffinity");
exit(1);
}
}
int
main()
{
_mp_bind(0);
}
EOF_SCHED_C
"$gcc" $gccsopt "$sfile" > "$out" 2>&1
if test $? -ne 0 -o ! -x "$sofile" ; then
has_sched_setaffinity=0
else
"$sofile" >> "$out" 2>&1
if test -s "$out" ; then
has_sched_setaffinity=0
else
has_sched_setaffinity=1
fi
fi
print_line 'set LOCALRC=YES;'
# Make the necessary changes to meet glibc dependencies.
if test -n "$glibc" ; then # {
if test -n "$LIB" ; then
if test $network -eq 1 ; then
print_line "set COMPGLIBDIR=$LIB;"
if test -n "$locdir" ; then
locdirused=1
if test $noexec -eq 0 ; then
copy_one_file $LIB/libpgc.so $locdir/lib/libpgc.so
fi
fi
elif test $noexec -eq 0 ; then
copy_files $LIB $base/lib
fi
fi
case "$glibc" in # {
21* )
;;
2*) # default 2.2 and beyond
if test -n "$INC" ; then
if test $network -eq 1 ; then
print_line "set COMPGINCDIR=$INC;"
elif test $noexec -eq 0 ; then
copy_files $INC $base/include
fi
fi
print_line "set THROW=__THROW=;"
print_line "set EXTENSION=__extension__=;"
;;
esac # }
# Large file support.
if test -n "$LIBLF" ; then # {
if test $network -eq 1 ; then
print_line "set COMPGLIBLFDIR=$LIBLF;"
if test -n "$locdir" ; then
print_line "set LOCALCOMPLIBLF=$locdir/liblf;"
if test $noexec -eq 0 ; then
copy_one_file $LIBLF/libpgc.so $locdir/liblf/libpgc.so
fi
fi
elif test $noexec -eq 0 ; then
copy_files $LIBLF $base/liblf
fi
else # }else{
if test $network -eq 1 ; then
print_line "set COMPGLIBLFDIR=;"
elif test $noexec -eq 0 ; then
rm -rf $base/liblf
fi
fi # }
# Adjust header files based on the gcc version.
case "$gccversion" in # {
3.3* )
if test $network -eq 1 ; then
print_line "set COMPGCCINCDIR=include-gcc33;"
elif test $noexec -eq 0 ; then
copy_files $base/include-gcc33 $base/include
fi
;;
3.4* )
if test $network -eq 1 ; then
print_line "set COMPGCCINCDIR=include-gcc34;"
elif test $noexec -eq 0 ; then
copy_files $base/include-gcc34 $base/include
fi
;;
3.* )
;;
4.1* )
if test $network -eq 1 ; then
print_line "set COMPGCCINCDIR=include-gcc41;"
elif test $noexec -eq 0 ; then
copy_files $base/include-gcc41 $base/include
fi
;;
4.* )
if test $network -eq 1 ; then
print_line "set COMPGCCINCDIR=include-gcc40;"
elif test $noexec -eq 0 ; then
copy_files $base/include-gcc40 $base/include
fi
;;
* )
;;
esac # }
# Set LC
if test -e "$GCCDIR/libgcc_eh.a" ; then
print_line "set LC=\$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc);"
else
print_line "set LC=-lgcc -lc -lgcc;"
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
if test /usr/lib -ef /usr/lib64 ; then
print_line "set DEFLIBDIR=/usr/lib32;"
print_line "set DEFSTDOBJDIR=/usr/lib32;"
else
print_line "set DEFLIBDIR=/usr/lib;"
print_line "set DEFSTDOBJDIR=/usr/lib;"
print_line "set EXTRAASARGS=--32;"
fi
fi
fi
print_line "# GLIBC version $GLIBC_VERSION"
print_line "# GCC version $gccversion"
print_line "set GCCVERSION=$gccversionvalue;"
# Test if /usr/lib is a symlink
# if it points to 64-bit object then set DEFLIBDIR to /usr/lib32
if test -L /usr/lib; then
if test `file /usr/lib/crtn.o| sed -e 's/.*64.*/64/'` = '64'; then
print_line "set DEFLIBDIR=/usr/lib32;"
print_line "set DEFSTDOBJDIR=/usr/lib32;"
fi
fi
# For production non-network installations,
# recover some space by unneeded files.
if test "$version" != "dev" -a "$version" != "mine" -a $network -eq 0 ; then
rm -rf $base/include-g*
echo $GLIBC_VERSION > $base/glibc_version
fi
# Fix the 32/64-bit .*rc files.
# ###! Is this strictly necessary??
if test $noexec = 0 ; then # {
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
if test $network -eq 0 ; then
rm -f $base/bin/.pg*-32 > /dev/null 2>&1
fi
elif test $use_64bit_rcfiles -eq 10; then # }else if{
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
if test $network -eq 0 ; then
rm -f $base/bin/.pg*-64 > /dev/null 2>&1
fi
fi # }
# handle libnuma(libpgnuma), libpgbind
x=$base
x=`echo $x | sed -e 's/.*86-64.*/86-64/'`
if test "$x" = "86-64" ; then # {
if test $network -eq 0 ; then # {
if test "$syslibnuma" = "1" ; then
rm -rf $base/$libso/libnuma.*
rm -rf $base/lib/libnuma.*
else
rm -rf $base/$libso/libnuma*
rm -rf $base/lib/libnuma.*
ln -s $base/$libso/libpgnuma.so $base/$libso/libnuma.so.1
ln -s $base/$libso/libpgnuma.so $base/$libso/libnuma.so
ln -s $base/$libso/libpgnuma.so $base/lib/libnuma.so.1
ln -s $base/$libso/libpgnuma.so $base/lib/libnuma.so
fi
else # } else {
if test -n "$locdir" ; then
if test "$syslibnuma" = "1" ; then
rm -rf "$locdir"/lib64/libnuma.*
else
builddir "$locdir"/lib64
locdir64used=1
copy_one_file $base/libso/libpgnuma.so "$locdir"/lib64/libnuma.so
copy_one_file $base/libso/libpgnuma.so "$locdir"/lib64/libnuma.so.1
rm -rf $base/lib/libnuma.*
rm -rf $base/$libso/libnuma.*
fi
fi
fi # }
if test $network -eq 0 ; then # {
if test "$has_sched_setaffinity" = "1" ; then
cp -d $base/lib/libpgbind_real.a $base/lib/libpgbind.a
rm -rf $base/lib/libpgbind.so
if test -d $base/$libso ; then
ln -s $base/$libso/libpgbind.so $base/lib/libpgbind.so
cp -d $base/$libso/libpgbind_real.a $base/$libso/libpgbind.a
cp -d $base/$libso/libpgbind_real.so $base/$libso/libpgbind.so
fi
else
cp -d $base/lib/libpgbind_dum.a $base/lib/libpgbind.a
rm -rf $base/lib/libpgbind.so
ln -s $base/$libso/libpgbind.so $base/lib/libpgbind.so
if test -d $base/$libso ; then
cp -d $base/$libso/libpgbind_dum.a $base/$libso/libpgbind.a
cp -d $base/$libso/libpgbind_dum.so $base/$libso/libpgbind.so
fi
fi
else # } else {
if test -n "$locdir" ; then
builddir "$locdir"/lib64
locdir64used=1
if test "$has_sched_setaffinity" = "1" ; then
copy_one_file $base/lib/libpgbind_real.a "$locdir"/lib64/libpgbind.a
copy_one_file $base/libso/libpgbind_real.so "$locdir"/lib64/libpgbind.so
else
copy_one_file $base/lib/libpgbind_dum.a "$locdir"/lib64/libpgbind.a
copy_one_file $base/libso/libpgbind_dum.so "$locdir"/lib64/libpgbind.so
fi
fi
fi # }
if test "$version" != "dev" -a "$version" != "mine" -a $network -eq 0 ; then
# clean up libpgbind_*
rm -f $base/lib/libpgbind_*.a
rm -f $base/lib/libpgbind_*.so
if test -d $base/$libso ; then
rm -f $base/$libso/libpgbind_*.a
rm -f $base/$libso/libpgbind_*.so
fi
fi
else # } else {
if test $network -eq 0 ; then # {
if test "$syslibnuma" = "1" ; then
rm -rf $base/lib/libnuma.*
else
rm -rf $base/lib/libnuma.*
ln -s $base/lib/libpgnuma.so $base/lib/libnuma.so.1
ln -s $base/lib/libpgnuma.so $base/lib/libnuma.so
fi
else # } else {
if test -n "$locdir" ; then
if test "$syslibnuma" = "1" ; then
rm -rf "$locdir"/lib/libnuma.*
else
locdirused=1
copy_one_file $base/lib/libpgnuma.so "$locdir"/lib/libnuma.so
copy_one_file $base/lib/libpgnuma.so "$locdir"/lib/libnuma.so.1
rm -rf $base/lib/libnuma.*
fi
fi
fi # }
if test $network -eq 0 ; then # {
if test "$has_sched_setaffinity" = "1" ; then
cp -d $base/lib/libpgbind_real.a $base/lib/libpgbind.a
cp -d $base/lib/libpgbind_real.so $base/lib/libpgbind.so
else
cp -d $base/lib/libpgbind_dum.a $base/lib/libpgbind.a
cp -d $base/lib/libpgbind_dum.so $base/lib/libpgbind.so
fi
else # } else {
if test -n "$locdir" ; then
builddir "$locdir"/lib
locdirused=1
if test "$has_sched_setaffinity" = "1" ; then
copy_one_file $base/lib/libpgbind_real.a "$locdir"/lib/libpgbind.a
copy_one_file $base/lib/libpgbind_real.so "$locdir"/lib/libpgbind.so
else
copy_one_file $base/lib/libpgbind_dum.a "$locdir"/lib/libpgbind.a
copy_one_file $base/lib/libpgbind_dum.so "$locdir"/lib/libpgbind.so
fi
fi
fi # }
if test "$version" != "dev" -a "$version" != "mine" -a $network -eq 0 ; then
# clean up libpgbind_*
rm -f $base/lib/libpgbind_*.a
rm -f $base/lib/libpgbind_*.so
if test -d $base/$libso ; then
rm -f $base/$libso/libpgbind_*.a
rm -f $base/$libso/libpgbind_*.so
fi
fi
fi # }
fi # }
fi # }
if test -n "$locdirused" ; then
print_line "set LOCALCOMPLIB=$locdir/lib;"
elif test -n "$locdir64used" ; then
print_line "set LOCALCOMPLIB=$locdir/lib64;"
fi
# Add license file to LM_LICENSE_FILE
if test -n "$license" ; then
print_line "variable LM_LICENSE_FILE is environment(LM_LICENSE_FILE);"
# note single quotes below, dollar signs must be output here
print_line 'export LM_LICENSE_FILE=$if($notequal($LM_LICENSE_FILE,),$LM_LICENSE_FILE:)'$license";"
fi
print_line "export PGI=$pgidir;"
# MPI settings
if test "$mpich1" = "1" ; then
mpich1="$base/mpi/mpich";
fi
if test "$mpich2" = "1" ; then
mpich2="$base/mpi2/mpich";
fi
if test "$mvapich" = "1" ; then
mvapich="$base/mpi/mvapich";
fi
if test -n "$mpich1" ; then
print_line "set MPIDIR=$mpich1;"
fi
if test -n "$mpich2" ; then
print_line "set MPI2DIR=$mpich2;"
fi
if test -n "$mvapich" ; then
print_line "set MPIVDIR=$mvapich;"
fi
if test -n "$ofedlibdir" ; then
print_line "set OFEDLIBDIR=$ofedlibdir;"
fi
# Add timestamp and username.
print_line '# makelocalrc executed by ' `whoami` `date`
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
pretty_print 'GCC version' ^ $gccversion
if test -n "$GLIBC_VERSION" ; then
pretty_print 'GNU LIBC 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
pretty_print 'Threads' ^ "$usrlib/libpthread.{a,so}"
if test "$syslibnuma" = "1" ; then
pretty_print 'system libnuma.a ' ^ 'exists'
fi
if test "$has_sched_setaffinity" = "1" ; then
pretty_print 'sched_setaffinity ' ^ 'works'
else
pretty_print 'sched_setaffinity ' ^ 'fails'
fi
if test -f $localrc ; then
if diff -I'^#.*' $newrc $localrc > /dev/null ; then
pretty_print $localrcname ^ "exists and is the same"
else
pretty_print $localrcname ^ "exists and is different"
if test ! -w "$outputdir" ; then
pretty_print "$outputdir" ^ "is not writable"
fi
fi
else
pretty_print $localrcname ^ "does not exist"
if test ! -w "$outputdir" ; then
pretty_print "PATH entry" ^ "is not writable"
fi
fi
fi # }
# If $ofile is set, then display the file to stdout. Otherwise, write
# it to $localrc.
if test $ofile -eq 1 ; then
echo "##### $localrcname contents #####"
cat $newrc
echo "############################"
rm -f $newrc
elif test $noexec -eq 1 ; then
quit 0
elif test ! -w "$outputdir" ; then
echo "$outputdir" is not writable
rm -f $newrc
else
if test -f $localrc ; then
if diff -I'^#.*' $newrc $localrc > /dev/null ; then
echo $localrcname has not changed
fi
if mv -f $localrc $localrc.bak ; then
if chmod -f 0644 $localrc.bak ; then
f=f
else
echo Error setting permission for backup version of $localrc
fi
else
echo Error saving backup version of $localrc
fi
fi
if mv -f $newrc $localrc ; then
if chmod -f 0644 $localrc ; then
f=f
else
echo Error setting permission for $localrc
fi
else
echo Error creating $localrc
rm -f $newrc
fi
fi
quit 0 |
|