In the last weeks, @lemouth has been preparing a participative science project for the community in Hive to participate. For most of us, Particle Physics sounds completely out of our normal skills, that is why it is so suggestive the idea of collaborating to run simulations in our computer that can help on his research.
If you want to know more, he introduced the project in this post: Towards a citizen science particle physics research project on Hive. I am happy that he finally decided to launch the project, even though this will be extremely time consuming for him.
During some weeks (or months), we will be able to use a CERN software to run simulations that may contribute to the research of neutrino mass models. So, even though I think I may not have the time to commit to such a project, because it is extremely complicated to maintain the steady effort during the weeks, I didn't want to let this opportunity pass without giving it a try and test the software myself. In this way we can document a bit the process to help to following users and citizen scientists.
The instructions to follow during the first week are present in this blog entry: Citizen science particle physics project on Hive - Let’s get started!. This post is the report of the activities of that entry.
Task 1 - Installing Linux in a Virtual Machine (Xubuntu)
I have been a user of GNU/Linux as my only Operative System during many years, during university and after that. However, for simplicity, because I do not use my personal computer so much and for cross-compatibility, my personal laptop is running currently only on Windows 10. That is why I thought it may be interesting as well to document how to install a Virtual Machine, that can be extremely useful for many people in this context and many others (scientifical, technical or not). I have not done this in ages, so any comment is extremely welcome.
For that, I have decided to use Virtual Box, because I have some previous experience with it, and install on it Xubuntu 20.04, looking for an easy to use and light distribution, given that we will be mostly using command line so we can save some resources for the computations.
Download and install Virtual Box
This part is extremely easy, we will just go to the Virtual Box webpage. Remember to select "Windows Hosts" when choosing the package to download, since we are going to install it in a Windows Machine.
Figure 1. Virtual Box webpage
Figure 2. Packet selection
Then, just launch the installer. Most of the default installation setup is going to be enough. I would recommend to leave the default configuration that accepts USB support and Network cards.
Figure 3. Installation options
Figure 4. Installation process
Create a new Virtual Machine
Now Virtual box is installed in our computer, go to Machine -> New and the following message will pop-up:
Figure 5. Creating a new virtual machine
- A Name for your Virtual Machine. I took something explicative: "CitizenScienc"
- Machine Folder. This is the place in your computer where it will be saved. You can leave the default one.
- Type. Select Linux as we will need to create a Linux virtual machine.
- Version: I have selected Ubuntu (64-bit). Remember that this will need to be coherent with the Linux version you will download. Ubuntu and Xubuntu are part of the same family in this case, and I opted for a 64 bit architecture.
Now, some important decisions will have to be made. As you can see below, I chose to assign to the virtual machine 4 GB, that is half of the available in my machine. Remember we will do computations with this computer, so it will be probably better if we assign a considerable amount of Memory, but your computer where this virtual machine is running will need to run so remember to leave a nice margin as well.
Figure 6. Selecting the RAM for the virtual machine
Then we must assign a simulated hard disk, that will be saved as a file in our computer. I just kept it simple:
- VDI (VirtualBox Disk Image)
- Size Dynamically Allocated, so the file adjusts its size to its needs.
- Maximum Size: The Operative system + software will be already almost 9GB and we will need some space to generate our products. My current allocation is 35GB (Probably with too much extra margin). Note: This was updated after running Report #2.
Figure 7. Hard Disk Type
Figure 8. HDD size selection
Launch the Virtual Machine and install an Operative System (Xubuntu 20.04 LTS)
First, we are going to download the software. Typically, what is downloaded is a virtual image of a disc (*.iso), that is what was usually burned into a CD/DVD in the old times.
Just go to the Xubuntu webpage and click download. Xubuntu is a distribution very similar to Ubuntu. Ubuntu is extremely extended and famous for its easy installation, configuration and use. Xubuntu is a distribution using a lighter desktop environment (XFCE) and has been traditionally used for computers with lower resources.
The version I downloaded is the 20.04. Naming versions in the Ubuntu family are fun: typically they contain the year of the release and the month, having a release every April and October only, so only xx.04 and xx.10 are available. Why are we offered by default a version from 2020? Because they are called Long Term Support, that means the community is committed to maintain them for longer. Remember to download a 64-bit version because it is the architecture we selected before for our machine (or a 32 if you selected that). Download can take some time, in this case it was 1.7 GB
Now, when you have downloaded the Operative System we want to install, we can finally launch our Virtual Machine!
Figure 9. Launching a virtual machine
The machine will ask us immediately to install a new Operative System. Select the folder symbol when prompted:
Figure 10. Selecting a start-up disk
Now, we have to select a virtual disk unit, so to speak. Click on Add. Select the ISO file from the folder you downloaded it. Mine had the name xubuntu-20.04.4-desktop-amd64.iso. Then just click Choose
Figure 11. Selecting an installation disk
And now, the installation process is triggered and will start to load:
Figure 12. Installation is loading
Now, we want to Install the software. Some Linux distributions allow you to try it without installing. It is interesting an interesting feature to show the operative system to new users for the first time and, also has interesting applications to run an operative system from a CD / Bootable USB, for example when you want to recover data in a machine that has a corrupted operative system. But we forget about it now.
In the next page, I decided to install also third-party packages, usually gives better results in the compatibility with the machines, but may be dependent on non-free software.
Figure 13. Install Xubuntu
Figure 14. Select updates and third party packages.
We have to decide how to install the software in our Hard Disk. Remember this is not your hard disk but the virtual one we have created before, so no risk here! I have left is as default this time (Erase the disk and install). The installation process allows you to perform smarter installations too. When Linux was my main OS, I have always taken a different partition to mount /home and create some exchange partitions. But let's keep it simple here.
Figure 15. Type of installation on HDD
After this, the installation will begin:
Figure 16. Xubuntu installation in progress
And after some minutes, our machine is up and running:
Figure 17. Xubuntu running on your virtual machine
Now, shut down the machine while we prepare it a bit to be used. Just click in the blue icon in the top left corner and click on the shutdown button that will appear.
Getting ready our virtual machine to continue
First, I did some configurations on the Virtual Machine itself that can help later. In the Virtual Box window, right click on our new machine and click Settings.
Figure 18. Open the settings of the Virtual Machine
First and important thing we are going to do here is making sure it can connect to the same network we are. Go to Network and make sure Enable Network Adapter is active. Select your Network card.
Figure 19. Network configuration of the VM
As an additional nice feature, I configured it so we can copy/paste from our host machine to the virtual machine. For that go to General then Advanced and select Shared Clipboard - Bidirectional
Figure 20. Enable copypaste between your computer and the virtual machine
Now we can launch again our virtual machine. Once there, we make sure the internet network is connected. Note the network status is on the top right. Select Wired Connection
Figure 21. Connect to the network in the VM
We have internet! You can go to the launch menu (blue icon on the top left) and launch* Web Browser*. Try to navigate to confirm it works.
In order to make sure everything is going to be running smoothly, we will update the current Operative System and install some packages that will be necessary in the future. Launch a Terminal Emulator
In order to manage the software and install packages, i will use apt in the command line. Some other people will perefer apt-get, exchange it in the following commands if you prefer.
Run the following to check for updates and install them:
sudo apt update
sudo apt upgrade
Now it is the time to install some packages we will need to be able to install the software (and to manage software in general).
Run the following command for the C++ compiler:
sudo apt install gpp
Run the following command for the Fortran compiler
sudo apt install gfortran
I have decided to install the latest available python version:
sudo apt install python3.9
We will need numpy (Note: this is an edit added after noticing it was necessary while running Report #2):
sudo apt install numpy
And this package will be important to be useful ensure a smooth installation of the software later:
sudo apt install build-essential
And remember, in the command line, the tab key helps you autocompleting (and ensures what you are doing makes some sense)
If in some moment the installation tells you that some dependencies are required, just launch (and then retry the installation):
sudo apt install -f
We have it! Now, let's give a try to that new particle physics software
Task 2 - Installing MG5aMC
This is where the real job will start for all those geeky GNU/Linux users, and now, we can start installing the required software ourselves.
First thing will be to download the software. As it was provided in the instruction post, it is available in this link:
I would download it directly from your Virtual Machine. Once we have it in our computer, we need to un-compress it. Just move it to the folder when you want to install (
mv originalpath newpath) and run the following command as indicated by @lemouth
tar xf MG5aMC_LTS_2.9.9.tar.gz
Figure 22. Uncompressing the software package
Next step is just executing the software. From the same folder you are, you can just run:
For beginners, the
./at the start will execute the specific file we have indicated.
Figure 23. Inside MG5_aMC
We are inside! (Note your command line now is inside the software we have opened). But we are still going to install some extra useful packages.
Task 3 - Install LHAPDF6
The package is included in the software we have downloaded, and we just need to run:
Figure 24. lhapdf6 installation in progress
This took a while, it recommends you to "tail" a file with a log of the installation so we can see the progress and we observe how it is downloading stuff, and debug if necessary. To do that, I just opened a new tab in the terminal going to File -> New Tab and copy pasted the command in the last line of Figure 24. Oh, nice trick, in Linux you can select something and paste it clicking the center button of your mouse (yes, the wheel in most of the cases).
By the way, in this point, I find interesting that it directly suggests citing a paper if we are using the code. This is nice, because it gives visibility and reputation to the people doing the amazing job required to develop some packages. Similarly, it happens in astronomy / planetary sciences when the paper that announces the releases of some datasets has to be cited in the research done with them.
The successful installation will deliver that message:
Figure 25. Successful installation of LHAPDF6
Task 4 - Install Pythia 8
Similar to what we did before, we now launch the following:
Figure 25. Pythia 8 successfully installed
Task 5 - Starting a MG5_aMC tutorial
Starting a tutorial is as easy as typing
tutorialinside the tool.
Figure 26. MG5_aMC tutorial start
I will run the tutorial myself during the week whenever I have some hours that I feel more fresh, but this looks interesting!
It is exciting, it looks like I have the software installed in my machine. In this first log, we have:
- Installed a VM
- Installed MG5_aMC
- Installed the support packages LHAPDF6 and Pythia 8
I hope this post is useful for some people when trying to install a virtual machine and that more can start participating in such an interesting project. I can see that there are already several entries in #citizenscience so this is getting exciting.