Bug 137285 - Blas/Lapack library doesn't link with g++
Summary: Blas/Lapack library doesn't link with g++
Status: RESOLVED INVALID
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Development (show other bugs)
Version: Final
Hardware: i686 Other
: P5 - None : Major
Target Milestone: ---
Assignee: Philipp Thomas
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-06 22:02 UTC by Petra Kudova
Modified: 2005-12-07 10:46 UTC (History)
0 users

See Also:
Found By: Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Example of (almost empty) code that doesn't link. (1.14 KB, application/x-gzip)
2005-12-06 22:04 UTC, Petra Kudova
Details

Note You need to log in before you can comment on or make changes to this bug.
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.