[Rd] Bug in configure script for Solaris v9 arch with libsunperf (PR#2530)

m.pacey@lancaster.ac.uk m.pacey@lancaster.ac.uk
Tue Feb 4 17:54:41 2003

System details: 

Sun Blade 1000, Solaris 8, Sun ONE Compiler Suite (rebranded Forte 7), R
versions 1.6.0 and 1.6.2 - suspect others are affected, too

Problem description: 

Using the recommended env var setting from p.15 of the Admin Guide, the
configure script fails the sgemm sunperf test, even though the sunperf
libraries are available

Not linking with libsunperf causes drastic performance hits on some simple
benchmarks I've tried (e.g. matrix multiplication can take up to 100 times as
long for a sufficiently large matrix (n=5000))


Configure script should use the recommended flag for inclusion of the Sun
Performance Library: -xlic_lib=sunperf (ironically, the configure script sets
this flag up if the sgemm sunperf test passes!).

Quick fix: Add the recommended flag to the compiler env vars


I'm setting the following env vars before running configure, as per the admin

export PATH=/usr/ccs/bin:$PATH
export CC="cc -xarch=v9"
export CFLAGS="-xO5 -xlibmil -dalign"
export F77="f95 -xarch=v9"
export FFLAGS="-xO5 -xlibmil -dalign"
export CXX="CC"
export CXXFLAGS="-xO5 -xlibmil -dalign"

Config.log reports the following:

configure:19929: checking for sgemm_ in -lsunperf
configure:19966: cc -xarch=v9 -o conftest -xO5 -xlibmil -dalign
-I/usr/local/include -L/usr/local/
lib conftest.c -lsunperf -lsunmath -lnsl -lsocket -lreadline -ldl -ltermcap -lm
 -lreadline -ldl -ltermcap -lm
-R/usr/local/packages/SUNWspro/lib/v9:/opt/SUNWspro/lib/v9 -L/usr/l
ocal/packages/SUNWspro/lib/v9 -L/usr/local/packages/SUNWspro/prod/lib/v9
-L/usr/ccs/lib/sparcv9 -L
/usr/lib/sparcv9 -lfui -lfai -lfai2 -lfsumai -lfprodai -lfminlai -lfmaxlai
-lfminvai -lfmaxvai -lf
su -lsunmath >&5
Undefined                       first referenced
 symbol                             in file
ld: fatal: Symbol referencing errors. No output written to conftest

Problem is the v9 version seems to require stack_grow(); the xlic_lib=sunperf
does the extra linking work required:

fs% cc -xarch=v9 sgemm.c -xlic_lib=sunperf -#
### Note: NLSPATH =
###     command line files and options (expanded):
### -xarch=v9 sgemm.c -xlic_lib=sunperf
/usr/local/bin/../packages/SUNWspro/bin/../prod/bin/acomp -i sgemm.c -y-fbe
-y/usr/local/bin/../packages/SUNWspro/bin/../prod/bin/fbe -y-xarch=v9 -y-o
-ysgemm.o -y-s -y-verbose -y-xmemalign=8s -xarch=v9 -fparam_ir -Qy
-D__SunOS_5_8 -D__SUNPRO_C=0x540 -D__SVR4 -D__unix -D__sun -D__sparcv9
-Dsparc -D__RESTRICT -I/usr/local/packages/SUNWspro/prod/include/cc
"-g/usr/local/bin/../packages/SUNWspro/bin/../prod/bin/cc -xarch=v9
-xlic_lib=sunperf -c " -D__SUN_PREFETCH -destination_ir=yabe
### Note: LD_LIBRARY_PATH_64 = /usr/lib/sparcv9:/usr/local/lib/sparcv9
### Note: LD_RUN_PATH = <null>
/usr/ccs/bin/ld /usr/local/packages/SUNWspro/prod/lib/v9/crti.o
/usr/local/packages/SUNWspro/prod/lib/v9/stack_grow.o sgemm.o -lsunperf -lfui
-lfai -lfsu -lsunmath -lm -Y
:/usr/ccs/lib/sparcv9:/usr/lib/sparcv9" -Qy
"-R/usr/local/packages/SUNWspro/lib/v9:/opt/SUNWspro/lib/v9" -lc -Bdynamic -ldl


Dr Mike Pacey,                         Email: M.Pacey@lancaster.ac.uk
High Performance Systems Support,      Phone: 01524 593543
Information Systems Services,            Fax: 01524 844001
Lancaster University,
Lancaster LA1 4YW