All Products
Search
Document Center

Optimization Solver:Download and install the latest Optimization Solver SDK

Last Updated:Aug 02, 2024

This topic describes how to download and install the latest Optimization Solver SDK.

Important

If you have downloaded the Optimization Solver SDK, it indicates that you have read and agreed to Terms of Service.

Step 1: Download the latest Optimization Solver SDK

Most APIs in version V0.x and V1.x are different. Please pay attention to the corresponding version's API documentation when using them.

Latest version: V1.3.0 Release date: July 24, 2024.

V0.25.1

V1.3.0 (Latest)

Linux

linux64x86

File: mindopt-install-linux64x86-0.25.1.sh

Download

File: mindopt-install-linux64x86-1.3.0.sh

Download

linux64aarch

File: mindopt-install-linux64aarch-0.25.1.sh

Download

File: mindopt-install-linux64aarch-1.3.0.sh

Download

Windows

windows64

File: mindopt-0.25.1.msi

Download

File: mindopt-1.3.0.msi

Download

macOS

osx64x86

(Intel)

File: mindopt-install-osx64x86-0.25.1.sh

Download

File: mindopt-install-osx64x86-1.3.0.sh

Download

osx64aarch

(Apple Silicon)

File: mindopt-install-osx64aarch-0.25.1.sh

Download

File: mindopt-install-osx64aarch-1.3.0.sh

Download

Supported platforms are:

Operating system

Specification

Windows

Windows >= 10

Linux

Glibc for x86_64 >= 2.14, for aarch64 >= 2.17

OSX

OSX for x86_64 >= 11.0, for arm64 >= 12.0

Language

Recommended compiler

C

Visual Studio >= 2019, GCC >= 4.9, Clang++

C++

Visual Studio >= 2019, GCC >= 4.9, Clang++

C#

.NET SDK 8.0 or higher

Java

jdk >= 1.8

Python

Anaconda Python 3.6, 3.7, 3.8, 3.9, 3.10

(Note: No py3.6 in linux aarch64, and no py3.6 and py3.7 in osx arm64. )

For more information about changelogs or SDK packages of the history versions, see History versions of Solver SDK.

The following section describes how to install the latest Optimization Solver SDK. You can also follow the steps in Videos to install it.

Step 2: Install the Optimization Solver SDK (C,C++ and C# APIs supported)

Important
  • Before the Optimization Solver SDK is installed, clear or back up the previous Optimization Solver SDKs. For more information, see the "Uninstall and reinstall one or more Optimization Solver SDK versions" section of this topic.

  • Before you install Java and Python APIs, you must complete this step 2. For more information, see Step 5 and Step 6 in this topic.

Windows operating systems:

Double-click the SDK installation package and install the SDK as prompted.

If you want to install the SDK for all users, run the installation package as an administrator. The installation method: Run the command prompt as an administrator, switch to the folder where the installation package resides, and then execute the installation package file.

Linux operating systems:

Run the following command in the system command line and install the SDK as prompted:

bash mindopt-install-linux64x86-1.3.0.sh

Or forARM version:

bash mindopt-install-linux64aarch-1.3.0.sh

If you install the SDK in a Docker container, add the following configurations to the dockerfile file:

# In this example, an admin user is used.
RUN cd /home/admin/mindopt/ && \
    bash mindopt-install-linux64x86-1.3.0.sh --target /home/admin/mindopt && \
    rm -rf mindopt-install-linux64x86-1.3.0.sh

# Set environment variables of Optimization Solver.
ENV MINDOPT_HOME /home/admin/mindopt/1.3.0
ENV PATH $MINDOPT_HOME/linux64-x86/bin:${PATH}
ENV LD_LIBRARY_PATH $MINDOPT_HOME/linux64-x86/lib:$LD_LIBRARY_PATH

macOS operating systems:

The installation method of the SDK for macOS operating systems is the same as that of the SDK for Linux operating systems. Run the following command in the system command line and install the SDK as prompted:

bash mindopt-install-osx64x86-1.3.0.sh

Or for Apple Silicon:

bash mindopt-install-osx64aarch-1.3.0.sh

The following figure shows the file directory structure after the Optimization Solver SDK is installed. The file directory structure includes:

  • 1.1.0 root folder. "1.1.0" indicates the Optimization Solver SDK version. Multiple Optimization Solver SDK versions can be installed in the mindopt directory at the same time.

  • osx64-x86 folder. Executable files, dynamic libraries, and other data are stored in this folder. This folder has the following names that correspond to different operating systems: win64-x86, linux64-x86, osx64-x86, linux64-aarch and osx64-aarch. You can use a name of the folder to check whether the desired Optimization Solver SDK version is installed.

  • examples folder. Pay attention to this folder. A variety of sample codes or data of programming languages and modeling tools are stored in this folder. This helps you quickly understand Optimization Solver.

  • docs folder. The Readme.txt file used to instruct users to use Optimization Solver and an end-user license agreement (EULA) are stored in this folder.

  • fl_client.ini file: the license file that you need to create. The following section describes the license file.

image..png

Step 3: Check environment variables and test the running of Optimization Solver

Check the environment variables that are configured when you install the Optimization Solver SDK. If multiple Optimization Solver SDK versions are installed, you need to change the effective SDK version based on your business requirements.

Windows operating systems:

Environment variables named MINDOPT_HOME and Path are automatically added when you install the Optimization Solver SDK. You do not need to manually add them. If multiple Optimization Solver SDK versions are installed, you need to change the effective SDK version by modifying the setting of the MINDOPT_HOME environment variable, as shown in the following figure.

箭头去除1.png

Linux and macOS operating systems:

The source ~/.mdo_profile command is added to the ~/.bashrc file and the ~/.zshrc file when you install the Optimization Solver SDK. After the Optimization Solver SDK is installed, restart the terminal command line to make environment variables take effect. If multiple Optimization Solver SDK versions are installed, run the nano ~/.mdo_profile command to modify the settings of environment variables.

Run the following commands to view environment variables and make the environment variables immediately take effect:

source ~/.mdo_profile
cat ~/.mdo_profile

If you install the SDK in a Docker container, run the export command to view environment variables.

After you check environment variables, enter mindopt in the command line to check whether the Optimization Solver SDK is installed. The following figure provides an example:

image.png

Optimization Solver running failure and troubleshooting:

If Optimization Solver fails to be run, the possible cause is that the execution of an executable file is not supported in your operating system. You can run one of the following commands to modify the permissions of the executable file.

Linux operating systems:

chmod u+x $MINDOPT_HOME/linux64-x86/bin/mindopt

macOS operating systems:

chmod u+x $MINDOPT_HOME/osx64-x86/bin/mindopt

Some operating systems may reject the running of Optimization Solver because the software of developers does not pass security verification. For example, if this issue occurs in macOS operating systems, you can click Still Permit in the Security and Privacy dialog box to resolve this issue. For more information, see the "Installation" section of the FAQ topic.

Step 4: Configure license files

When you use the solving feature, you need to configure license files. Optimization Solver supports the following authentication methods:

  • 1. Cloud-based authentication: Alibaba Cloud users can follow the steps in the "3. Use the license key of Alibaba Cloud for authentication" section of the Activate and use the service topic to obtain the license key and configure the fl_client.ini license file. Then, place the license file in the following recommended directory.

    This license is bound to an Alibaba Cloud account. You can use Optimization Solver to solve problems on your computers. The connect to the Internet is only for authentication, and you do not need to upload other information or problem data.

    Benefits of this authentication method:

    • Users can apply for license keys by themselves. After they apply for license keys, the license keys are immediately issued.

    • One license key can be used on multiple computers at the same time.

    • If this license is about to expire, you will receive text message notifications from Alibaba Cloud. Then, you can renew the license on the Optimization Solver console webpage. You do not need to change the license file.

  • 2. Local authentication: If you do not connect to the Internet, you can use the mindopt.lic file for local authentication. The mindopt.lic file is bound to a specified machine ID. The mindopt.lic file is generated by using the machine ID. If you do not connect to the Internet and require local authentication, contact us to apply for the mindopt.lic file.

Note:

During authentication, Optimization Solver automatically searches for the license file based on the environment variable settings, the mindopt.lic file first and then the fl_client.ini file. When a license file is found, Optimization Solver verifies the validity of the file.

  • In Optimization Solver SDK V0.20.x and later, you do not need license file to solve an optimization problem that involves less than 300 variables and 300 constraints. If the mindopt.lic or fl_client.ini license file fails to be verified, the authentication-free logic is used.

  • The names of license files are fixed and cannot be changed.

Paths of license files:

  • (Recommended) You can set the MINDOPT_LICENSE_PATH environment variable to specify where license files are stored.

The following sample code shows how to set environment variables in Linux and macOS operating systems. For more information about how to modify an environment variable file, see Step 3 in this topic.

export MINDOPT_LICENSE_PATH=$HOME/mindopt

The following figure shows how to set environment variables in Windows operating systems. For more information, see License settings.

Set environment variables

  • If environment variables are not set, Optimization Solver searches for the fl_client.ini or mindopt.lic license file in the {Root directory of the user}\mindopt directory by default.

    • For example, if you log on to Optimization Solver as an administrator in Windows operating systems, the fl_client.ini license file is stored in the C:\Users\Administrator\mindopt\fl_client.ini directory.

    • For example, the fl_client.ini license file is stored in the ~/mindopt/fl_client.ini directory in Linux operating systems.

(Optional) Step 5: Install Java APIs

There is the .jar file in the folder: <MDOHOME>/<VERSION>/<PLATFORM>/lib/mindoptj.jar.

Users can use it by editing the pom.xml file. For example, in osx64-x86:

<dependency>
    <groupId>com.alibaba.damo</groupId>
    <artifactId>mindoptj</artifactId>
    <version>1.3.0</version>
    <scope>system</scope>
    <systemPath>${env.MINDOPT_HOME}/osx64-x86/lib/mindoptj.jar</systemPath>
</dependency>

(Optional) Step 6: Install Python APIs

Important

From version V0.24.1, Python users can install the MindOpt Python package by pip install mindoptpy. A specific license is include in it, valid from 2023/01/01 to 2024/12/31.

This installation method only supports the “mindoptpy” library and does not support other features such as Command-line. If you need other features, please do a complete installation by referring to step1 and step2.

Afer you installed the package in step 2, you can run the following command to install Python APIs:

python <MDOHOME>/<VERSION>/<PLATFORM>/lib/python/setup.py install
# And then install other dependency: numpy and scipy
pip install numpy scipy

Command in Windows operating systems:

python %MINDOPT_HOME%\win64-x86\lib\python\setup.py install

Command in Linux operating systems:

python $MINDOPT_HOME/linux64-x86/lib/python/setup.py install

Command in macOS operating systems:

python $MINDOPT_HOME/osx64-x86/lib/python/setup.py install

Note

Optimization Solver supports Python 3.6 and later. If you run the provided sample code in Python 3.8 or later, you may be prompted that the mindoptpy file cannot be found. For more information about the solution and installation instructions, see MindOpt User Manual.

Use Optimization Solver

If you are a beginner, we recommend that you get started with Optimization Solver by following the instructions in the "4. Example of quick problem solving" section of the Activate and use the service topic. For more information, see User Manual of Optimization Solver.

Uninstall and reinstall one or more Optimization Solver SDK versions

Uninstall one or more Optimization Solver SDK versions

  • Windows operating systems:

Open Control Panel and choose Programs > Programs and Features. Find the MindOpt Optimization Solver SDK, then right-click and Uninstall it. Multiple Optimization Solver SDK versions can be installed at the same time and can be placed in different folders. If multiple Optimization Solver SDK versions are installed, please uninstall them one by one. Environment variables named MINDOPT_HOME and Path, which automatically added when you install the Optimization Solver SDK, will be deleted wil When you uninstall it.

If you install the Optimization Solver SDK as an administrator and perform the preceding steps to uninstall the Optimization Solver SDK, the solver have no permissions to modify the settings of environment variables. In this case, you can manually remove the environment variables or run the installation package as an administrator to uninstall the Optimization Solver SDK.

  • Linux and macOS operating systems:

To uninstall one or more Optimization Solver SDK versions, you only need to delete related files.

  1. Find the installation directory. Example: $HOME/mindopt specified during the installation.

  2. Modify the settings of environment variables. For example, modify the settings included in the ~/.bashrc file or the ~/.zshrc file, or delete the ~/.mdo_profile file.

  • Uninstall Python APIs: Uninstall unnecessary components such as pip3 uninstall mindoptpy by following the instructions in the setup.py file included in the SDK installation package.

Note

If you need to install one or more Optimization Solver SDK versions later, back up Optimization Solver license files or do not delete Optimization Solver license files. The paths of license files are $HOME/mindopt and C:\Users\Administrator\mindopt.

After some sample solving commands are run, .bas and .sol result files are generated. You can go to the installation directory to delete the result files.

Reinstall one or more Optimization Solver SDK versions

Multiple Optimization Solver SDK versions can be installed at the same time and are placed in different folders. You need to set environment variables based on the Optimization Solver SDK that you want to use. You do not need to modify license files.

  • Windows operating systems:

Double-click the .exe file to reinstall an Optimization Solver SDK. New environment variable settings will overwrite the existing environment variable settings. If multiple Optimization Solver SDK versions are reinstalled, multiple version folders are displayed. In this case, you need to change the effective SDK version by modifying the setting of the MINDOPT_HOME environment variable.

  • Linux and macOS operating systems:

Perform the preceding installation steps to reinstall one or more Optimization Solver SDK versions. Then, modify the settings of environment variables of Optimization Solver. For example, modify the settings included in the ~/.bashrc file, ~/.zshrc file, or referenced ~/.mdo_profile file.

Important

After one or more Optimization Solver SDK versions are reinstalled, you need to restart the CLI to make the environment variables take effect.