[clean-list] Use of ExtededArith with Clean-2.1.1 on Linux

Arjen van Weelden A.vanWeelden at cs.ru.nl
Mon Jun 26 15:56:13 MEST 2006


Hi,

Please see the email from John van Groningen to the Clean-list below.

kind regards,
	Arjen

j.romildo at gmail.com wrote:
> Hello.
> 
> I need the BigInt type from the ExtendedArith library on a program I am
> developing on Linux with Clean 2.1.1.
> 
> The Clean-2.1.1 distribution for Linux does not include this
> library. The ExtendedArith-1.0 from the Clean home page
> (http://www.cs.ru.nl/~clean/Download/Download_Libraries/download_libraries.html)
> does not compile with this version of the Clean compiler.
> 
> The ExtendedArith library distributed with the Windows version of
> Clean-2.1.1 compiles successfully on Linux. But linking fails because a
> Linux version of the gmp object code is needed. The one from
> ExtendArith-1.0 for Linux does not work.
> 
> So what advise do you have to me on how to get ExtendedArith working win
> Clean-2.1.1 on Linux?
> 
> Regards.
> _______________________________________________
> clean-list mailing list
> clean-list at science.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/clean-list


Isaac Gouy wrote:
 > >What needs to be done to link BigInt & GMP on Linux?
 > >
 > >See 
http://shootout.alioth.debian.org/gp4/benchmark.php?test=pidigits&lang=clean&id=0#log

The ExtendArith library for Clean was created with a modified gmp 2.0.2
library. The source code of this modified gmp library for linux can be
downloaded from the Clean 1.3 libraries download page. However, you probably
want to use a more recent (faster) and unmodified gmp library.

Current gmp libraries are however not compatible with gmp 2.0.2, because
the names of the functions that start with __mpn_ have been renamed, and
now start with __gmpn_. I have modified the ExtendedArith library to
use these new names, and modified the interface so that an unmodified
gmp library can be used.

You can download this library from:

http://www.cs.ru.nl/~clean/download/Clean21/linux/ExtendedArithLinux.tar.gz

See the file README for installation instructions.

This library does not include a gmp library. Instead a gmp library has
to be installed on your linux system first. After installing both
libraries you can compile and link a Clean program like this:

clm -I ExtendedArith -l ExtendedArith/gmp.o -l -lgmp pidigits

The gmp library is linked with "-l -lgmp", because clm passes the argument
after "-l" to the linker, so the linker is called with "-lgmp".

By the way, the example program that was included with ExtendedArith also
computes pi, but in a different way using arctan and is more than 20 times
faster for 2500 digits. (the last digit is however computed incorrectly).

Kind regards,

John van Groningen


More information about the clean-list mailing list