README.md
1# E-ANTIC — (Real Embedded) Algebraic Number Theory
2
3E-ANTIC is a C/C++/Python library to deal with real embedded number fields
4built on top of ANTIC (https://github.com/wbhart/antic). Its aim is to have as
5fast as possible exact arithmetic operations and comparisons.
6
7Source tarballs can be downloaded at https://github.com/flatsurf/e-antic/releases.
8
9This repository contains two related projects:
10
11* **libeantic** a C/C++ library
12* **pyeantic** a Python wrapper for **libeantic**
13
14The dependencies are:
15
16 - [FLINT 2.6 or 2.7](http://flintlib.org)
17 - [Arb](http://arblib.org/)
18 - [ANTIC](https://github.com/wbhart/antic)
19 - [Boost](https://www.boost.org/) for the C++ library
20 - [cppyy](https://cppyy.readthedocs.io/en/latest/) for the Python wrapper
21
22## Build from the Source Code Repository or a Tarball
23
24If you have cloned the source directory you will need to setup the
25configure script and Makefile using autotools. That is
26
27 git submodule update --init
28 ./bootstrap
29
30If you obtained a tarball of the sources or if the preceding step
31worked, you just have to do
32
33 ./configure
34 make
35 make check
36 make install
37
38If you happen to have any of FLINT, Arb, or ANTIC installed in a non standard
39directory you will have to specify the `CPPFLAGS` and `LDFLAGS` variables for
40the configure script
41
42 ./configure CPPFLAGS=-I/my/path/include LDFLAGS=-L/my/path/lib
43
44For best performance run `CFLAGS="-O3" CXXFLAGS="-O3" ./configure` instead of
45`./configure`. You might want to add `-g3` to `CFLAGS` and `CXXFLAGS` which
46does not hurt performance but gives a better debugging experience. For the best
47debugging experience, you might want to replace `-O3` with `-Og` or even `-O0`
48but the latter results in poor performance.
49
50If your compiler supports it, you can try to add `-fvisibility=hidden
51-fvisibility-inlines-hidden` to your `CXXFLAGS`. This hides internal bits in
52the resulting library which have lead to crashes in the past due to conflicting
53header-only libraries.
54
55If your linker supports it, you should use `./configure --with-version-script`
56to shrink the resulting shared library to an exact curated list of versioned
57symbols.
58
59perf works well to profile when you make sure that `CFLAGS` and `CXXFLAGS`
60contain `-fno-omit-framepointer`. You can then for example run our test suite
61with `perf record --call-graph dwarf make check`. Apart from perf itself there
62are several ways to analyze the output,
63[hotspot](https://github.com/KDAB/hotspot) might be the most convenient one at
64the time of this writing.
65
66For more detailed but generic instructions please refer to the INSTALL file.
67
68## Install with Conda
69
70You can install this package with conda. Download and install
71[Miniconda](https://conda.io/miniconda.html), then run
72
73 conda config --add channels conda-forge
74 conda create -n eantic -c flatsurf libeantic libeanticxx pyeantic
75 conda activate eantic
76
77The latest (experimental) versions for conda are:
78
79| Name | Downloads | Version | Platforms |
80| --- | --- | --- | --- |
81| [![Build](https://img.shields.io/badge/recipe-e--antic-green.svg)](https://anaconda.org/flatsurf/e-antic) | [![Conda Downloads](https://img.shields.io/conda/dn/flatsurf/e-antic.svg)](https://anaconda.org/flatsurf/e-antic) | [![Conda Version](https://img.shields.io/conda/vn/flatsurf/e-antic.svg)](https://anaconda.org/flatsurf/e-antic) | [![Conda Platforms](https://img.shields.io/conda/pn/flatsurf/e-antic.svg)](https://anaconda.org/flatsurf/e-antic) |
82| [![Build](https://img.shields.io/badge/recipe-pyeantic-green.svg)](https://anaconda.org/flatsurf/pyeantic) | [![Conda Downloads](https://img.shields.io/conda/dn/flatsurf/pyeantic.svg)](https://anaconda.org/flatsurf/pyeantic) | [![Conda Version](https://img.shields.io/conda/vn/flatsurf/pyeantic.svg)](https://anaconda.org/flatsurf/pyeantic) | [![Conda Platforms](https://img.shields.io/conda/pn/flatsurf/pyeantic.svg)](https://anaconda.org/flatsurf/pyeantic) |
83
84## Install with your Distribution Tools
85
86Some Versions of E-ANTIC might also be available as part of your
87[distribution](https://repology.org/project/e-antic/packages).
88
89## Build with Conda Dependencies
90
91To build all of e-antic package, you need a fairly recent C++ compiler and
92probably some packages that might not be readily available on your system. If
93you don't want to use your distribution's packages, you can provide these
94dependencies with conda. Download and install
95[Miniconda](https://conda.io/miniconda.html), then run
96
97 conda create -n e-antic-build ccache
98 conda env update -n e-antic-build -f libeantic/environment.yml
99 conda env create -n e-antic-build -f pyeantic/environment.yml
100 conda activate e-antic-build
101 export CPPFLAGS="-isystem $CONDA_PREFIX/include"
102 export CFLAGS="$CPPFLAGS"
103 export LDFLAGS="-L$CONDA_PREFIX/lib -Wl,-rpath-link=$CONDA_PREFIX/lib"
104 export CC="ccache cc"
105 export CXX="ccache c++"
106 git clone --recurse-submodules https://github.com/flatsurf/e-antic.git
107 cd e-antic
108 ./bootstrap
109 ./configure --prefix="$CONDA_PREFIX"
110 make
111 make check| [![Build](https://img.shields.io/badge/recipe-libeantic-green.svg)](https://anaconda.org/flatsurf/libeantic) | [![Conda Downloads](https://img.shields.io/conda/dn/flatsurf/libeantic.svg)](https://anaconda.org/flatsurf/libeantic) | [![Conda Version](https://img.shields.io/conda/vn/flatsurf/libeantic.svg)](https://anaconda.org/flatsurf/libeantic) | [![Conda Platforms](https://img.shields.io/conda/pn/flatsurf/libeantic.svg)](https://anaconda.org/flatsurf/libeantic) |
112
113