Building or installing
I provide packages for a number of distros. If possible, please use these instead of building from source. Contributions on this front are welcome.
Installing from packages
Debian-based
As of today (2022-02-27), mrcal is included in the bleeding-edge versions of Debian and Ubuntu. So if you're running at least Debian/testing or the not-yet-published Debian 12 (bookworm) or Ubuntu 22.04 (jammy), you can simply
apt install mrcal libmrcal-dev
to install (for instance) the commandline tools and the C development library respectively.
For older distros I currently distribute packages for
- Debian/sid (this will be removed soon since mrcal is now in the main Debian archives)
- Debian/buster
- Debian/bullseye
- Ubuntu/focal (20.04 LTS)
- Ubuntu/bionic (18.04 LTS)
To use these, add to your /etc/apt/sources.list
:
deb [trusted=yes] http://mrcal.secretsauce.net/packages/DISTRO/public/ DISTRO main
where DISTRO
is one of
sid
buster
bulleye
focal
bionic
Then, apt update && apt install mrcal libmrcal-dev
. The mrcal
package pulls
in the commandline tools and, indirectly, the python libraries. The
libmrcal-dev
is the C dev stuff; not needed if you're not building C code that
uses mrcal. The chessboard corner finder, while not strictly required, is needed
if you're doing chessboard-based calibrations. apt install mrgingham
Building from source
If you cannot use the packages for whatever reason, you must build from source.
This isn't difficult, but requires you to obtain all the dependencies. They're
listed in the Build-Depends
section of the sample package definition. Most of
these are available in most distros. Things that may not be:
libdogleg-dev
: the optimization library. Sources live here. You need at least version 0.15.3.vnlog
: the toolkit to manipulate textual tables. Sources live here. You only need this for the test suite. There's nothing to build. Simply downloading the sources and pointing thePATH
there is sufficient.python3-numpysane
: The make-numpy-reasonable library from here. You absolutely need at least version 0.35. Available in the usual places Python libraries live. This is a python-only library. Simply downloading the sources and pointing thePYTHONPATH
there is sufficient.python3-gnuplotlib
: The plotting library from here. You need at least version 0.38. Available in the usual places Python libraries live. This is a python-only library. Simply downloading the sources and pointing thePYTHONPATH
there is sufficient.mrgingham
: the chessboard corner finder. This isn't strictly a requirement - any corner finder can be used. If you want to use this one (and you can't use the packages), you need to build it. Sources live here.re2c
: parser-generator for the C code to parse.cameramodel
files. At least version 2 is required.
Once these are all downloaded, libdogleg
and re2c
built and the PATH
and
PYTHONPATH
set, we can build mrcal. The child processes need access to the
PATH
and PYTHONPATH
, so
export PATH export PYTHONPATH
If you "installed" libdogleg
somehow, then you're ready, so just make
.
Otherwise, tell the build about where the built libdogleg
is:
LIBDOGLEGDIR=.... CFLAGS=-I$LIBDOGLEGDIR LDFLAGS="-L$LIBDOGLEGDIR -Wl,-rpath=$LIBDOGLEGDIR" make
If that works, the test suite should all pass:
make test-nosampling
If stuff doesn't work, feel free to bug me. But you really should be using the packages, if at all possible