flatsurf / e-antic

Embedded algebraic number fields
https://flatsurf.github.io/e-antic/libeantic/
GNU Lesser General Public License v3.0
12 stars 11 forks source link

logo

e-antic

License: LGPL 3.0 or later Test Coverage DOI 10.5281/zenodo.5166953

(Real Embedded) Algebraic Number Theory


e-antic is a C/C++/Python library to deal with real embedded number fields built on top of ANTIC. It aims to provide the fastest possible exact arithmetic operations and comparisons.

Source tarballs can be downloaded at https://github.com/flatsurf/e-antic/releases.

This repository contains two related projects:

The dependencies are:

Build from the Source Code Repository or a Tarball

If you have cloned the source directory you will need to setup the configure script and Makefile using autotools. That is

git submodule update --init
./bootstrap

If you obtained a tarball of the sources or if the preceding step worked, you just have to do

./configure
make
make check  # to run our test suite
make install  # to install into /usr/local

If you happen to have any of FLINT, Arb, or ANTIC installed in a non standard directory, you will have to specify the CPPFLAGS and LDFLAGS variables for the configure script

./configure CPPFLAGS=-I/my/path/include LDFLAGS=-L/my/path/lib

For best performance run CFLAGS="-O3" CXXFLAGS="-O3" ./configure instead of ./configure. You might want to add -g3 to CFLAGS and CXXFLAGS which does not hurt performance but gives a better debugging experience. For the best debugging experience, you might want to replace -O3 with -Og or even -O0 but the latter results in poor performance.

If your compiler supports it, you can try to add -fvisibility=hidden -fvisibility-inlines-hidden to your CXXFLAGS. This hides internal bits in the resulting library which have lead to crashes in the past due to conflicting header-only libraries.

If your linker supports it, you should use ./configure --with-version-script to shrink the resulting shared library to an exact curated list of versioned symbols.

perf works well to profile when you make sure that CFLAGS and CXXFLAGS contain -fno-omit-framepointer. You can then for example run our test suite with perf record --call-graph dwarf make check. Apart from perf itself there are several ways to analyze the output, hotspot might be the most convenient one at the time of this writing.

For more detailed but generic instructions please refer to the INSTALL file.

Installation

See our documentation for installation instructions.

Run with binder in the Cloud

You can try out the projects in this repository in a very limited environment online by clicking the following links:

Build with conda-forge Dependencies

To build all of e-antic, you need a fairly recent C++ compiler and probably some packages that might not be readily available on your system. If you don't want to use your distribution's packages, you can use these dependencies from conda-forge. Download and install Mambaforge, then run

mamba create -n e-antic-build ccache
mamba env update -n e-antic-build -f libeantic/environment.yml
mamba env update -n e-antic-build -f pyeantic/environment.yml
mamba env update -n e-antic-build -f doc/environment.yml
conda activate e-antic-build
export CC="ccache cc"  # to speed up future compilation
export CXX="ccache c++"  # to speed up future compilation
git clone --recurse-submodules https://github.com/flatsurf/e-antic.git
cd e-antic
./bootstrap
./configure --prefix="$CONDA_PREFIX"
make
make check  # to run our test suite
make html  # to build the documentation

How to Cite this Project

If you have used this project in the preparation of a publication, please cite it as described on our zenodo page.

Acknowledgements

Maintainers