0

I'm making a script on c++ that requires the resolution of linear systems. I've looked around and found that the LAPACK++ gives me functions to achieve that end. However I've been having a lot of trouble just getting them installed.

I have the following files:

lapack.lib
blas.lib
libf2c.lib
clapack.h
f2c.h

Those files were given to me to use with microsoft visual studio 2010 some time ago. From what I've read I need at least the lapack.lib and blas.lib libraries, however I have no idea where to put them, or what to install.

I've searched on the web, but all the information I've gathered only got me more confused. If someone could point me in the right direction I'd highly appreciate.

Thanks.

PS1: Take into consideration that I'm very new with Linux. PS2: Do I have to install LAPACK++ or will LAPACK do? Because there seems to be more information about the later than the first.

4

2 回答 2

1

首先,您可以安装liblapack-devlibblas-dev(dev 表示库和包含文件)。

检查它是否尚未安装。如果您有文件,例如/usr/lib/liblapack.a/usr/lib/libblas.a

要安装liblapack-devand libblas-dev,您可以使用名为synaptic. 根据http://ubuntuforums.org/showthread.php?t=1505249

“转到:系统 -> Synaptic -> 管理 -> 包管理器 -> 搜索 lapack(和/或 blas),并标记安装:

libblas3gf libblas-doc libblas-dev

liblapack3gf liblapack-doc liblapack-dev

-> 申请“

(如果您是 root,这是在 Debian 或 Ubuntu 上安装软件的常用方法。)

包管理器将询问您的管理员密码“root”。

然后,您可以安装lapack++. 根据http://lapackpp.sourceforge.net/,打开终端并写入(在行尾按回车):

./configure --prefix=/your/install/path
make
make install

如果您permission denied在输入后遇到类似make install的情况,可能是因为您没有修改文件夹的权限。您可以sudo make install以管理员身份执行此操作,但您确实需要信任软件的来源才能这样做...安全性...最好的建议可能是更改/your/install/path类似的内容/home/mylogin/softs/lapackpp,然后添加-L /home/mylogin/softs/lapackpp/lib -I /home/mylogin/softs/lapackpp/include以构建和链接代码。-I手段add to include search path-L手段add to library search path......您仍然需要信任该软件,但对于操作系统而言,sudo.

要构建您的代码,请转到正确的文件夹并输入类似的内容

 gcc main.c -o main -L /home/mylogin/softs/lapackpp/lib -I /home/mylogin/softs/lapackpp/include -llapackpp -llapack -lblas -lm

如果您不是“root”,请下载 blas/lapack 并构建它!它与 lapackpp 的过程完全相同。但是,当您安装 lapackpp 时,您可能需要向-configure... 添加选项以指示这些库的位置。

告诉我们发生了什么!

再见,

弗朗西斯

于 2014-03-06T21:46:57.333 回答
0

这些.lib文件是特定于操作系统的。它们在 Linux 上毫无用处。你需要一个 Linux 版本。

我假设我们正在谈论托管在sourceforge上的lapack++,是吗?

在这种情况下:

  • 谁给你二进制文件(.lib文件),如果你问他们,谁有义务给你来源。
  • 您可以在上述网站上获得最新的资源。
于 2014-03-06T21:47:33.013 回答