arb/doc/source/setup.rst

107 lines
3.4 KiB
ReStructuredText
Raw Normal View History

2013-08-06 14:10:45 +02:00
.. _setup:
2013-05-31 19:40:05 +02:00
Setup
2012-10-11 13:09:44 +02:00
===============================================================================
Download
-------------------------------------------------------------------------------
Tarballs of released versions can be downloaded from https://github.com/fredrik-johansson/arb/releases
Alternatively, you can simply install Arb from a git checkout of https://github.com/fredrik-johansson/arb/.
The master branch is generally safe to use (the test suite should pass at all
times), and recommended for
keeping up with the latest changes.
2013-05-31 19:40:05 +02:00
Dependencies
-------------------------------------------------------------------------------
2012-10-11 13:09:44 +02:00
Arb has the following dependencies:
2013-05-31 20:47:08 +02:00
* Either MPIR (http://www.mpir.org) 2.6.0 or later, or GMP (http://www.gmplib.org) 5.1.0 or later.
If MPIR is used instead of GMP, it must be compiled with the ``--enable-gmpcompat`` option.
* MPFR (http://www.mpfr.org) 3.0.0 or later.
2014-11-15 16:53:38 +01:00
* FLINT (http://www.flintlib.org) version 2.4 or later. You may also
use a git checkout of https://github.com/fredrik-johansson/flint2
2013-05-31 19:40:05 +02:00
Installation as part of FLINT
-------------------------------------------------------------------------------
With a sufficiently new version of FLINT, Arb can be compiled as a FLINT
extension package.
Simply put the Arb source directory somewhere, say ``/path/to/arb``.
Then go to the FLINT source directory and build FLINT using::
./configure --extensions=/path/to/arb <other options>
make
make check (optional)
make install
This is convenient, as Arb does not need to be
configured or linked separately. Arb becomes part of the compiled FLINT
library, and the Arb header files will be installed along with the other
FLINT header files.
Standalone installation
-------------------------------------------------------------------------------
2012-10-11 13:09:44 +02:00
2013-05-31 19:40:05 +02:00
To compile, test and install Arb from source as a standalone library,
first install FLINT. Then go to the Arb source directory and run::
2012-10-11 13:09:44 +02:00
./configure <options>
make
2013-05-31 19:40:05 +02:00
make check (optional)
2012-10-11 13:09:44 +02:00
make install
2013-05-07 17:44:46 +01:00
If GMP/MPIR, MPFR or FLINT is installed in some other location than
2013-05-25 02:27:50 +02:00
the default path ``/usr/local``, pass
``--with-gmp=...``, ``--with-mpfr=...`` or ``--with-flint=...`` with
the correct path to configure (type ``./configure --help`` to show
2012-10-11 13:09:44 +02:00
more options).
2013-05-31 19:40:05 +02:00
Running code
-------------------------------------------------------------------------------
Here is an example program to get started using Arb:
2012-10-11 13:09:44 +02:00
.. code-block:: c
2014-09-25 16:34:50 +02:00
#include "arb.h"
2012-10-11 13:09:44 +02:00
int main()
{
2014-09-25 16:34:50 +02:00
arb_t x;
arb_init(x);
arb_const_pi(x, 50 * 3.33);
arb_printn(x, 50); printf("\n");
2014-11-15 16:53:38 +01:00
printf("Computed with arb-%s\n", arb_version);
2014-09-25 16:34:50 +02:00
arb_clear(x);
2012-10-11 13:09:44 +02:00
}
2013-05-31 19:40:05 +02:00
Compile it with::
gcc -larb test.c
or (if Arb is built as part of FLINT)::
gcc -lflint test.c
If the Arb/FLINT header and library files are not in a standard location
(``/usr/local`` on most systems), you may also have to pass options such as::
-I/path/to/arb -I/path/to/flint -L/path/to/flint -L/path/to/arb
to ``gcc``. Finally, to run the program, make sure that the linker
can find the FLINT (and Arb) libraries. If they are installed in a
nonstandard location, you can for example add this path to the
``LD_LIBRARY_PATH`` environment variable.
The output of the example program should be something like the following::
2012-10-11 13:09:44 +02:00
[3.1415926535897932384626433832795028841971693993751 +/- 6.28e-50]
2014-11-15 16:53:38 +01:00
Computed with arb-2.4.0