From f5edda81424ae9044da44f6a1ae060d12c3dc36a Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Thu, 17 Mar 2016 02:12:28 -0400 Subject: [PATCH 1/2] mpfr: Add a recipe to build mpfr. [skip appveyor] --- recipes/mpfr/build.sh | 9 +++++++++ recipes/mpfr/meta.yaml | 38 ++++++++++++++++++++++++++++++++++++++ recipes/mpfr/run_test.sh | 2 ++ recipes/mpfr/test.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100755 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 100755 index 0000000000000..4ddf4bcf6955a --- /dev/null +++ b/recipes/mpfr/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +./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..c60f8baeb3eec --- /dev/null +++ b/recipes/mpfr/meta.yaml @@ -0,0 +1,38 @@ +{% 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 + +test: + commands: + - test -f ${PREFIX}/lib/libmpfr.a # [unix] + - test -f ${PREFIX}/lib/libmpfr.dylib # [osx] + - test -f ${PREFIX}/lib/libmpfr.so # [linux] + +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; +} From 1e5cf190532bd88012ab2e2da83e45f2d4ac65e4 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 28 Mar 2016 01:08:09 +0530 Subject: [PATCH 2/2] mpfr: export LD_LIBRARY_PATH --- recipes/mpfr/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/mpfr/build.sh b/recipes/mpfr/build.sh index 4ddf4bcf6955a..614226360ab5f 100755 --- a/recipes/mpfr/build.sh +++ b/recipes/mpfr/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH + ./configure --prefix=$PREFIX \ --with-gmp=$PREFIX \ --enable-static