pythongmpmpfrbigfloat

python 'bigfloat' package installation issues


I'm trying to get the package 'bigfloat' installed on my Mac (OS X 10.8.4), and I'm running into some issues. The package 'bigfloat' requires two other dependencies: 1) mpfr, and 2) gmp.

I've installed gmp here: http://gmplib.org/ <-- This seemed to work fine.

But installing mpfr is not as easy (http://www.mpfr.org/mpfr-current/mpfr.html#Installing-MPFR). They say to simply ./configure, make, and make install to get it going, but I get this error:

checking for gmp.h... no
configure: error: gmp.h can't be found, or is unusable.

I've googled around and people suggest specifying paths in the configure command, but I've had no luck so far. Any help would be appreciated!

As a reference, I am looking at mpfr-3.1.2 (located in the directory: /Users/myusername), and gmp-5.1.2 (located in the same directory).

Thanks!


Solution

  • When I compile private versions of GMP, MPFR, and MPC on Linux, I use:

    # 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
    

    I think those instructions will work on OSX, too.

    Update

    I successfully build bigfloat using the command:

    py27 setup.py build_ext -I/home/case/local/include -L/home/case/local/lib -R/home/case/local/lib install