From 962039a00158a1d18578a0a128455263758ff940 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Thu, 17 Mar 2016 02:12:28 -0400 Subject: [PATCH] mpfr: Add a recipe to build mpfr. [skip appveyor] --- recipes/mpfr/build.sh | 7 +++++++ recipes/mpfr/meta.yaml | 32 ++++++++++++++++++++++++++++++++ recipes/mpfr/run_test.sh | 2 ++ recipes/mpfr/test.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 recipes/mpfr/build.sh create mode 100644 recipes/mpfr/meta.yaml create mode 100644 recipes/mpfr/run_test.sh create mode 100644 recipes/mpfr/test.c diff --git a/recipes/mpfr/build.sh b/recipes/mpfr/build.sh new file mode 100644 index 0000000000000..ad40b3973ec95 --- /dev/null +++ b/recipes/mpfr/build.sh @@ -0,0 +1,7 @@ +./configure --prefix=$PREFIX \ + --with-gmp=$PREFIX \ + --enable-static + +make +make check +make install diff --git a/recipes/mpfr/meta.yaml b/recipes/mpfr/meta.yaml new file mode 100644 index 0000000000000..58146ed1aad4c --- /dev/null +++ b/recipes/mpfr/meta.yaml @@ -0,0 +1,32 @@ +{% set version = "3.1.4" %} + +package: + name: mpfr + version: {{ version }} + +source: + fn: mpfr-{{ version }}.tar.bz2 + url: http://ftp.gnu.org/gnu/mpfr/mpfr-{{ version }}.tar.gz + md5: 482ab3c120ffc959f631b4ba9ec59a46 + +build: + number: 0 + skip: true # [win] + +requirements: + build: + - m4 + - libtool + - gmp + run: + - gmp + +about: + home: http://www.mpfr.org/ + license: LGPL 3 + summary: The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. + +extra: + recipe-maintainers: + - isuruf + - jakirkham diff --git a/recipes/mpfr/run_test.sh b/recipes/mpfr/run_test.sh new file mode 100644 index 0000000000000..04987010dc309 --- /dev/null +++ b/recipes/mpfr/run_test.sh @@ -0,0 +1,2 @@ +cc -L$PREFIX/lib -I$PREFIX/include -lmpfr -lgmp -Wl,-rpath,$PREFIX/lib $RECIPE_DIR/test.c -o test.o +./test.o diff --git a/recipes/mpfr/test.c b/recipes/mpfr/test.c new file mode 100644 index 0000000000000..726b23453dd58 --- /dev/null +++ b/recipes/mpfr/test.c @@ -0,0 +1,32 @@ +/* From http://www.mpfr.org/sample.html */ + +#include + +#include +#include + +int main (void) +{ + unsigned int i; + mpfr_t s, t, u; + + mpfr_init2 (t, 200); + mpfr_set_d (t, 1.0, MPFR_RNDD); + mpfr_init2 (s, 200); + mpfr_set_d (s, 1.0, MPFR_RNDD); + mpfr_init2 (u, 200); + for (i = 1; i <= 100; i++) + { + mpfr_mul_ui (t, t, i, MPFR_RNDU); + mpfr_set_d (u, 1.0, MPFR_RNDD); + mpfr_div (u, u, t, MPFR_RNDD); + mpfr_add (s, s, u, MPFR_RNDD); + } + printf ("Sum is "); + mpfr_out_str (stdout, 10, 0, s, MPFR_RNDD); + putchar ('\n'); + mpfr_clear (s); + mpfr_clear (t); + mpfr_clear (u); + return 0; +}