[Aldor-l] GMP and libraries

Christian Aistleitner tmgisi at gmx.at
Thu Nov 10 03:39:02 EST 2005


Hello,

when installing Aldor, one typically gets 2 versions of libaldor (debug,  
release) and 3 versions of libalgebra (debug, release, gmp). (I am talking  
about the 1.0.2 release of Aldor. Although the 1.0.3 version can already  
be downloaded, all version numbers on www.aldor.org still denote 1.0.2 as  
most up-to-date version. Therefore, 1.0.2 is chosen in this discussion.  
However, all of the discussed topics are also valid for 1.0.3)

As far as I can see, it is considered the default setup to have all these  
versions available.

I am not a fan of this setup. However, that is the way it currently is. I  
have to live with a default setup of 2-3 variants of each library, where a  
single variant would be more than sufficient.

Nevertheless, the gmp support has several issues.

First of all, why is there no gmp variant of libaldor?
After all, GMPInteger is defined in libaldor. Therefore, it is reasonable  
to expect a gmp variant.

I would expect that the definition of GMPInteger is inside a

#if GMP
...
#endif

block. However, it is not. Therefore, GMPInteger is available in every  
variant of libaldor.

Furthermore, several files of libalgebra use GMPInteger without an

#if GMP
...
#endif

block.

I am not sure, if these things have to be regarded as bug or are  
intentional. Therfore, I did not file a bug report. However, I would like  
to improve the situation.
What can be done to overcome these issues?

I would suggest to wrap the definition of GMP domains (GMPInteger,  
GMPFloat) by a

#if GMP
...
#endif

block. This raises the need for a gmp variant of libaldor. Then, there are  
3 versions of libaldor and also 3 versions of libalgebra. I consider this  
to be more consistent. This modification requires adjustments in the  
aldor.as include file for the GMP assertion to use the proper library  
(Similar to the algebra include file of 1.0.2).

These modifications introduces a clear distinction between the GMP  
variants and the non-GMP variants. Currently the border between these  
kinds of variants is more than fuzzy.

The next step has to replace GMPInteger by Integer in libalgebra, where  
this is possible. For example, why is
modp: (GMPInteger,I) -> I;
the signuature of the modp function of IntegerCRTLinearAlgebra ?
If GMPInteger is essential there, then I'd expect a #if GMP block.  
However, there is no #if GMP block.
However, for the current libraries this passage is also included in the  
release version of libalgebra.



More information about the Aldor-l mailing list