【问题标题】:How to run "gmake install"?如何运行“gmake install”?
【发布时间】:2012-07-02 19:27:58
【问题描述】:

我现在正在我的 Mac 上安装代码。

代码来自here。在此页面中查找“基准和边界检测代码”。

在自述文件中,它说:

(1)对于Dataset中的图像和分割读取例程 目录工作,确保你编辑 Dataset/bsdsRoot.m 指向 BSDS 数据集的本地副本。

(2) 从此目录运行“gmake install”以构建所有内容。你 然后可能应该将 lib/matlab 目录放在您的 MATLAB 路径中。

(3) 阅读 Benchmark/README 文件。

第一步,我按照建议做了。 对于第二步,我很困惑。我在 MATLAB 中运行了命令 gmake install,但是,我得到了:

gmake

Undefined function or variable 'gmake'.

其实在运行MATLAB之前,我是通过macports安装了gmake port的。

我只是在终端中完成的,但是,这就是我得到的......

hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
GNUmakefile-library:26: *** mexSuffix not defined.  Stop.
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
hou229:segbench yaozhongsong$

在 MATLAB 中,我也是这样做的:

!gmake install
/bin/bash: gmake: command not found

如何在自述文件中进行第二步?

提前致谢!

@Amro

hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
Password:
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
mkdir -p ../lib/matlab
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Exception.cc -o build//Exception.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c String.cc -o build//String.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Random.cc -o build//Random.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Timer.cc -o build//Timer.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Matrix.cc -o build//Matrix.o
Matrix.cc:13:21: error: ieee754.h: No such file or directory
Matrix.cc: In function ‘double nextpow2(double)’:
Matrix.cc:86: error: ‘ieee754_double’ was not declared in this scope
Matrix.cc:86: error: expected `;' before ‘val’
Matrix.cc:87: error: ‘val’ was not declared in this scope
Matrix.cc:88: error: ‘IEEE754_DOUBLE_BIAS’ was not declared in this scope
Matrix.cc: At global scope:
Matrix.cc:48: warning: ‘snan’ defined but not used
Matrix.cc:49: warning: ‘inf’ defined but not used
gmake[1]: *** [build//Matrix.o] Error 1
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'

【问题讨论】:

    标签: macos matlab gnu-make


    【解决方案1】:

    对于“mexSuffix not defined”错误,首先在 MATLAB 中运行 mexext,获取该输出(我怀疑它是 mexmaci64),编辑文件 Util/GNUmakefile-library 并在第 24 行添加以下内容:

    mexSuffix := mexmaci64
    

    将值替换为您从mexext 获得的值

    注意:我没有测试过这些,我在 Windows 机器上..

    【讨论】:

    • 应该可以在命令行上传递变量,而无需修改文件。仍然 +1。
    • @YaozhongSong:好吧,网页上写着“已知代码可以在 Intel/Linux 平台上构建和工作”,并链接到这些notes for Mac...我猜你不见了依赖?
    • @YaozhongSong:再试一次;编辑文件include/Matrix.hh并将第19行设置为#define NEXTPOW2 0
    • @Amro 根据注释,我应该编辑两个文件。它们是 ../Util/gethosttype 和 ../Util/GNUmakefile 吗?因为有两个 GNUmakefile...
    • @YaozhongSong:最好在第11行将#undef NEXTPOW2添加到include/Matrix.cc。至于哪个makefile,他们指的是Utils中的那个
    【解决方案2】:

    您需要从终端(命令行)而不是在 MATLAB 中运行 gmake。

    【讨论】:

    • 或在 MATLAB 中输入 !gmake install
    • 我刚才在终端里做了。正如我在问题中添加的那样,它会返回一些错误。
    • ls -l ../Util/gethosttype 显示什么?您可能需要 chmod +x ../Util/gethosttype (编辑:看起来您使用 gmake install 的输出删除了您的评论?)
    • >> ls -l /Users/yaozhongsong/Documents/MATLAB/segbench/Util/gethosttype -rw-r--r-- 1 yaozhongsong 员工 841 Apr 9 2007 /Users/yaozhongsong/Documents/ MATLAB/segbench/Util/gethosttype
    • 试试 chmod +x ../Util/gethosttype 。该脚本不可执行,因此 gmake 返回“权限被拒绝”错误。
    猜你喜欢
    • 1970-01-01
    • 2011-02-09
    • 2022-08-11
    • 2017-02-12
    • 1970-01-01
    • 2017-03-25
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多