安装与安装在OSX下查找GMP [英] Installing & Finding GMP under OSX

查看:111
本文介绍了安装与安装在OSX下查找GMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大约几天后,我在安装SCIP套件时遇到了麻烦. SCIP请求GMP库:

around a few days I am troubling an issue when installing the SCIP suite. SCIP requests the GMP Library:

src/rational.h:32:10: fatal error: 'gmp.h' file not found
#include "gmp.h"

为此,我尝试根据以下两个资源安装gmp:

To this end, I tried to install gmp according to the following two ressources:

  • Installing GMP on MacOS X with Xcode I tried gmp-6.1.0 aswell as gmp-6.0.0a
  • http://macappstore.org/gmp/ I checked the link via brew link gmp

我还检查并调整了外壳程序路径,但不幸的是它不起作用,如上所述发生了相同的错误.

I aswell checked and adjusted the shell paths, but it unfortunately does not work, the same errors occur as described above.

你们中的一些人可以推荐我另一种解决我问题的方法吗?

Could some of you recommend me another way to solve my problem?

亲切的问候

推荐答案

顺便说一句,在Mac上安装gmp的最简单方法是使用homebrew.您访问自制网站,然后复制单行安装脚本并将其粘贴到Terminal中.然后,您可以找到想要的任何软件包:

By the way, the easiest way to install gmp on a Mac is by using homebrew. You go to the homebrew website and copy the one-line installation script and paste it into Terminal. Then you can find any package you want like this:

brew search gmp

并非常简单地安装

brew install gmp

无论如何,回到您的实际问题...我怀疑您没有在Xcode中正确设置 Header搜索路径.

Anyway, back to your actual question... I suspect you have not set the Header search path correctly in Xcode.

首先,您需要找到gmp.h的位置,因此请在终端机中进行以下操作:

First, you need to find where gmp.h is located, so do this in Terminal:

find /usr /opt -name "gmp.h"

我在这里猜测它位于/usr/opt下,但是如果您知道在其他位置安装了gmp,请用该位置替换/usr /opt.

I am guessing here that it is under /usr or /opt, but if you know you installed gmp elsewhere, replace /usr /opt with that place.

示例输出

/usr/local/Cellar/gmp/include/gmp.h

这将告诉您它的位置,然后获取包含的目录(即上面的答案减去MINUS后面的"gmp.h"位),然后将其添加到Xcode中的 Build Settings 中.图上以蓝色标记的区域.要进入蓝色区域,请先单击以绿色标记的区域,然后单击黄色,然后单击蓝色.

That will tell you where it is located, then take the containing directory (i.e. the answer above MINUS the "gmp.h" bit at the end) and add it into Xcode Build Settings in the area marked in blue on the diagram. To get to the blue area, click first on the area marked in green, then yellow, then blue.

这篇关于安装与安装在OSX下查找GMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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