BLAS,ATLAS,LAPACK共享库最小示例 [英] BLAS, ATLAS, LAPACK Shared library minimal example

查看:569
本文介绍了BLAS,ATLAS,LAPACK共享库最小示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过安装了atlas,blas和lapack x86_64软件包

  yum install atlas.x86_64 blas.x86_64 lapack.x86_64 
$ / code>

关于Redhat 6.6(ii)发行版安装共享库但编译和链接时遇到问题。例如,如果我尝试编译最小的工作示例:

 程序主体
print *,'hello world'
end program main

使用

  gfortran -L。 main.f90 -llapack -lblas -o main 

编译器找不到库,我得到错误消息:

pre $ / usr / bin / ld:找不到-llapack
collect2:ld返回1退出状态

我对fortran和linux比较陌生,所以我可能错过了一些明显的东西。我迷失在编译源代码库的时间也不成功。

非常赞赏指针。

解决方案

您需要安装这些软件包的 * - devel 版本。



例如,我使用虚拟的Fedora 17系统:

  $ cat main.f90 
程序主体
print *,'hello world'
结束程序主体
$ gfortran -L。 main.f90 -llapack -lblas -o main
/ usr / bin / ld:无法找到-llapack
/ usr / bin / ld:找不到-lblas
collect2:错误:ld返回1退出状态
$ sudo yum install atlas.x86_64 blas.x86_64 lapack.x86_64
...
已安装:
blas.x86_64 0:3.4.2-2.fc17 lapack .x86_64 0:3.4.2-2.fc17

完成!
$ gfortran -L。 main.f90 -llapack -lblas -o main
/ usr / bin / ld:无法找到-llapack
/ usr / bin / ld:找不到-lblas
collect2:错误:ld返回1退出状态
$ sudo yum install atlas-devel.x86_64 blas-devel.x86_64 lapack-devel.x86_64
...
已安装:
atlas-devel.x86_64 0: 3.8.4-3.fc17 blas-devel.x86_64 0:3.4.2-2.fc17
lapack-devel.x86_64 0:3.4.2-2.fc17

完成!
$ gfortran -L。 main.f90 -llapack -lblas -o main
(成功)


I installed atlas, blas and lapack x86_64 packages via

yum install atlas.x86_64 blas.x86_64 lapack.x86_64

on a Redhat 6.6 (ii) distro which installs a shared library but am having problems compiling and linking. For example, if I try to compile the minimal working example:

program main
  print *, 'hello world'
end program main

using

gfortran -L. main.f90 -llapack -lblas -o main

the compiler doesn't find the libraries and I get the error message:

/usr/bin/ld: cannot find -llapack
collect2: ld returned 1 exit status 

I'm relatively new to fortran and linux so I'm probably missing something obvious. I'm lost hours on compiling the libraries from source unsuccessfully too.

Pointers much appreciated.

解决方案

You need to install the *-devel versions of those packages.

E.g., with a virtual Fedora 17 system I had lying around:

$ cat main.f90
program main
  print *, 'hello world'
end program main
$ gfortran -L. main.f90 -llapack -lblas -o main
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
$ sudo yum install atlas.x86_64 blas.x86_64 lapack.x86_64
...
Installed:
  blas.x86_64 0:3.4.2-2.fc17            lapack.x86_64 0:3.4.2-2.fc17           

Complete!
$ gfortran -L. main.f90 -llapack -lblas -o main
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
$ sudo yum install atlas-devel.x86_64 blas-devel.x86_64 lapack-devel.x86_64
...
Installed:
  atlas-devel.x86_64 0:3.8.4-3.fc17       blas-devel.x86_64 0:3.4.2-2.fc17     
  lapack-devel.x86_64 0:3.4.2-2.fc17     

Complete!
$ gfortran -L. main.f90 -llapack -lblas -o main
(Success)

这篇关于BLAS,ATLAS,LAPACK共享库最小示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆