#!/usr/bin/env python # coding: utf-8 # # Installation # # OOMMF Calculator (OOMMFC) can be used on all major operating systems, but requires an installation of OOMMF to function. Alternatively, OOMMFC can interface with Docker (https://www.docker.com/) to run OOMMF. The installation procedure is to: # # 1. Install OOMMF: # - a) Either by installing Docker from https://www.docker.com/products/overview (with Docker, OOMMFC will download the OOMMF software automatically). # - b) Or by installing OOMMF directly on your computer. # 2. Install OOMMFC # # For further instructions, refer to the section for the operating system you use. # # ## Windows # # ### OOMMF # # Note that you do not need to install OOMMF directly (following the next steps) if you install Docker instead. OOMMFC must be installed either way. # # 1. First, you need to install `tcl` on your machine. To do this, download the `.exe` file from http://www.activestate.com/activetcl/downloads appropriate for your Windows operating system (32-bit or 64-bit). After the download is complete, run the downloaded file and follow the instructions. # # 2. From http://math.nist.gov/oommf/software-12.html download the `.zip` file for the latest OOMMF version which is appropriate for your Windows OS (32-bit or 64-bit). After the download is complete, unzip (extract) this file. Locate among the the unzipped files `oommf.tcl` and remember its location. We are going to need it in step 3. # # 3. In order to help `oommfc` find where `oommf.tcl` is, we need to set the value of environment variable `OOMMFTCL`. To do this, in Control Panel, select System -> Advanced system settings (tab Advanced) -> Environment variables. In User variables select `New...` and type `OOMMFTCL` for Variable name and `C:\path\you\remembered\from\step2\oommf.tcl` to Variable value. # # ### OOMMFC # # 1. On Windows, before we install `oommfc`, we need to install `Python3` Anaconda distribution. Therefore, download "Graphical Installer" for `Python3` (or "Command-line installer" for `Python3` if you are confident with command prompt) from https://www.continuum.io/downloads#windows. After download is complete, run the `.exe` file and follow the instructions to install `Anaconda3`. # # 2. If you're experienced with Anaconda, you may want to create a new environment. If you do, run `conda install numpy scipy matplotlib` inside this environment. If you don't know about conda environments, skip this step. # # 3. Now we have everything required to install `oommfc`. Run in Command Prompt: # ``` # pip install oommfc # ``` # # ## MacOS # # ### OOMMF # # Note that you do not need to install OOMMF directly (following the next steps) if you install Docker instead. OOMMFC must be installed either way. # # 1. To compile OOMMF on MacOS, make sure you have `XCode` (installed from the AppStore) and `git` (https://git-scm.com/download/mac) installed. # # 2. clone the repository by typing # ``` # git clone https://github.com/fangohr/oommf.git # ``` # in your terminal. # # 3. To compile OOMMF, change the directory (`cd oommf`) and simply run: # ``` # make build-with-dmi-extension-all # ``` # # This command, apart from building OOMMF, will download and compile Dzyaloshinkii-Moriya extensions as well. For more information, please refer to the OOMMF [reporsitory](https://github.com/fangohr/oommf). # # 4. Finally, we have to set the environment variable `OOMMFTCL`, so that previously installed `oommfc` knows where to find OOMMF. Consequently, in your home directory, add the path to `oommf.tcl` file to the end of the `.bash_profile` file. More specifically, the line at the end of your file should look like: # ``` # export OOMMFTCL="/path/to/your/compiled/oommf.tcl" # ``` # **Please note that after editing `.bashrc` file, you need to refresh your environment variables** # ``` # source ~/.bashrc # ``` # **or simply by opening a new Terminal window.** # # ### OOMMFC # # 1. On MacOS, before we install `oommfc`, we need to install `Python3` Anaconda distribution. Therefore, download "Graphical Installer" for `Python3` (or "Command-line installer" for `Python3` if you feel confident with terminal) from https://www.continuum.io/downloads#osx. After the download is completed, run the `.pkg` file and follow the instructions to install `Anaconda3`. # # 2. Now we have everything required to install `oommfc`. Therefore, run in terminal: # ``` # python3 -m pip install oommfc # ``` # # ## Linux (Ubuntu) # # ### OOMMF # # Note that you do not need to install OOMMF directly if you install Docker instead. OOMMFC must be installed either way. # # 1. You can compile OOMMF on your machine by firstly installing required packages: # ``` # apt-get install git tcl-dev tk-dev # ``` # # 2. Clone the repository: # ``` # git clone https://github.com/fangohr/oommf.git # ``` # # 3. To compile OOMMF, change the directory (`cd oommf`) and simply run: # ``` # make build-with-dmi-extension-all # ``` # # This command, apart from building OOMMF, will download and compile Dzyaloshinkii-Moriya extensions as well. For more information, please refer to the OOMMF [reporsitory](https://github.com/fangohr/oommf). # # 4. Finally, we have to set the environment variable `OOMMFTCL`, so that previously installed `oommfc` knows where to find OOMMF. Consequently, in your home directory, add the path to `oommf.tcl` file to the end of the `.bashrc` file. More specifically, the line at the emd of your file should look like: # ``` # export OOMMFTCL="/path/to/your/oommf.tcl" # ``` # # **Please note that after editing `.bashrc` file, you need to refresh your environment variables** # ``` # source ~/.bashrc # ``` # **or simply by opening a new Terminal window.** # # ### OOMMFC # # 1. To install OOMMFC, we first have to make sure you have `pip` installed. **Please note that this command requires root privileges (sudo).** # ``` # apt-get install python3-pip # ``` # # 2. Now, we can install `oommfc` # # ``` # python3 -m pip install oommfc # ```