Skip to content

Mathematica

Load module

Mathematica is available in a software stack as a module:

module load mathematica

This makes the following Mathematica binaries available out-of-the-box, sourced from /beegfs/apps/generic/mathematica/13.0.0/bin:

lrwxrwxrwx 1 root root 19 Feb 28 12:22 math -> ../Executables/math
lrwxrwxrwx 1 root root 26 Feb 28 12:22 mathematica -> ../Executables/mathematica
lrwxrwxrwx 1 root root 26 Feb 28 12:22 Mathematica -> ../Executables/Mathematica
lrwxrwxrwx 1 root root 25 Feb 28 12:23 MathKernel -> ../Executables/MathKernel
lrwxrwxrwx 1 root root 18 Feb 28 12:21 mcc -> ../Executables/mcc
lrwxrwxrwx 1 root root 22 Feb 28 12:21 wolfram -> ../Executables/wolfram
lrwxrwxrwx 1 root root 28 Feb 28 12:22 WolframKernel -> ../Executables/WolframKernel
lrwxrwxrwx 1 root root 57 Mar  3 11:06 wolframscript -> ../SystemFiles/Kernel/Binaries/Linux-x86-64/wolframscript

In order to submit a job without GUI, you will need to use the wolframscript utility. To submit a job to the queue, you can use e.g. the following submission script:

#!/bin/sh
#
#SBATCH --job-name="mathematica"
#SBATCH --partition=compute
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=1G
#SBATCH --account=research-faculty-department

export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK

srun wolframscript -f file.wls -print all

Here, the file.wls is a text file with usual Mathematica commands.

Install locally

It is possible to locally install a TU Delft provided version of Mathematica. All you need to do is to run the installer, and to specify the correct license server.

1) Go to the official TU Delft software page: https://software.tudelft.nl/485/

2) Download Mathematica 13.0 for Linux.

3) Copy the installed to your /scratch folder on DelftBlue and run the installer:

$ mkdir /scratch/$USER/mathematica-local-installation
$ mkdir /scratch/$USER/mathematica-local-bin
$ chmod +x Mathematica_13.0.0_BNDL_LINUX.sh
$ ./Mathematica_13.0.0_BNDL_LINUX.sh

4) The installer starts, and prompts you with the installation destination and the binary destination:

Enter the installation directory, or press ENTER to select /usr/local/Wolfram/Mathematica/13.0:
> /scratch/$USER/mathematica-local-installation

Now installing...

[*****************************************************************************************************]

Type the directory path in which the Wolfram Mathematica script(s) will be created, or press ENTER
to select /usr/local/bin:
> /scratch/$USER/mathematica-local-bin

5) Export the binaries:

export PATH=/scratch/$USER/mathematica-local-bin:$PATH

6) Start Mathematica graphically on a visual node to connect to the license server:

$ Mathematica

Then choose "Other ways to activate" -> "Connect to a Network License Server" -> mathematica.lic.tudelft.nl

Mathematica activation

7) Now Mathematica works!

Mathematica works graphically

8) In order to submit a job without GUI, you will need to use the wolframscript utility. By default, it is not installed in your mathematica-local-bin. However, you can find it in mathematica-local-installation/Executables:

[dpalagin@login04 Executables]$ ls

math  mathematica  Mathematica  MathKernel  mcc  wolfram  WolframKernel  wolframscript

It runs as expected:

[dpalagin@login04 Executables]$ ./wolframscript

Wolfram Language 13.0.0 Engine for Linux x86 (64-bit)
Copyright 1988-2021 Wolfram Research, Inc.

In[1]:=

To submit a job to the queue, you can use e.g. the following submission script:

#!/bin/sh
#
#SBATCH --job-name="mathematica"
#SBATCH --partition=compute
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=1G
#SBATCH --account=research-faculty-department

export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK

srun wolframscript -f file.wls -print all

Here, the file.wls is a text file with usual Mathematica commands.