Bug 137285

Summary: Blas/Lapack library doesn't link with g++
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Petra Kudova <petra>
Component: DevelopmentAssignee: Philipp Thomas <pth>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: i686   
OS: Other   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Example of (almost empty) code that doesn't link.

Description Petra Kudova 2005-12-06 22:02:03 UTC
I use Lapack library to link to my c++ code, see attachment for a simple
example.

This example worked in SUSE 9.2, but in SUSE 10.0 
I get 
g++ main.cc -lblas -llapack 
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../libblas.so: undefined reference to `_gfortran_st_write'
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../liblapack.so: undefined reference to `_gfortran_pow_r8_i4'
.....
collect2: ld returned 1 exit status
make: *** [all] Error 1
Comment 1 Petra Kudova 2005-12-06 22:04:24 UTC
Created attachment 59963 [details]
Example of (almost empty) code that doesn't link.
Comment 2 Philipp Thomas 2005-12-07 10:46:29 UTC
Adding -lgfortran to the link command, i.e. using -lblas -llapack -lgfortran (this needs the gcc-fortran package to be installed) should fix this.

The reason for the change is, that SUSE Linux 9.2 contained gcc 3.3.4 which had
f77 as a fortran compiler. Now SUSE Linux 10.0 uses gcc 4.0.2 which in turn uses gfortran instead of f77.