Difference between revisions of "Building the gmp"

From ApCoCoAWiki
(gmp and stack usage)
m
Line 1: Line 1:
 
=Build Options for the GMP=
 
=Build Options for the GMP=
  
There are many different possible configurations when building the gmp. One that is very important to CoCoA is how to allocate memory in the gmp since large numbers can overflow the stack quitre easily. For a general overview for the gmp 4.1 have a look [http://www.gnu.org/software/gmp/manual/html_node/Build-Options.html here].  
+
There are many different possible configurations when building the gmp. One that is very important to CoCoA is how to allocate memory in the gmp since large numbers can overflow the stack quite easily. For a general overview for the gmp 4.1 have a look at http://www.gnu.org/software/gmp/manual/html_node/Build-Options.html.  
  
 
So when configuring the gmp make sure that you choose  
 
So when configuring the gmp make sure that you choose  
 
  --enable-alloca=no
 
  --enable-alloca=no
in order to use malloc and thereby using the heap instead of the stack. This entails a small (rougly 2% or so) performance penalty but at least your computation finished instead of segfaulting for mysterious reasons.
+
in order to use malloc and thereby using the heap instead of the stack. This entails a small (roughly 2% or so) performance penalty but at least your computation finishes instead of segfaulting for mysterious reasons.
  
 
{{stub}}
 
{{stub}}

Revision as of 18:52, 15 November 2005

Build Options for the GMP

There are many different possible configurations when building the gmp. One that is very important to CoCoA is how to allocate memory in the gmp since large numbers can overflow the stack quite easily. For a general overview for the gmp 4.1 have a look at http://www.gnu.org/software/gmp/manual/html_node/Build-Options.html.

So when configuring the gmp make sure that you choose

--enable-alloca=no

in order to use malloc and thereby using the heap instead of the stack. This entails a small (roughly 2% or so) performance penalty but at least your computation finishes instead of segfaulting for mysterious reasons.

This article is a stub. You can make this wiki more useful by adding information.