Local install

Good to know: Universal is a header-only library, so there is no need to build and install any loadable libraries. Simply install the header files in an include directory and point your compiler to that directory to pick up a number system. The stereotypical structure is <universal/number/posit/posit.hpp>.

To install a local copy of Universal on your machine, execute the following sequence:

> git clone https://github.com/stillwater-sc/universal
> cd universal
> mkdir build
> cd build
> cmake -DBUILD_DEMONSTRATION=OFF ..
> sudo make install

As Universal is a header-only library, there is no need to build or include libraries, and we can immediately progress to installing the header files. Installing in system directories typically requires administrative privileges, so use sudo on Linux/Mac, and on Windows, use a terminal that has been started with administrative privileges.

Once installed, you can simply include the number system of interest in your program with includes of this form:

#include <universal/number/integer/integer.hpp>
#include <universal/number/fixpnt/fixpnt.hpp>
#include <universal/number/cfloat/cfloat.hpp>
#include <universal/number/posit/posit.hpp>
#include <universal/number/lns/lns.hpp>
// etc.

Last updated