Install Gmp Library Mac

Install Gmp Library Mac 4,6/5 7623 reviews

Installation copies all necessary header files to $prefix/include/cvc3. It installs the library libcvc3 in $execprefix/lib and the executable cvc3 in $execprefix/bin. By default, a static library and executable are installed. If you want to install shared library versions, configure for shared libraries as described above. The procedures below go a bit more in detail, by explaining how to setup the environment for compiling the C extensions for each OS, and how to install the GMP library. Compiling in Linux Ubuntu ¶ Note.

Next: ABI and ISA, Previous: Installing GMP, Up: Installing GMP [Index]

2.1 Build Options

All the usual autoconf configure options are available, run ‘./configure--help’ for a summary. The file INSTALL.autoconf has some genericinstallation information too.

Tools

configure’ requires various Unix-like tools. See Notes for Particular Systems, for some options on non-Unix systems.

It might be possible to build without the help of ‘configure’, certainlyall the code is there, but unfortunately you’ll be on your own.

Build Directory

To compile in a separate build directory, cd to that directory, andprefix the configure command with the path to the GMP source directory. Forexample

Installing Gmp Library On Mac

Not all ‘make’ programs have the necessary features (VPATH) tosupport this. In particular, SunOS and Slowaris make have bugs thatmake them unable to build in a separate directory. Use GNU makeinstead.

--prefix and --exec-prefix

The --prefix option can be used in the normal way to direct GMP toinstall under a particular tree. The default is ‘/usr/local’.

--exec-prefix can be used to direct architecture-dependent files likelibgmp.a to a different location. This can be used to sharearchitecture-independent parts like the documentation, but separate thedependent parts. Note however that gmp.h isarchitecture-dependent since it encodes certain aspects of libgmp, soit will be necessary to ensure both $prefix/include and$exec_prefix/include are available to the compiler.

--disable-shared, --disable-static

By default both shared and static libraries are built (where possible), butone or other can be disabled. Shared libraries result in smaller executablesand permit code sharing between separate running processes, but on some CPUsare slightly slower, having a small cost on each function call.

Native Compilation, --build=CPU-VENDOR-OS

For normal native compilation, the system can be specified with‘--build’. By default ‘./configure’ uses the output from running‘./config.guess’. On some systems ‘./config.guess’ can determinethe exact CPU type, on others it will be necessary to give it explicitly. Forexample,

In all cases the ‘OS’ part is important, since it controls how libtoolgenerates shared libraries. Running ‘./config.guess’ is the simplest wayto see what it should be, if you don’t know already.

Cross Compilation, --host=CPU-VENDOR-OS

When cross-compiling, the system used for compiling is given by ‘--build’and the system where the library will run is given by ‘--host’. Forexample when using a FreeBSD Athlon system to build GNU/Linux m68k binaries,

Compiler tools are sought first with the host system type as a prefix. Forexample m68k-mac-linux-gnu-ranlib is tried, then plainranlib. This makes it possible for a set of cross-compiling toolsto co-exist with native tools. The prefix is the argument to ‘--host’,and this can be an alias, such as ‘m68k-linux’. But note that toolsdon’t have to be setup this way, it’s enough to just have a PATH with asuitable cross-compiling cc etc.

Compiling for a different CPU in the same family as the build system is a formof cross-compilation, though very possibly this would merely be specialoptions on a native compiler. In any case ‘./configure’ avoids dependingon being able to run code on the build system, which is important whencreating binaries for a newer CPU since they very possibly won’t run on thebuild system.

In all cases the compiler must be able to produce an executable (of whateverformat) from a standard C main. Although only object files will go tomake up libgmp, ‘./configure’ uses linking tests for variouspurposes, such as determining what functions are available on the host system.

Install Gmp Library Mac

Currently a warning is given unless an explicit ‘--build’ is used whencross-compiling, because it may not be possible to correctly guess the buildsystem type if the PATH has only a cross-compiling cc.

Note that the ‘--target’ option is not appropriate for GMP. It’s for usewhen building compiler tools, with ‘--host’ being where they will run,and ‘--target’ what they’ll produce code for. Ordinary programs orlibraries like GMP are only interested in the ‘--host’ part, being wherethey’ll run. (Some past versions of GMP used ‘--target’ incorrectly.)

CPU types

In general, if you want a library that runs as fast as possible, you shouldconfigure GMP for the exact CPU type your system uses. However, this may meanthe binaries won’t run on older members of the family, and might run slower onother members, older or newer. The best idea is always to build GMP for theexact machine type you intend to run it on.

The following CPUs have specific support. See configure.ac for detailsof what code and compiler options they select.

  • Alpha:‘alpha’,‘alphaev5’,‘alphaev56’,‘alphapca56’,‘alphapca57’,‘alphaev6’,‘alphaev67’,‘alphaev68’‘alphaev7
  • Cray:‘c90’,‘j90’,‘t90’,‘sv1
  • HPPA:‘hppa1.0’,‘hppa1.1’,‘hppa2.0’,‘hppa2.0n’,‘hppa2.0w’,‘hppa64
  • IA-64:‘ia64’,‘itanium’,‘itanium2
  • MIPS:‘mips’,‘mips3’,‘mips64
  • Motorola:‘m68k’,‘m68000’,‘m68010’,‘m68020’,‘m68030’,‘m68040’,‘m68060’,‘m68302’,‘m68360’,‘m88k’,‘m88110
  • POWER:‘power’,‘power1’,‘power2’,‘power2sc
  • PowerPC:‘powerpc’,‘powerpc64’,‘powerpc401’,‘powerpc403’,‘powerpc405’,‘powerpc505’,‘powerpc601’,‘powerpc602’,‘powerpc603’,‘powerpc603e’,‘powerpc604’,‘powerpc604e’,‘powerpc620’,‘powerpc630’,‘powerpc740’,‘powerpc7400’,‘powerpc7450’,‘powerpc750’,‘powerpc801’,‘powerpc821’,‘powerpc823’,‘powerpc860’,‘powerpc970
  • SPARC:‘sparc’,‘sparcv8’,‘microsparc’,‘supersparc’,‘sparcv9’,‘ultrasparc’,‘ultrasparc2’,‘ultrasparc2i’,‘ultrasparc3’,‘sparc64
  • x86 family:‘i386’,‘i486’,‘i586’,‘pentium’,‘pentiummmx’,‘pentiumpro’,‘pentium2’,‘pentium3’,‘pentium4’,‘k6’,‘k62’,‘k63’,‘athlon’,‘amd64’,‘viac3’,‘viac32
  • Other:‘arm’,‘sh’,‘sh2’,‘vax’,

CPUs not listed will use generic C code.

Generic C Build

If some of the assembly code causes problems, or if otherwise desired, thegeneric C code can be selected with the configure --disable-assembly.

Note that this will run quite slowly, but it should be portable and should atleast make it possible to get something running if all else fails.

Fat binary, --enable-fat

Using --enable-fat selects a “fat binary” build on x86, whereoptimized low level subroutines are chosen at runtime according to the CPUdetected. This means more code, but gives good performance on all x86 chips.(This option might become available for more architectures in the future.)

ABI

On some systems GMP supports multiple ABIs (application binary interfaces),meaning data type sizes and calling conventions. By default GMP chooses thebest ABI available, but a particular ABI can be selected. For example

See ABI and ISA, for the available choices on relevant CPUs, and whatapplications need to do.

CC, CFLAGS

By default the C compiler used is chosen from among some likely candidates,with gcc normally preferred if it’s present. The usual‘CC=whatever’ can be passed to ‘./configure’ to choose somethingdifferent.

For various systems, default compiler flags are set based on the CPU andcompiler. The usual ‘CFLAGS='-whatever'’ can be passed to‘./configure’ to use something different or to set good flags for systemsGMP doesn’t otherwise know.

The ‘CC’ and ‘CFLAGS’ used are printed during ‘./configure’,and can be found in each generated Makefile. This is the easiest wayto check the defaults when considering changing or adding something.

Note that when ‘CC’ and ‘CFLAGS’ are specified on a systemsupporting multiple ABIs it’s important to give an explicit‘ABI=whatever’, since GMP can’t determine the ABI just from the flags andwon’t be able to select the correct assembly code.

If just ‘CC’ is selected then normal default ‘CFLAGS’ for thatcompiler will be used (if GMP recognises it). For example ‘CC=gcc’ canbe used to force the use of GCC, with default flags (and default ABI).

CPPFLAGS

Any flags like ‘-D’ defines or ‘-I’ includes required by thepreprocessor should be set in ‘CPPFLAGS’ rather than ‘CFLAGS’.Compiling is done with both ‘CPPFLAGS’ and ‘CFLAGS’, butpreprocessing uses just ‘CPPFLAGS’. This distinction is because mostpreprocessors won’t accept all the flags the compiler does. Preprocessing isdone separately in some configure tests.

CC_FOR_BUILD

Some build-time programs are compiled and run to generate host-specific datatables. ‘CC_FOR_BUILD’ is the compiler used for this. It doesn’t needto be in any particular ABI or mode, it merely needs to generate executablesthat can run. The default is to try the selected ‘CC’ and some likelycandidates such as ‘cc’ and ‘gcc’, looking for something that works.

No flags are used with ‘CC_FOR_BUILD’ because a simple invocation like‘cc foo.c’ should be enough. If some particular options are requiredthey can be included as for instance ‘CC_FOR_BUILD='cc -whatever'’.

C++ Support, --enable-cxx

C++ support in GMP can be enabled with ‘--enable-cxx’, in which case aC++ compiler will be required. As a convenience ‘--enable-cxx=detect’can be used to enable C++ support only if a compiler can be found. The C++support consists of a library libgmpxx.la and header filegmpxx.h (see Headers and Libraries).

A separate libgmpxx.la has been adopted rather than having C++ objectswithin libgmp.la in order to ensure dynamic linked C programs aren’tbloated by a dependency on the C++ standard library, and to avoid any chancethat the C++ compiler could be required when linking plain C programs.

Install Gmp Library Machine

libgmpxx.la will use certain internals from libgmp.la and canonly be expected to work with libgmp.la from the same GMP version.Future changes to the relevant internals will be accompanied by renaming, so amismatch will cause unresolved symbols rather than perhaps mysteriousmisbehaviour.

In general libgmpxx.la will be usable only with the C++ compiler thatbuilt it, since name mangling and runtime support are usually incompatiblebetween different compilers.

CXX, CXXFLAGS

When C++ support is enabled, the C++ compiler and its flags can be set withvariables ‘CXX’ and ‘CXXFLAGS’ in the usual way. The default for‘CXX’ is the first compiler that works from a list of likely candidates,with g++ normally preferred when available. The default for‘CXXFLAGS’ is to try ‘CFLAGS’, ‘CFLAGS’ without ‘-g’, thenfor g++ either ‘-g -O2’ or ‘-O2’, or for other compilers‘-g’ or nothing. Trying ‘CFLAGS’ this way is convenient when using‘gcc’ and ‘g++’ together, since the flags for ‘gcc’ willusually suit ‘g++’.

It’s important that the C and C++ compilers match, meaning their startup andruntime support routines are compatible and that they generate code in thesame ABI (if there’s a choice of ABIs on the system). ‘./configure’isn’t currently able to check these things very well itself, so for thatreason ‘--disable-cxx’ is the default, to avoid a build failure due to acompiler mismatch. Perhaps this will change in the future.

Incidentally, it’s normally not good enough to set ‘CXX’ to the same as‘CC’. Although gcc for instance recognises foo.cc asC++ code, only g++ will invoke the linker the right way whenbuilding an executable or shared library from C++ object files.

Install gmp library mac download
Temporary Memory, --enable-alloca=<choice>

GMP allocates temporary workspace using one of the following three methods,which can be selected with for instance‘--enable-alloca=malloc-reentrant’.

  • alloca’ - C library or compiler builtin.
  • malloc-reentrant’ - the heap, in a re-entrant fashion.
  • malloc-notreentrant’ - the heap, with global variables.

For convenience, the following choices are also available.‘--disable-alloca’ is the same as ‘no’.

  • yes’ - a synonym for ‘alloca’.
  • no’ - a synonym for ‘malloc-reentrant’.
  • reentrant’ - alloca if available, otherwise‘malloc-reentrant’. This is the default.
  • notreentrant’ - alloca if available, otherwise‘malloc-notreentrant’.

alloca is reentrant and fast, and is recommended. It actually allocatesjust small blocks on the stack; larger ones use malloc-reentrant.

malloc-reentrant’ is, as the name suggests, reentrant and thread safe,but ‘malloc-notreentrant’ is faster and should be used if reentrancy isnot required.

The two malloc methods in fact use the memory allocation functions selected bymp_set_memory_functions, these being malloc and friends bydefault. See Custom Allocation.

Bmw e39 bentley manual download. An additional choice ‘--enable-alloca=debug’ is available, to help whendebugging memory related problems (see Debugging).

FFT Multiplication, --disable-fft

Vocal runs module vst free download. By default multiplications are done using Karatsuba, 3-way Toom, higher degreeToom, and Fermat FFT. The FFT is only used on large to very large operandsand can be disabled to save code size if desired.

Assertion Checking, --enable-assert

Install Gmp Library Mac Brew

This option enables some consistency checking within the library. This can beof use while debugging, see Debugging.

Execution Profiling, --enable-profiling=prof/gprof/instrument

Enable profiling support, in one of various styles, see Profiling.

Install Gmp Library Mac Download

MPN_PATH

Various assembly versions of each mpn subroutines are provided. Iphone s serial number. For a givenCPU, a search is made though a path to choose a version of each. For example‘sparcv8’ has

which means look first for v8 code, then plain sparc32 (which is v7), andfinally fall back on generic C. Knowledgeable users with special requirementscan specify a different path. Normally this is completely unnecessary.

Documentation

The source for the document you’re now reading is doc/gmp.texi, inTexinfo format, see Texinfo in Texinfo.

Info format ‘doc/gmp.info’ is included in the distribution. The usualautomake targets are available to make PostScript, DVI, PDF and HTML (thesewill require various TeX and Texinfo tools).

DocBook and XML can be generated by the Texinfo makeinfo programtoo, see Options for makeinfo in Texinfo.

Install Gmp Library Mac Os

Some supplementary notes can also be found in the doc subdirectory.

Install Gmp Library Macomb

Next: ABI and ISA, Previous: Installing GMP, Up: Installing GMP [Index]

Comments are closed.