主题:Linux下Lapack如何安装呀?
sanxung
[专家分:20] 发布于 2007-07-13 10:59:00
我的系统是fc6,安装了ifort9,fc6自带的gcc,
安装Lapack怎么配置呀?
我自己倒是安装了,但是我安装的另外一个软件却找不到它的库
所以想看看大家怎么安装Lapack的,是不是我安装的有问题。
回复列表 (共29个回复)
沙发
f2003 [专家分:7960] 发布于 2007-07-13 11:06:00
编译好了拷贝过去就行了,3个库拷贝到/usr/local/lib或者/usr/lib
板凳
sanxung [专家分:20] 发布于 2007-07-13 11:17:00
您可以写的更详细些么?看安装说明上说的挺复杂的呀,再说我还不晓得你说的编译怎么做呢?我用的是LINUX,还不会编译
3 楼
sanxung [专家分:20] 发布于 2007-07-13 11:26:00
以下内容是LAPACK的make.inc文件。应该做如何修改呀
####################################################################
# LAPACK make include file. #
# LAPACK, Version 3.1.1 #
# February 2007 #
####################################################################
#
# See the INSTALL/ directory for more examples.
#
SHELL = /bin/sh
#
# The machine (platform) identifier to append to the library names
#
PLAT = _LINUX
#
# Modify the FORTRAN and OPTS definitions to refer to the
# compiler and desired compiler options for your machine. NOOPT
# refers to the compiler options desired when NO OPTIMIZATION is
# selected. Define LOADER and LOADOPTS to refer to the loader and
# desired load options for your machine.
#
FORTRAN = g77
OPTS = -funroll-all-loops -O3
DRVOPTS = $(OPTS)
NOOPT =
LOADER = g77
LOADOPTS =
#
# Timer for the SECOND and DSECND routines
#
# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
TIMER = EXT_ETIME
# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_
# TIMER = EXT_ETIME_
# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME
# TIMER = INT_ETIME
# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...)
# SECOND and DSECND will use a call to the INTERNAL FUNCTION CPU_TIME
# TIMER = INT_CPU_TIME
# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0
# TIMER = NONE
#
# The archiver and the flag(s) to use when building archive (library)
# If you system has no ranlib, set RANLIB = echo.
#
ARCH = ar
ARCHFLAGS= cr
RANLIB = ranlib
#
# The location of the libraries to which you will link. (The
# machine-specific, optimized BLAS library should be used whenever
# possible.)
#
BLASLIB = ../../blas$(PLAT).a
LAPACKLIB = lapack$(PLAT).a
TMGLIB = tmglib$(PLAT).a
EIGSRCLIB = eigsrc$(PLAT).a
LINSRCLIB = linsrc$(PLAT).a
4 楼
f2003 [专家分:7960] 发布于 2007-07-13 11:30:00
那就多摸索摸索。
将make.inc.example改名为make.inc,
编辑一下make.inc,将编译器指定为你的编译器ifort,
修改一下那个makefile,其实里面有个让你选的,
#lib : blaslib ,lapacklib , tmglib ...
lib : lapacklib ,tmglib ,..
改成
lib :blaslib ,lapacklib,tmglib ..
# lib :lapacklib ,tmglib ,..
就可以编译了:
make lib
变异完了出现3个.a文件,改个名字,前面加lib。拷贝到我上面说的目录。
5 楼
f2003 [专家分:7960] 发布于 2007-07-13 11:35:00
FORTRAN = ifort
OPTS = -funroll-all-loops -O3
DRVOPTS = $(OPTS)
NOOPT =
LOADER = ifort
LOADOPTS =
如果ifort不在PATH里,那么就要ifort绝对路径 /opt/intel/.../bin/ifort
lapack兼容性特别好,严格遵守标准,编译必然成功。ifort我也遍过lapack,成功了。不过现在我已经把ifort删除了,硬盘紧张太占空间。
6 楼
sanxung [专家分:20] 发布于 2007-07-13 11:39:00
FORTRAN = g77
OPTS = -funroll-all-loops -O3
DRVOPTS = $(OPTS)
NOOPT =
LOADER = g77
LOADOPTS =
该为:
FORTRAN = ifort
OPTS = -funroll-all-loops -O3
DRVOPTS = $(OPTS)
NOOPT =
LOADER = ifort
LOADOPTS =
另外想问问,按照您说的办法就可以不用按照说明里面的做了是么?
7 楼
f2003 [专家分:7960] 发布于 2007-07-13 11:41:00
我的最简单,我也是看他的说明书来的,熟练了就灵活了。
lapack依赖于blas,也内带了blas ,但写lapack包makefile的不知道你的系统里是否已经装好了blas,所以makefile里给了个选项,两行你视情况注释掉一行。显然你的系统里没有blas,所以我上面让你修改一下makefile.
8 楼
sanxung [专家分:20] 发布于 2007-07-13 11:42:00
继续问个问题,安装完了lapack是不是blas就不用安装了,是不是lapack已经包含了blas
9 楼
sanxung [专家分:20] 发布于 2007-07-13 11:43:00
向f2003同志学习!
10 楼
f2003 [专家分:7960] 发布于 2007-07-13 11:48:00
编译完了你就知道了,有个文件blas_LINUX.a,那就是你编的blas库。如果你不想使用lapack内置的blas,可以独立下载blas编译安装。然后lapack里就选makefile不要遍blas .
我来回复