GithubHelp home page GithubHelp logo

cscfi / csc-env-matlab Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 102 KB

MATLAB environment for HPC clusters at CSC.

License: MIT License

MATLAB 5.91% Shell 43.96% Lua 22.55% Dockerfile 27.58%
linux matlab cluster hpc apptainer-container singularity-container

csc-env-matlab's Introduction

csc-env-matlab

In this repository contains intructions for creating a containerized MATLAB and MATLAB Parallel Server (MPS) installation for Linux with Apptainer. Containerized installation is useful for Linux cluster environments. We need graphical user interface for installing MATLAB, for example, desktop or laptop computer. Currently, there are instructions for installing MATLAB version R2023b.

Installing MATLAB on local computer

License file

We use a network license for the installation. Network license queries the license permissions from a license server. We need a license file (such as license.lic) to connect to the license server with contents as follows:

SERVER <hostname> <host-id> <lmgrd-port>
USE_SERVER

The license file must contain appropriate values for hostname and host ID (MAC address) of the license server and TCP/IP port number of the license manager daemon (lmgrd) on the license server.

Download the MATLAB installer

Go to the downloads page and select the latest version and download matlab the installer for Linux. Then, create the installer directory and move the MATLAB installer to the installer directory and rename it to lowercase of the version string.

# Create the installer directory
mkdir -p installer

# Move and rename the installer
mv ~/Downloads/matlab_R2023b_glnxa64.zip installer/r2023b.zip

Then, create a new subdirectory for the installer version and unarchive the installer files to the directory.

# Create the installer directory for specific version
mkdir -p installer/r2023b

# Unarchive the installer into the directory
unzip installer/r2023b.zip -d installer/r2023b

Creating the MATLAB installation

Create installation directory and install matlab using the graphical installer to the directory.

# Create the installation directory.
mkdir -p matlab/r2023b/build

# Run the installer
./installer/r2023b/install

Supply your login information. During the installation we must set the following options:

  • LICENSING
    • Select appropriate license for the installation.
    • If required, supply the license file. For CSC's academic installations, we can use the license/academic.lic file.
  • DESTINATION
    • Select path to the installation directory.
    • CSC's MATLB interactive installation path is matlab/r2023b/build
    • CSC's MATLB Parallel Server installation path is mps/r2023b/build
  • PRODUCTS
    • Select necessary toolboxes to install.
    • CSC's MATLAB interactive installation requires MATLAB, MATLAB Compiler, MATLAB Compiler SDK, and Parallel Computing Toolbox toolboxes
    • CSC's MATLAB Parallel Server installation requires MATLAB and MATLAB Parallel Server toolboxes
  • OPTIONS
    • Unselect options to create symbolic links and sending information to matlab.
  • CONFIRMATION
    • Confirm the installation.

Building the MATLAB container

We build the container on top of a base container that contains the required dependencies to run MATLAB. Base container definitions are modified from the MathWorks official container images. The MATLAB container definition copies the MATLAB installation to /opt/matlab directory and sets the file permissions such that the installation is available for all users. We can build the MATLAB container as follows:

apptainer build matlab/r2023b/matlab.sif matlab/r2023b/matlab.def

Testing the MATLAB container

We can test the MATLAB container by running the ver function as follows:

apptainer exec matlab/r2023b/matlab.sif matlab -nodisplay -r 'ver; quit;'

Using the MATLAB container with wrapper scripts

We can use the container by creating wrapper scripts that call the MATLAB binaries from the container. Write the following scripts to the matlab file and give it execution permissions chmod u+x matlab.

#!/bin/bash
apptainer exec matlab/r2023b/matlab.sif matlab "$@"

On CSC's Puhti cluster, we can use the apptainer_wrapper which automatically bind mounts the cluster specific directories to the container. You can read about running container in CSC clusters.

csc-env-matlab's People

Contributors

jaantollander avatar nortamo avatar

Watchers

 avatar

Forkers

nortamo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.