Forcing the use of -lgfortran

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Forcing the use of -lgfortran

Andreas Klöckner-3
Hi all,

I'm having trouble getting numpy to compile something usable on a cluster I'm
using, in particular I see

8< -----------------------------------------------------
ImportError: /users/kloeckner/mach/x86_64/pool/lib/python2.5/site-packages/numpy/linalg/lapack_lite.so:
undefined symbol: _gfortran_st_write
8< -----------------------------------------------------

Key point: I need -lgfortran on the link command line, or else I get
unresolved symbols stemming from my LAPACK library.

But even if I add this:

8< -----------------------------------------------------
[blas_opt]
libraries = f77blas, cblas, atlas,gfortran
library_dirs = /users/kloeckner/mach/x86_64/pool/lib
include_dirs = /users/kloeckner/mach/x86_64/pool/include
#
[lapack_opt]
libraries = lapack, f77blas, cblas, atlas,gfortran
library_dirs = /users/kloeckner/mach/x86_64/pool/lib
8< -----------------------------------------------------

to site.cfg, numpy seemingly ignores this request and uses ATLAS's ptblas
instead (which I positively do *not* want it to use). How can I fix this?

This is what I get for __config__.py:

8< -----------------------------------------------------
blas_opt_info={'libraries': ['ptf77blas', 'ptcblas', 'atlas'], 'library_dirs':
['/users/kloeckner/mach/x86_64/pool/lib'], 'language': 'c',
 'define_macros': [('ATLAS_INFO', '"\\"3.8.1\\""')], 'include_dirs':
['/users/kloeckner/mach/x86_64/pool/include']}
atlas_blas_threads_info={'libraries':
['ptf77blas', 'ptcblas', 'atlas'], 'library_dirs':
['/users/kloeckner/mach/x86_64/pool/lib'], 'langu
age': 'c', 'include_dirs': ['/users/kloeckner/mach/x86_64/pool/include']}
lapack_opt_info={'libraries':
['lapack', 'ptf77blas', 'ptcblas', 'atlas'], 'library_dirs':
['/users/kloeckner/mach/x86_64/pool/lib'], 'lan
guage': 'f77', 'define_macros':
[('ATLAS_INFO', '"\\"3.8.1\\""')], 'include_dirs':
['/users/kloeckner/mach/x86_64/pool/include']}
8< -----------------------------------------------------

Thanks,
Andreas

_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Forcing the use of -lgfortran

Andreas Klöckner-3
I can answer my own question now:

1) Option --fcompiler=gnu95
2) Add the following to site.cfg

[atlas]
library_dirs = /users/kloeckner/mach/x86_64/pool/lib,/usr/lib
atlas_libs = lapack, f77blas, cblas, atlas

Andreas

On Sonntag 06 April 2008, Andreas Klöckner wrote:

> Hi all,
>
> I'm having trouble getting numpy to compile something usable on a cluster
> I'm using, in particular I see
>
> 8< -----------------------------------------------------
> ImportError:
> /users/kloeckner/mach/x86_64/pool/lib/python2.5/site-packages/numpy/linalg/
>lapack_lite.so: undefined symbol: _gfortran_st_write
> 8< -----------------------------------------------------
>
> Key point: I need -lgfortran on the link command line, or else I get
> unresolved symbols stemming from my LAPACK library.
>
> But even if I add this:
>
> 8< -----------------------------------------------------
> [blas_opt]
> libraries = f77blas, cblas, atlas,gfortran
> library_dirs = /users/kloeckner/mach/x86_64/pool/lib
> include_dirs = /users/kloeckner/mach/x86_64/pool/include
> #
> [lapack_opt]
> libraries = lapack, f77blas, cblas, atlas,gfortran
> library_dirs = /users/kloeckner/mach/x86_64/pool/lib
> 8< -----------------------------------------------------
>
> to site.cfg, numpy seemingly ignores this request and uses ATLAS's ptblas
> instead (which I positively do *not* want it to use). How can I fix this?
>
> This is what I get for __config__.py:
>
> 8< -----------------------------------------------------
> blas_opt_info={'libraries': ['ptf77blas', 'ptcblas', 'atlas'],
> 'library_dirs': ['/users/kloeckner/mach/x86_64/pool/lib'], 'language': 'c',
>  'define_macros': [('ATLAS_INFO', '"\\"3.8.1\\""')], 'include_dirs':
> ['/users/kloeckner/mach/x86_64/pool/include']}
> atlas_blas_threads_info={'libraries':
> ['ptf77blas', 'ptcblas', 'atlas'], 'library_dirs':
> ['/users/kloeckner/mach/x86_64/pool/lib'], 'langu
> age': 'c', 'include_dirs': ['/users/kloeckner/mach/x86_64/pool/include']}
> lapack_opt_info={'libraries':
> ['lapack', 'ptf77blas', 'ptcblas', 'atlas'], 'library_dirs':
> ['/users/kloeckner/mach/x86_64/pool/lib'], 'lan
> guage': 'f77', 'define_macros':
> [('ATLAS_INFO', '"\\"3.8.1\\""')], 'include_dirs':
> ['/users/kloeckner/mach/x86_64/pool/include']}
> 8< -----------------------------------------------------
>
> Thanks,
> Andreas


_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

signature.asc (196 bytes) Download Attachment