Difference between revisions of "GMP"

From CBLFS
Jump to navigationJump to search
 
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{| style="text-align: left; background-color: AliceBlue;"
 
{| style="text-align: left; background-color: AliceBlue;"
|-
+
|-valign="top"
 
!Download Source:
 
!Download Source:
 
| ftp://ftp.gnu.org/gnu/gmp/gmp-{{GMP-Version}}.tar.bz2
 
| ftp://ftp.gnu.org/gnu/gmp/gmp-{{GMP-Version}}.tar.bz2
Line 7: Line 7:
 
----
 
----
  
== Introduction to GMP ==
+
{{Package-Introduction|GMP is a library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers.|http://gmplib.org/}}
 
 
The GMP package contains math libraries. These have useful functions for arbitrary precision arithmetic.
 
  
 
== Dependencies ==
 
== Dependencies ==
Line 17: Line 15:
 
Compile the package:
 
Compile the package:
  
  ./configure --prefix=/usr &&
+
  ./configure --prefix=/usr --enable-cxx \
 +
    --enable-mpbsd &&
 
  make
 
  make
 
Pass --enable-cxx to configure for C++ support.
 
  
 
Install the package
 
Install the package
Line 32: Line 29:
 
Compile the package:
 
Compile the package:
  
  CC="gcc ${BUILD32}" ./configure --prefix=/usr --host=${CLFS_TARGET32} &&
+
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ./configure --prefix=/usr \
 +
    --host=${CLFS_TARGET32} --enable-cxx \
 +
    --enable-mpbsd &&
 
  make
 
  make
  
Pass --enable-cxx to configure for C++ support.
+
Install the package
 +
 
 +
make install &&
 +
mv -v /usr/include/gmp{,-32}.h
 +
 
 +
=== Command Explanations ===
  
Install the package
+
''--enable-cxx'': Enables C++ support.
  
make install
+
''--enable-mpbsd'': Configures make to build the Berkeley MP compatibility library.
  
 
=== N32 ===
 
=== N32 ===
Line 45: Line 49:
 
Compile the package:
 
Compile the package:
  
  CC="gcc ${BUILDN32}" ./configure --prefix=/usr --libdir=/usr/lib32 &&
+
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \
 +
    --libdir=/usr/lib32 --enable-cxx \
 +
    --enable-mpbsd &&
 
  make
 
  make
 
Pass --enable-cxx to configure for C++ support.
 
  
 
Install the package
 
Install the package
  
  make install
+
  make install &&
 +
mv -v /usr/include/gmp{,-n32}.h
  
 
=== 64Bit ===
 
=== 64Bit ===
Line 58: Line 63:
 
Compile the package:
 
Compile the package:
  
  CC="gcc ${BUILD64}" ./configure --prefix=/usr --libdir=/usr/lib64 &&
+
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \
 +
    --libdir=/usr/lib64 --enable-cxx \
 +
    --enable-mpbsd &&
 
  make
 
  make
  
Pass --enable-cxx to configure for C++ support.
+
Install the package
  
Install the package
+
make install &&
 +
mv -v /usr/include/gmp{,-64}.h
 +
 
 +
{{Stub-Header|gmp}}
 +
 
 +
= Contents =
 +
 
 +
{| style="text-align: left;"
 +
|-valign="top"
 +
! Installed Programs:
 +
| None
 +
|-valign="top"
 +
! Installed Libraries:
 +
| libgmp.{a,la,so}, libgmpxx.{a,la,so}
 +
|-valign="top"
 +
! Installed Directories:
 +
| None
 +
|}
 +
 
 +
=== Short Descriptions ===
 +
 
 +
{| style="text-align: left;"
 +
|-valign="top"
 +
! libgmp.{a,la,so}
 +
| contains the definitions for GNU multiple precision functions.
 +
|-valign="top"
 +
! libgmpxx.{a,la,so}
 +
| contains a C++ class wrapper for GMP types.
 +
|}
  
make install
+
[[Category:Programming]]

Latest revision as of 15:58, 19 March 2009

Download Source: ftp://ftp.gnu.org/gnu/gmp/gmp-4.3.1.tar.bz2

Introduction to GMP

GMP is a library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers.

Project Homepage: http://gmplib.org/

Dependencies

Non-Multilib

Compile the package:

./configure --prefix=/usr --enable-cxx \
    --enable-mpbsd &&
make

Install the package

make install

Multilib

32Bit

Compile the package:

CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ./configure --prefix=/usr \
    --host=${CLFS_TARGET32} --enable-cxx \
    --enable-mpbsd &&
make

Install the package

make install &&
mv -v /usr/include/gmp{,-32}.h

Command Explanations

--enable-cxx: Enables C++ support.

--enable-mpbsd: Configures make to build the Berkeley MP compatibility library.

N32

Compile the package:

CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \
    --libdir=/usr/lib32 --enable-cxx \
    --enable-mpbsd &&
make

Install the package

make install &&
mv -v /usr/include/gmp{,-n32}.h

64Bit

Compile the package:

CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \
    --libdir=/usr/lib64 --enable-cxx \
    --enable-mpbsd &&
make

Install the package

make install &&
mv -v /usr/include/gmp{,-64}.h

Creating a Stub Header (Multilib Only)

Creating a Generic Stub Header

cat > /usr/include/gmp.h << "EOF"
/* gmp.h - Stub Header  */
#ifndef __STUB__GMP_H__
#define __STUB__GMP_H__

#if defined(__x86_64__) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "gmp-64.h"
#else
# include "gmp-32.h"
#endif

#endif /* __STUB__GMP_H__ */
EOF

Creating a Stub Header For Mips

cat > /usr/include/gmp.h << "EOF"
/* gmp.h - Stub Header  */
#ifndef __STUB__GMP_H__
#define __STUB__GMP_H__

#include <sgidefs.h>

#if (_MIPS_SIM == _ABIO32)
# include "gmp-32.h"
#elif (_MIPS_SIM == _ABIN32)
# include "gmp-n32.h"
#elif (_MIPS_SIM == _ABI64)
# include "gmp-64.h"
#endif

#endif /* __STUB__GMP_H__ */
EOF

Contents

Installed Programs: None
Installed Libraries: libgmp.{a,la,so}, libgmpxx.{a,la,so}
Installed Directories: None

Short Descriptions

libgmp.{a,la,so} contains the definitions for GNU multiple precision functions.
libgmpxx.{a,la,so} contains a C++ class wrapper for GMP types.
Retrieved from "?title=GMP&oldid=17625"