Bug 24993 - LAPACK builds but dies in the testsuite
Summary: LAPACK builds but dies in the testsuite
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-22 22:28 UTC by ronis
Modified: 2006-05-30 04:04 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ronis 2005-11-22 22:28:08 UTC
I recently upgraded form gcc-3.4.4 to 4.0.2 on an athlon-mp box.   I have a c++ program that links to lapack (which was built some time ago under the 3.4.x series).  I use g77 to link the final objects together; however after upgrading, (and switching g77->gfortran) the link died, basically because of unresolved externals in lapack (things like s_copy s_cmp).   I'm pretty sure that this is merely something changed in gfortran's libraries.  

I've tried rebuilding lapack using gfortran (both as the compiler and as a loader).  I'm getting large numbers of testsuite failuers and worse, SIGSEGV's on some of the test 
routines. 

Here's my make.inc file for lapack (I've played around with some of the optimization flags, but so far, no differences have shown up):

####################################################################
#  LAPACK make include file.                                       #
#  LAPACK, Version 3.0                                             #
#  June 30, 1999                                                  #
####################################################################
#
SHELL = /bin/sh
#
#  The machine (platform) identifier to append to the library names
#
PLAT = _LINUX
#  
#  Modify the FORTRAN and OPTS definitions to refer to the
#  compiler and desired compiler options for your machine.  NOOPT
#  refers to the compiler options desired when NO OPTIMIZATION is
#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
#  desired load options for your machine.
#
FORTRAN  = /usr/bin/gfortran
#OPTS     = -O2 -march=athlon-mp -funroll-loops -fomit-frame-pointer
OPTS     = -O3 -march=athlon-mp -funroll-loops -fomit-frame-pointer
DRVOPTS  = $(OPTS)
NOOPT    =
LOADER   = /usr/bin/gfortran -lm -lieee
LOADOPTS =
#
#  The archiver and the flag(s) to use when building archive (library)
#  If you system has no ranlib, set RANLIB = echo.
#
ARCH     = ar
ARCHFLAGS= cr
RANLIB   = ranlib
#
#  The location of the libraries to which you will link.  (The 
#  machine-specific, optimized BLAS library should be used whenever
#  possible.)
#
BLASDIR      = /home/ronis/Project/notar/LAPACK/BLAS/SRC
#BLASLIB      = $(BLASDIR)/strsm.o $(BLASDIR)/dtrsm.o $(BLASDIR)/ctrsm.o $(BLASDIR)/ztrsm.o -lcblas -lf77blas -latlas
BLASLIB      = -lcblas -lf77blas -latlas
LAPACKLIB    = lapack$(PLAT).a
TMGLIB       = tmglib$(PLAT).a
EIGSRCLIB    = eigsrc$(PLAT).a
LINSRCLIB    = linsrc$(PLAT).a

Here's some relevant information for the test:

Testing COMPLEX LAPACK linear equation routines
./xlintstc < ctest.in > ctest.out 2>&1
/bin/sh: line 1: 21807 Segmentation fault      (core dumped) ./xlintstc <ctest.in >ctest.out 2>&1

ctest.out is empty.   There are other testsuite failures:

grep fail *.out gives:

cgd.out: CGV drivers:     62 out of   1092 tests failed to pass the threshold
dgd.out: DGV drivers:      9 out of   1092 tests failed to pass the threshold
dgd.out: DXV drivers:    200 out of   5000 tests failed to pass the threshold
dgg.out: DGG:    1 out of  2177 tests failed to pass the threshold
sgd.out: SGV drivers:     10 out of   1092 tests failed to pass the threshold
sgd.out: SXV drivers:     37 out of   5000 tests failed to pass the threshold
ssep.out: SST drivers:      1 out of  14256 tests failed to pass the threshold
ssvd.out: SBD:      1 out of   5510 tests failed to pass the threshold
zgd.out: ZGV drivers:     63 out of   1092 tests failed to pass the threshold


This may be related to the flags I've used.
Comment 1 kargls 2005-11-23 01:22:37 UTC
Have you read http://www.netlib.org/lapack/faq.html#1.23?
Did you update your blas?  A scan of the libgfortran source
tree shows no references to s_copy or s_cmp.  Try pipe with
only -O as the only flag.  You may also wwant to update to
a gfortran binary from the wiki.
Comment 2 Toon Moene 2006-03-31 11:24:48 UTC
Could you retry this with gfortran 4.1 (now that it is out) ?

Thanks.
Comment 3 Jerry DeLisle 2006-05-05 05:37:33 UTC
I would like to propose we close this bug.  LAPACK has been working fine since 4.1. Any objections?
Comment 4 Jerry DeLisle 2006-05-30 04:04:18 UTC
No onjections.