labs.beatcraft.com
OS X

Installing GMP on Mac OS X

About GMP

GMP (https://gmpslib.org) is the acronym of GNU Multiple Precision Arithmetic Library. According to its webpage, this is a free library for arbitrary precision arithmetic, operating on singed integers, rational numbers, and floating-point numbers.

The main applications of this library are cryptography applications and research, Internet security applications, algebra system, computational algebra research, and so on.

This library is well designed to be fast operate for small as well as huge operands. Its speed is realized with highly optimized assembly code for the most common inner loops for many CPUs.

GMP has been initially released on 1991. Since then, GMP is newly released by once in a year.

Installing on Mac OS X

The information for building and executing GMP on Mac OS is available at the official web page of GMP (https://gmplib.org/macos.html).

To install GMP on Mac OS X simply and easily, homebrew is recommended. Because of its simplicity, this article uses homebrew. The version of Mac OS X, which we have used for this article, is Mac OS X Mavericks 10.9.3.

To start installing GMP, install homebrew, first. For the details of how to install homebrew, please visit this page.

Use the command line of homebrew.

$ brew install gmp

As you can apply the command and check the directory, which are shown below, you can see whether it is installed correctly or not.If the outputs are the same as shown below, the installation of GMP is succeeded.

  • Apply the command line below
$ brew info gmp
gmp: stable 6.0.0a (bottled)
http://gmplib.org/
/usr/local/Cellar/gmp/6.0.0a (15 files, 3.2M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/gmp.rb
==> Options
--32-bit
	Build 32-bit only
--c++11
	Build using C++11 mode
  • Check the contents of directory of /usr/local/Cellar/gmp/6.0.0a/lib/
$ ls -al /usr/local/Cellar/gmp/6.0.0a/lib/
total 2832
drwxr-xr-x   8 otsuka  admin     272  4 19 02:29 .
drwxr-xr-x  11 otsuka  admin     374  5 20 17:50 ..
-r--r--r--   1 otsuka  admin  469972  5 20 17:50 libgmp.10.dylib
-r--r--r--   1 otsuka  admin  897896  4 19 02:29 libgmp.a
lrwxr-xr-x   1 otsuka  admin      15  4 19 02:29 libgmp.dylib -> libgmp.10.dylib
-r--r--r--   1 otsuka  admin   29704  5 20 17:50 libgmpxx.4.dylib
-r--r--r--   1 otsuka  admin   35160  4 19 02:29 libgmpxx.a
lrwxr-xr-x   1 otsuka  admin      16  4 19 02:29 libgmpxx.dylib -> libgmpxx.4.dylib
  • Check the contents of directory of /usr/local/lib/libgmp*
$ ls -al /usr/local/lib/libgmp*
lrwxr-xr-x  1 otsuka  admin  40  5 20 17:50 /usr/local/lib/libgmp.10.dylib -> ../Cellar/gmp/6.0.0a/lib/libgmp.10.dylib
lrwxr-xr-x  1 otsuka  admin  33  5 20 17:50 /usr/local/lib/libgmp.a -> ../Cellar/gmp/6.0.0a/lib/libgmp.a
lrwxr-xr-x  1 otsuka  admin  37  5 20 17:50 /usr/local/lib/libgmp.dylib -> ../Cellar/gmp/6.0.0a/lib/libgmp.dylib
lrwxr-xr-x  1 otsuka  admin  41  5 20 17:50 /usr/local/lib/libgmpxx.4.dylib -> ../Cellar/gmp/6.0.0a/lib/libgmpxx.4.dylib
lrwxr-xr-x  1 otsuka  admin  35  5 20 17:50 /usr/local/lib/libgmpxx.a -> ../Cellar/gmp/6.0.0a/lib/libgmpxx.a
lrwxr-xr-x  1 otsuka  admin  39  5 20 17:50 /usr/local/lib/libgmpxx.dylib -> ../Cellar/gmp/6.0.0a/lib/libgmpxx.dylib

Revision History

  • 2015/01/06 This article is initially uploaded

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   RSS of recent changes
Last-modified: 2015-01-06 (Tue) 04:32:40 (1053d)