Installation#

Dependencies#

mumax⁺ should work on any NVIDIA GPU. To get sarted you should install the following tools yourself. Open the dropdowns for more details.

CUDA Toolkit

To see which CUDA Toolkit works for your GPU’s Compute Capability, check this Stack Overflow post.

Important

Make especially sure that everything CUDA-related (like nvcc) can be found inside your PATH. On Linux, for instance, this can be done by editing your ~/.bashrc file and adding the following lines:

# add CUDA
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/> lib64:$LD_LIBRARY_PATH"

The paths may differ if the CUDA Toolkit was installed in a different location.

👉 Check CUDA installation with: nvcc --version

A C++ compiler which supports C++17
  • Linux: sudo apt-get install gcc
    • ⚠️ each CUDA version has a maximum supported gcc version. This StackOverflow answer lists the maximum supported gcc version for each CUDA version. If necessary, use sudo apt-get install gcc-<min_version> instead, with the appropriate <min_version>.

  • Windows:
    • CUDA does not support the gcc compiler on Windows, so download and install Microsoft Visual Studio with the “Desktop development with C++” workload. After installing, check if the path to cl.exe was added to your PATH environment variable (i.e., check whether where cl.exe returns an appropriate path like C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64). If not, add it manually.

👉 Check C installation with: gcc --version on Linux and where.exe cl.exe on Windows.

Git
  • Windows: Download and install.

  • Linux: sudo apt install git

👉 Check Git installation with: git --version

CPython (version ≥ 3.8 recommended), pip and miniconda/anaconda

All these Python-related tools should be included in a standard installation of Anaconda or Miniconda.

👉 Check installation with python --version, pip --version and conda --version.

Building mumax⁺#

First, clone the mumax⁺ Git repository. The --recursive flag is used in the following command to get the pybind11 submodule, which is needed to build mumax⁺.

git clone --recursive https://github.com/mumax/plus.git mumaxplus
cd mumaxplus

We recommend to install mumax⁺ in a clean conda environment as follows. You could also skip this step and use your own conda environment instead if preferred.

Tools automatically installed in the conda environment
  • cmake 4.0.0

  • Python 3.13

  • pybind11 v2.13.6

  • NumPy

  • matplotlib

  • SciPy

  • Sphinx

conda env create -f environment.yml
conda activate mumaxplus

Finally, build and install mumax⁺ using pip.

pip install .

Tip

If changes are made to the code, then pip install -v . can be used to rebuild mumax⁺, with the -v flag enabling verbose debug information.

If you want to change only the Python code, without needing to reinstall after each change, pip install -ve . can also be used.

Tip

The source code can also be compiled with double precision, by changing FP_PRECISION in CMakeLists.txt from SINGLE to DOUBLE before rebuilding.

add_definitions(-DFP_PRECISION=DOUBLE) # FP_PRECISION > should be SINGLE or DOUBLE

Check the compilation#

To check if you successfully compiled mumax⁺, we recommend you to run some examples from the examples/ directory, such as standard problem 4.

python examples/standardproblem4.py

Or you could run the tests from the test/ directory.

pytest test
Troubleshooting
  • (Windows) If you encounter the error No CUDA toolset found, try copying the files in NVIDIA GPU Computing Toolkit/CUDA/<version>/extras/visual_studio_integration/MSBuildExtensions to Microsoft Visual Studio/<year>/<edition>/MSBuild/Microsoft/VC/<version>/BuildCustomizations. See these instructions for more details.