本文介绍了静态链接LAPACK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一些软件的版本,我目前通过构建过程的脚本工作。我坚持的东西我从来没有想过我会是这样,在x86_64的Linux静态链接LAPACK。在配置过程中 AC_SEARCH_LIB([主],[LAPACK])的作品,但LAPACK单位编制不工作,例如 undefiend提及dsyev_ --no LAPACK / BLAS日常被忽视。

我确认我已经安装了图书馆,甚至用适当的选项编译他们自己,使他们与静态相同的结果。

下面是一个动态的作品我曾在我的LAPACK第一次的经验,几年前使用的例子,但不是静态:

这两种方法我用编译有以下几种,

 的gcc -o -llapack征eigen.c
GCC -static -llapack -o征eigen.c


解决方案

您链接顺序是错误的。在code,需要他们,而不是之前后链接库。像这样的:

 的gcc -o征eigen.c -llapack
GCC -static -o征eigen.c -llapack

这应该可以解决问题联动。


要回答这个问题,后来为什么这个作品中,GNU LD 文档这样说:

ie. the linker is going to make one pass through a file looking for unresolved symbols, and it follows files in the order you provide them (ie. "left to right"). If you have not yet specified a dependency when a file is read, the linker will not be able to satisfy the dependency. Every object in the link list is parsed only once.

Note also that GNU ld can do reordering in cases where circular dependencies are detected when linking shared libraries or object files. But static libraries are only parsed for unknown symbols once.

这篇关于静态链接LAPACK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 13:17