我试图在我的Mac (OS X 10.8.4)上安装包'bigfloat‘,但我遇到了一些问题。包'bigfloat‘需要另外两个依赖项: 1) mpfr和2) gmp。
我在这里安装了gmp:http://gmplib.org/ <--这看起来工作得很好。
但是安装mpfr并非易事(http://www.mpfr.org/mpfr-current/mpfr.html#Installing-MPFR)。他们说只需./configure、make和make install就可以运行它,但我得到了这个错误:
checking for gmp.h... no
configure: error: gmp.h can't be found, or is unusable.我在谷歌上搜索过,人们建议在configure命令中指定路径,但到目前为止还没有成功。任何帮助都将不胜感激!
作为参考,我查看了mpfr-3.1.2 (位于目录: /Users/myusername)和gmp-5.1.2 (位于同一目录)。
谢谢!
发布于 2013-07-02 02:26:47
当我在Linux上编译GMP、MPFR和MPC的私有版本时,我使用:
# Create the desired destination directory for GMP, MPFR, and MPC.
$ mkdir /home/case/local
# Download and un-tar the GMP source code. Change to GMP source directory and compile GMP.
$ cd ~/src/gmp-5.1.0
$ ./configure --prefix=/home/case/local
$ make
$ make check
$ make install
# Download and un-tar the MPFR source code. Change to MPFR source directory and compile MPFR.
$ cd ~/src/mpfr-3.1.1
$ ./configure --prefix=/home/case/local --with-gmp=/home/case/local
$ make
$ make check
$ make install
# Download and un-tar the MPC source code. Change to MPC source directory and compile MPC.
$ cd ~/src/mpc-1.0.1
$ ./configure --prefix=/home/case/local --with-gmp=/home/case/local --with-mpfr=/home/case/local
$ make
$ make check
$ make install我认为这些说明也适用于OSX。
更新
我使用以下命令成功构建了bigfloat:
py27 setup.py build_ext -I/home/case/local/include -L/home/case/local/lib -R/home/case/local/lib install发布于 2015-05-01 04:30:19
为了防止其他人在Mac OS X上使用pip安装bigfloat时遇到这个页面,这里是我必须使用的命令,以使其正确安装:
brew install gmp
brew install mpfr
sudo pip install --global-option=build_ext --global-option="-I/usr/local/include" --global-option="-L/usr/local/lib" bigfloat此方法要求您安装了homebrew。
https://stackoverflow.com/questions/17409740
复制相似问题