|
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 ..
As of Regina 7.4, the old LIB_SUFFIX option is no longer supported (and is no longer necessary). The correct library installation path should be deduced automatically, but if needed you can set CMAKE_INSTALL_LIBDIR when you run cmake (typical values would be lib or lib64).
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.12 ..
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.9.1/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. There are two ways to do this:
Both of these tools should be installed alongside Regina's other executables in prefix/bin, where prefix is your installation prefix.
See the Regina Handbook for a more detailed discussion, including examples of both methods.