4 Installation

In this section we discuss how to install and setup the MOSEK Optimizer API for Julia.

Important

Before running this MOSEK interface please make sure that you:

  • Installed MOSEK correctly. Some operating systems require extra steps. See the Installation guide for instructions and common troubleshooting tips.

  • Set up a license. See the Licensing guide for instructions.

Compatibility

The Optimizer API for Julia is compatible with Julia version 1.6 or later on 64bit platforms (Linux, Windows, macOS) supported by MOSEK.

The Optimizer API for Julia is not included in the MOSEK distribution, but should be installed using the built-in Julia package installation mechanism.

Locating files in the MOSEK Optimization Suite

The relevant files of the Optimizer API for Julia are organized as reported in Table 4.1.

Table 4.1 Relevant files for the Optimizer API for Julia.

Relative Path

Description

Label

<MSKHOME>/mosek/10.1/tools/examples/julia

Examples

<EXDIR>

<MSKHOME>/mosek/10.1/tools/examples/data

Additional data

<MISCDIR>

where

  • <MSKHOME> is the folder in which the MOSEK Optimization Suite has been installed,

  • <PLATFORM> is the actual platform among those supported by MOSEK, i.e. win64x86, linux64x86, osx64x86, osxaarch64, linuxaarch64.

Setting up paths

To install the Mosek Julia API from the Julia prompt, do

julia> import Pkg
julia> Pkg.add("Mosek")

The Mosek.jl package needs the MOSEK distro to be installed. It will do the following to locate the distro:

  • If the environment variable MOSEKJL_FORCE_DOWNLOAD is set, it will attempt to download and install the MOSEK distro from the MOSEK web page, otherwise

  • if the environment variable MOSEKBINDIR is set to point to the bin directory in the MOSEK distro installation, it will use that, otherwise

  • it will look in the user’s default home directory for the MOSEK distro installation.

4.1 Running Examples and Testing the Installation

First of all, to check that the Optimizer API for Julia was properly installed, start Julia and try

using Mosek,SparseArrays

env = makeenv()
task = maketask(env=env)

The installation can further be tested by running some of the enclosed examples. Open a terminal, change folder to <EXDIR> and use Julia to run a selected example, for instance:

julia lo1.jl