Mpfr

MPFR

The MPFR library [1] is a C library for Multiple-Precision Floating-point computations with correct Rounding. MPFR has continuously been supported by the INRIAand the current main authors come from the Caramel and AriC project-teams at Loria (Nancy, France) and LIP (Lyon, France) respectively; see more on the credit page. MPFR is based on the GMP multiple-precision library.

Module

If you need to build software the lists Mpfr as a dependency, it is sufficient to load the module. List the available versions:

module spider mpfr

Output:

--------------------------

  mpfr: mpfr/4.1.0

--------------------------

...

See how to load the version you need:

module spider mpfr/<version>

Load any required modules that are reported by the spider command, and then load the mpfr module:

module load mpfr/<version>

Usage

Request a compute node

srun --pty bash

Load the module

module load mpfr

Copy the file "mpfr-sample.c" from /usr/local/doc/MPFR

cp /usr/local/doc/MPFR/mpfr-sample.c .

Compile

gcc -o sample mpfr-sample.c -lmpfr

Run

./sample 

output:

Sum is 2.7182818284590452353602874713526624977572470936999595749669131

References:

[1] MPFR Home

[2] MPFR Tutorial