|
This page offers tips and tricks for building Regina successfully on various operating systems.
As always, it is much simpler to download and install a ready-made package if you can. Check out the Regina download tables and see if your distribution is supported.
Please also see the page on building from sources, which lists the system requirements and gives a general overview of the build process.
If these tips do not work for you, please mail the authors (including your CMakeCache.txt if possible) so that we can update the build scripts (and this page) to reflect systems like yours.
Regina can be installed anywhere (it does not need to live directly beneath /usr as in the past). The default is to install in /usr/local, though you can change this if you like by passing the argument CMAKE_INSTALL_PREFIX to cmake:
example$ cmake -DCMAKE_INSTALL_PREFIX=/home/bab/software ..
If you run a 64-bit version of linux (the x86_64 or amd64 architectures) and you use an RPM-based distribution (such as Fedora, Mandriva or SuSE), you may wish to set LIB_SUFFIX:
example$ cmake -DLIB_SUFFIX=64 ..
This ensures that Regina's libraries are installed in a 64-bit directory such as /usr/local/lib64/.
Debian-based distributions (such as Debian or Ubuntu) do not use special directory names for 64-bit systems, and you should not set LIB_SUFFIX on such machines.
The macOS build has evolved to remove the need for software environments such as MacPorts or Fink (and indeed, the macOS binaries here on the Regina website were built on a system without any such environment installed at all). The current situation is as follows:
For a full unix-like installation, assuming you already have an environment like MacPorts or Fink installed, you may need to pass additional arguments to cmake:
A complete example of a cmake line that uses the Qt and Python from MacPorts, and installs Regina in the default location /usr/local/:
example$ cmake -DPython_EXECUTABLE=/opt/local/bin/python3.11 ..
A complete example that uses the system Python and a prebuilt Qt from the Qt website, and installs Regina in a custom location beneath the user's home directory:
example$ cmake -DPython_EXECUTABLE=/usr/bin/python3 -DCMAKE_INSTALL_PREFIX=/Users/bab/software -DCMAKE_PREFIX_PATH=/Users/bab/Qt/6.4.0/macos ..
Building Regina under Windows is possible but extremely messy. If you are working with Regina's sources, we highly recommend that you do this under GNU/Linux or macOS.
If you really need to get a Windows build running, please mail the authors for assistance. Alternatively, you can look in Regina's packaging repository to get some idea of what the Regina developer has been doing to build the Windows binaries that you see here on the Regina website.
If you plan to use Regina in a high-performance computing environment such as a university cluster, you should set REGINA_INSTALL_TYPE to HPC. This will disable the graphical user interface, and will ensure that Regina's python module is installed alongside Regina (and not in the system python site-packages directory).
example$ cmake -DREGINA_INSTALL_TYPE=HPC ..
You will almost certainly not have root access to the cluster, which means you will need to install Regina beneath your home directory. You do this by creating a top-level install directory (say /home/bab/software) and then passing it as the install prefix to cmake:
example$ cmake -DREGINA_INSTALL_TYPE=HPC -DCMAKE_INSTALL_PREFIX=/home/bab/software ..
Regina will now install its various components in the subdirectories /home/bab/software/bin, /home/bab/software/lib, /home/bab/software/share and so on. If you set REGINA_INSTALL_TYPE=HPC as described above, Regina will install its Python module in /home/bab/software/lib/regina/python.
You should pass an absolute path as your install prefix (not ~/software or ../software, for instance). It is best if this is not the directory in which you unpacked Regina's sources, since otherwise you may find it hard to untangle sources from binaries later on.
Regina's source code supports triangulations of all dimensions ≤ 15. However, supporting higher dimensions come with some overhead (particularly for Python users), and so Regina's ready-made packages and default builds only support dimensions 2–8.
If you need support for dimensions 9–15, you can build Regina yourself with the HIGHDIM flag set to 1. You should see the effect in the CMake output:
example$ cmake -DHIGHDIM=1 ..
-- The C compiler identification is AppleClang 13.0.0.13000029
...
-- Detecting CXX compile features - done
-- Dimensions 9-15: enabled
-- Regina install type: XDG
...
Once Regina is built and installed, you may wish to compile it into your own C++ programs. The helper script regina-engine-config gives you all of the necessary compiler and linker options for doing this. You can find this script with the other programs in prefix/bin, where prefix is your installation prefix.
To obtain a full set of compiler options:
example$ regina-engine-config --cflags
To obtain a full set of linker options:
example$ regina-engine-config --libs
You can use this script directly on the command-line (or in your Makefile). So, for instance, to compile the program myprog.cpp against Regina:
example$ g++ myprog.cpp `regina-engine-config --cflags --libs` -o myprog