-
Notifications
You must be signed in to change notification settings - Fork 6
Windows Installation
There are two ways of installing the milk package on Windows. One way is to use the Windows Subsystem for Linux (WSL) feature, and the other using Windows command prompt (WCP). We do not recommend the WSL installation unless you like to mess around getting the entire ecosystem to work. Windows is less tested than the MAC and Linux environments. If you found a bug report an issue in issues tab of the MILK github.
Note 6/3/2023: There is a dependence issue we are solving for the Mystic/Spotlight tutorials. For now, only the MILK and CINEMA environments can be installed for Windows.
-
Install programs
-
MAUD
- Download "Maud.zip" and unzip into a folder.
- Recommend: unzip into
C:\Users\username\Workshop
-
Visual Studio Code
- Make sure the "add to path" option is checked. It is normally checked by default.
-
Anaconda
- Although it is not recommended, we recommend that you add Anaconda to path to ease of installation in the next parts. You can always remove it from path later.
- GitHub Desktop
-
CINEMA
- Using GitHub desktop, clone URL https://github.com/cinemascience/cinema_debye_scherrer.git
- Recommend: clone into
C:\Users\username\Workshop
-
MILK
- Using GitHub desktop, clone URL https://github.com/lanl/MILK.git
- Recommend: clone into
C:\Users\username\Workshop
-
MAUD
-
After anaconda is installed hit windows key and open "Anaconda Prompt". Navigate to the MILK clone folder using the command line. Then type the following commands:
conda env create -f environments/environment_windows.yml
conda activate rietveld
milk-config C:\Users\username\Workshop\Maud -c C:\Users\username\Workshop\cinema_debye_scherrer
-
Replace
C:\Users\username\Workshop\Maud
andC:\Users\username\Workshop\cinema_debye_scherrer
with the full paths to where you unzipped and copied Maud and where you cloned Cinema. -
After the paths are added with the milk-config command, you need to deactivate and then activate milk for the environment to be initialized:
conda deactivate
conda activate rietveld
- Next, open Visual studio code (VSC) and install Python extensions.
- Open the MILK folder in Visual Studio code, and then open any Python file in the explorer, such as "setup.py".
- Now you can set the default python interpreter. Press ctrl + shift + p to trigger the command pallet. Select Anaconda as the interpreter.
- From the menu on the top, create a new terminal. It normally starts with Powershell, change to command prompt as the default terminal. Activate milk in this terminal with
conda activate milk
- To validate the installation, we will now do tutorial 1 and 3. Navigate to a folder of choice (e.g. C:\Users\username\Workshop\Tutorials) and type the following commands in the Visual Studio code terminal with the milk environment active to copy the folders containing files for these two examples into the current working directory:
(rietveld) C:\Users\username\Workshop\Tutorials>milk-examples -e 1
(rietveld) C:\Users\username\Workshop\Tutorials>milk-examples -e 3
- Before running the first example, open the folder containing Maud then double click "Maud.bat" to launch Maud. Configure the compute environment in the Maud GUI and set the parallel options. Make sure to select "Save on disk":
- Turn on the console to view run-time messages from Maud:
- Following the wiki page for the first example, first run the batch processing via the MAUD GUI method to verify that everything works then run with MILK scripts.
NOTE: The WSL method currently has issues with Cinema visualization.
- To enable WSL, type "Turn Windows Features on or off" in the start menu. Scroll down and check the box for "Windows Subsystem for Linux.
- Search for WSL on Windows Store and install Ubuntu-22.04.2.
- Ubuntu will install then prompt you to create an account. When creating the username, use all lowercases and no special characters like space.
- Update the Ubuntu system by running
sudo apt update
thensudo apt upgrade
.
- Install Anaconda for Linux:
- Navigate to Anaconda downloads and find the Anaconda for Linux version for your computer, most likely the 6"4-Bit (x86) Installer". Copy the link address of the file to download.
- You are most likely in "/home/username/" folder, create a Downloads folder with
mkdir Downloads
- Use command
wget [link]
and replace [link] with the link of the Anaconda installer. This will download the installation script to the folder. Pasting in the WSL command line is mouse right click. - Use command 'bash Anaconda....sh` to install with the downloaded Anaconda script. Type "Ana" then press "tab" to let the terminal auto-complete the name.
- When prompted to restart the shell to let the installed Anaconda take effect, simply use command
source ~/.bashrc
to refresh the shell. Now you will see (base) appearing in front of the username and path handle.
- Install Mambaforge for Linux:
- Navigate to MambaForge site and copy the link address for Mambaforge for Linux, then use
wget
thenbash
, and finallysource
like we did with Anaconda.
- Navigate to MambaForge site and copy the link address for Mambaforge for Linux, then use
- Download MILK, Maud, and Cinema to Workshop folder.
- The purpose of Mambaforge is to fully install MILK. Before that, let's download these packages. Git is by default installed with Ubuntu.
- You are still in "Download" folder, navigate to directory above with
cd ..
then create a Workshop foldermkdir Workshop
. Then go in the folder withcd Workshop
. - Use command
git clone https://github.com/lanl/MILK.git
to download MILK into Workshop. - Use command
git clone https://github.com/cinemascience/cinema_debye_scherrer.git
to download Cinema into Workshop. - To download Maud, navigate to Maud Linux and download "Maud.tar.gz" to anywhere on your computer. Unzip the file and it will make a Maud folder and a _MACOSX folder. You can ignore the MACOSX folder and delete it.
- You won't be able to download the zip file or unzip directly into the Linux directory, but you can find the Ubuntu local files in your file explorer at the bottom of the left side under "Network", then copy the unzipped Maud folder into it:
- Check that you can see MILK, Maud, and Cinema with
ls
. - Navigate into the MILK folder
cd MILK
then use Mamba to install MILK and all the dependencies:mamba env create -f environments/environment_linux.yml
- Now you can use conda to activate the "rietveld" environment:
conda activate rietveld
- First, verify that the pip is installed correctly by typing "milk-" then press "tab" for auto-complete. Your terminal should print out all the installed python scripts in MILK:
- Finalize initializing MILK
- Find the path to Maud in the WSL Linux environment by navigating to the Maud folder:
cd ../Maud
. Then usepwd
to print the directory path, copy the path and put in a temporary notepad instance, - Do the same for Cinema path.
- Running
milk-config \path\to\MAUD -c \path\to\Cinema
and replace \path\to\MAUD with the Maud path you copied, and \path\to\Cinema with the Cinema path you copied. - Refresh the conda environment by first deactivate
conda deactivate
then activateconda activate rietveld
. Now you can type$MAUD_PATH
and$CINEMA_PATH
and it should print the paths we entered before.
- Find the path to Maud in the WSL Linux environment by navigating to the Maud folder:
- Finally, download and install Visual Studio code and add the Python and WSL extensions.
- In Visual Studio with WSL extension added and WSL terminal configured, you can click bottom left corner to connect to WSL:
- Now you can create a terminal in Visual Studio code and activate the rietveld environment there. This will be helpful for your own development needs as you can now open the scripts and execute them in the same place.
- To use Cinema, we need to enable WSL to open a browser to display the data. To do so, run the commands below or read for more detail here: https://github.com/wslutilities/wslu
sudo apt update
sudo apt install ubuntu-wsl
sudo add-apt-repository ppa:wslutilities/wslu
sudo apt update
sudo apt install wslu
- Complete WSLU installation by adding the line
export BROWSER=wslview
to your$HOME/.bashrc
:- Type `nano $HOME/.bashrc'
- Use down arrow key to go to the bottom of the file.
- Copy the line
export BROWSER=wslview
- Control + O to save, enter to confirm. Control + X to close.