Installation on macOS¶
Here are described the main steps for installing and licensing Hexaly Optimizer on your computer. Hexaly Optimizer is implemented in C++ language. The software can be used either as a standalone executable or as a callable library (C++, Java, Python, .NET). Please check that your computer meets the minimum system requirements before installing the software.
System requirements¶
- Architecture: x64 or arm64.
- Operating systems: Mac OS 10.9 Mavericks (or superior) for x64, macOS 11 Big Sur (or superior) for arm64.
- For the C++ library: Xcode 6 (or superior) for x64, Xcode 11 (or superior) for arm64.
- For the Java library: Java 8 (or superior).
- For the .NET library: .NET 6.0 (or superior).
- For the Python library: Python 2.7, or Python >= 3.6.
Installation¶
Before anything else, please close all your opened terminals and IDE. If you haven’t done so yet, download Hexaly Optimizer for Mac OS X from the Hexaly website. Then launch LocalSolver_12_5_20240129_MacOS64.pkg and follow the given instructions.
Choose the install location of Hexaly Optimizer. Note that you can install
different versions of Hexaly Optimizer on your system but only the last
installed version will be easily accessible from the command line. To use the
previous ones, you have to use their exact path
(e.g. /opt/localsolver_11_5/bin/localsolver
). Except that, all versions of
Hexaly Optimizer can work together without any trouble.
Licensing for: Free Trial, Free Academic, Desktop or Server licenses¶
Note
If you don’t have your license yet, please go to our website to register and request a free academic license or a free trial license. As licenses are manually delivered by a member of the Hexaly team, the whole procedure can take a few days to complete (usually 1 day).
You simply have to put the correct license file in the installation folder of Hexaly Optimizer. For that:
- Go on Hexaly website, login on your account and download your license file.
- Copy the file
license.dat
downloaded from your account in /opt/localsolver_12_5/.
Licensing for: Floating or Site licenses¶
This procedure applies only if you bought a floating or an academic network license. You have to setup a token server and then license each client machine as follows.
For the token server¶
- Go to your account and download the license file of the token server.
- Copy the file
license.dat
downloaded from your account in /opt/localsolver_12_5/. - Open a terminal and launch the executable “lstokenserver”. Note that this program is launched in background and will keep running until the machine is shut down. You can safely close your terminal.
If you want to start automatically the token server when the machine is rebooted
you have to create an init script. You can also add the following line in
/etc/rc.local
:
/opt/localsolver_12_5/bin/lstokenserver
For each client machine¶
Create a new file and write the following line with the IP of the token server:
TOKEN_SERVER = <HOST NAME OR IP ADDRESS OF THE TOKEN SERVER>
Save it in /opt/localsolver_12_5/license.dat.
Note
The token server listens on TCP port 7462. Please ensure that your firewall is correctly configured to allow the trafic between the lstokenserver service and your applications.
Alternative license locations¶
If you want to use several licenses on the same machine, or if you have no write access to the default license location, you can specify a different license path. Hexaly will look at the following locations for a valid license file, in that order:
- The file the
LS_LICENSE_PATH
environment variable points to.- In the current directory, if a file named
license.dat
is present.- In the default location, /opt/localsolver_12_5/license.dat.
The Hexaly API provides methods to set the license path. To use it, please consult the documentation for your programming language.
License content can also be provided through a LS_LICENSE_CONTENT
environment variable. This variable content will have priority over the license
file.
Testing¶
Open a terminal in folder /opt/localsolver_12_5/ and enter the following line:
$ localsolver examples/toy/toy.lsp lsTimeLimit=1
If no error occurs, you are ready to use Hexaly Optimizer and solve your first model.
Uninstall Hexaly Optimizer¶
You must have root privileges on your computer to uninstall Hexaly Optimizer. Then, uninstall Hexaly Optimizer in 2 steps:
- Open a terminal as root and navigate to /opt/localsolver_12_5/
- Execute the following command line:
bash uninstall.sh