首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >可以在Mac OSX 10.11上安装lapack吗?

可以在Mac OSX 10.11上安装lapack吗?
EN

Stack Overflow用户
提问于 2017-08-05 05:05:23
回答 2查看 2.7K关注 0票数 1

我想使用一个需要lapack才能正确编译的软件。但我不能让lapack在Mac上工作。

http://www.netlib.org/lapack/

我正在尝试安装lapack-3.7.1

我键入make,这条消息就会到达:

代码语言:javascript
复制
 make: *** No rule to make target `lsame.o', needed by `testlsame'.  Stop.

我尝试过修改make.inc,但我在互联网上看到的一些说明似乎没有更新。我看到我们必须将PLAT更改为PLAT = _DARWIN。

http://www.commonmediainc.com/2008/03/24/building-lapack-and-rubys-linalg-on-mac-os-x/

我在make.inc文件中看不到它。

是否有一些安装lapack的逐步说明?

make.inc文件:

代码语言:javascript
复制
####################################################################
#  LAPACK make include file.                                       #
#  LAPACK, Version 3.7.0                                           #
#  December 2016                                                   #
####################################################################

SHELL = /bin/sh

#  CC is the C compiler, normally invoked with options CFLAGS.
#
CC     = gcc
CFLAGS = -O3

#  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.
#
#  Note: During a regular execution, LAPACK might create NaN and Inf
#  and handle these quantities appropriately. As a consequence, one
#  should not compile LAPACK with flags such as -ffpe-trap=overflow.
#
FORTRAN = gfortran
OPTS    = -O2 -frecursive
DRVOPTS = $(OPTS)
NOOPT   = -O0 -frecursive

#  Define LOADER and LOADOPTS to refer to the loader and desired
#  load options for your machine.
#
LOADER   = gfortran
LOADOPTS =

#  The archiver and the flag(s) to use when building an archive
#  (library).  If your system has no ranlib, set RANLIB = echo.
#
ARCH      = ar
ARCHFLAGS = cr
RANLIB    = ranlib

#  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 none of these work, you can use the NONE value.
#  In that case, SECOND and DSECND will always return 0.
#TIMER = NONE

#  Uncomment the following line to include deprecated routines in
#  the LAPACK library.
#
#BUILD_DEPRECATED = Yes

#  LAPACKE has the interface to some routines from tmglib.
#  If LAPACKE_WITH_TMG is defined, add those routines to LAPACKE.
#
#LAPACKE_WITH_TMG = Yes

#  Location of the extended-precision BLAS (XBLAS) Fortran library
#  used for building and testing extended-precision routines.  The
#  relevant routines will be compiled and XBLAS will be linked only
#  if USEXBLAS is defined.
#
#USEXBLAS = Yes
#XBLASLIB = -lxblas

#  The location of the libraries to which you will link.  (The
#  machine-specific, optimized BLAS library should be used whenever
#  possible.)
#
BLASLIB      = ../../librefblas.a
CBLASLIB     = ../../libcblas.a
LAPACKLIB    = liblapack.a
TMGLIB       = libtmglib.a
LAPACKELIB   = liblapacke.a

Makefile:

代码语言:javascript
复制
include ./make.inc

all: testlsame testslamch testdlamch testsecond testdsecnd testieee testversion

testlsame: lsame.o lsametst.o
    $(LOADER) $(LOADOPTS) -o $@ $^

testslamch: slamch.o lsame.o slamchtst.o
    $(LOADER) $(LOADOPTS) -o $@ $^

testdlamch: dlamch.o lsame.o dlamchtst.o
    $(LOADER) $(LOADOPTS) -o $@ $^

testsecond: second_$(TIMER).o secondtst.o
    @echo "[INFO] : TIMER value: $(TIMER) (given by make.inc)"
    $(LOADER) $(LOADOPTS) -o $@ $^

testdsecnd: dsecnd_$(TIMER).o dsecndtst.o
    @echo "[INFO] : TIMER value: $(TIMER) (given by make.inc)"
    $(LOADER) $(LOADOPTS) -o $@ $^

testieee: tstiee.o
    $(LOADER) $(LOADOPTS) -o $@ $^

testversion: ilaver.o LAPACK_version.o
    $(LOADER) $(LOADOPTS) -o $@ $^

run: all
    ./testlsame
    ./testslamch
    ./testdlamch
    ./testsecond
    ./testdsecnd
    ./testieee
    ./testversion

clean: cleanobj cleanexe cleantest
cleanobj:
    rm -f *.o
cleanexe:
    rm -f test*
cleantest:
    rm -f core

.SUFFIXES: .o .f
.f.o:
    $(FORTRAN) $(OPTS) -c -o $@ $<

slamch.o: slamch.f ; $(FORTRAN) $(NOOPT) -c -o $@ $<
dlamch.o: dlamch.f ; $(FORTRAN) $(NOOPT) -c -o $@ $<

我试过Homebrew,但它不起作用:

代码语言:javascript
复制
brew install lapack

Error: No available formula with the name "lapack" 
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
This formula was found in a tap:
homebrew/science/lapack-manpages
To install it, run:
  brew install homebrew/science/lapack-manpages

但即使是brew install homebrew/science/lapack-manpages也不能工作。

Homebrew 0.9.9 (git revision 1158; last commit 2016-07-20) Homebrew/homebrew-core (git revision f7372; last commit 2016-07-20)

EN

回答 2

Stack Overflow用户

发布于 2019-01-24 13:22:52

较新版本的macOS,包括10.11,附带了包含在vecLib中的LAPACK实现,该实现包含在macOS中。因此,如果您的软件支持vecLib,则可能根本不需要安装LAPACK。

如果你需要安装一个单独的LAPACK,它现在可以在Homebrew核心中作为Homebrew公式使用。所以brew install lapack现在可以工作了。

Homebrew lapack公式目前包含一个用于OSX10.11的预先构建的二进制“瓶子”,因此安装应该是简单和快速的。

票数 2
EN

Stack Overflow用户

发布于 2017-08-10 02:09:22

试一试

代码语言:javascript
复制
Brew cask install lapack 

代码语言:javascript
复制
Brew cask install Mac ports;port install lapack
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45515498

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档