deeplink to this page         student projects         teaching

Utrecht University

Student project: doing a research project on a Windows computer

Many thanks to S. Burger and O. Abdelkarim for their feedback on how to use Windows.

Why Windows presents an issue

Windows is a commercial software package developed, but not supported, by Microsoft. It's aim is to enrich its shareholders. If you are a simple computer user rather than a millionaire, you are not in the target group. Simple tasks that take seconds on other computers, like installing a compiler and compiling a program, are not supported by Microsoft. That is unfortunate, as these simple actions are at the core of our research projects and you can spend more time on the physics and get a better result if your do not have to solve bugs in Microsoft software. Even though you paid for it, it appears that Microsoft will not send someone over to help you with this. Their strategy seems to be: first you pay, then you do the work yourself. Do not worry, all this is included in the price you paid, and the shareholders are getting very rich from your money indeed.

If you only have a Windows computer you have several workarounds (there are no proper solutions if you don't want to remove Windows or use a dual boot). You can try to install Windows subsystem for Linux (WSL)1 and learn how to use it. Alternatively, you can try Cygwin to get a Linux-like environment on your Windows machine. Or perhaps Chocolatey to install the packages wget make cmake gcc/gfortran.

Other students with Windows computers have done research projects before you. They have been kind enough to write down some of their findings over the years. You can find them below. From there, you are on your own though.2

WSL install guide

This is a brief instruction to install WSL on Windows. Note that what Microsoft calls WSL is what had previously been known for decades as a Virtual Machine (but according to some, it being a Microsoft VM, it is slower than other VMs). This means that you will be running Linux on top of Windows. Windows limitations still apply (as opposed to running a dual boot). Other restrictions is that you will not be able to access your files in Windows from WSL and vice versa.3

Check Windows version

  • You must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11
  • To check this, go to settings>system>info and check the version under Windows specifications.

PowerShell

  1. Open PowerShell in administrator mode (type in searchbar, right-click and select "run as administrator")
  2. If you do not run PowerShell in administrator mode you will not be able to continue
  3. In PowerShell, run the wsl --install command. If you receive an error, try again or restart PowerShell.
  4. This command will install WSL 2 and the Ubuntu distribution of Linux.
  5. Check https://learn.microsoft.com/en-us/windows/wsl/install on how to install different Linux distributions.
  6. Restart your computer when PowerShell tells you to do so.
  7. Upon restart PowerShell should automatically install the Linux distribution.
  8. You will be prompted to create a new user account. Type in a username and password.
  9. You are now ready to use Linux and install useful applications.

Building and installing software packages

It is possibly that Chocolatey can do this for you, but it is known to support a very small number of packages compared to other package managers. This means you may have to build your software package manually, which is quite straightforward on most operating systems, but unfortunately not on Windows. The general idea (on Cygwin? WSL?) is the following:
  1. Unpack, configure, compile your software
  2. Install your manually built package in /usr/local/.../
  3. Fix the names of the shared and static libraries using symbolic links:
                      ln -s libname.so cygname.dll    # Shared/dynamic - note *cyg*
                      ln -s libname.a  libname.dll.a  # Static         - keep *lib*
                    
    1. Note: in some (or all?) cases, -lname does not work if libSUFR.a and/or libSUFR.dll.a also exist. In that case (or all cases?) do not install the static libraries (and remove the symlink created above).

Python usage guide for WSL

This guide assumes that you are using Ubuntu Linux under WSL and lists shell (bash) commands.

Install Python and pip

  1. Check what version of Python is installed:
                      python --version
                      python3 --version
                    
  2. If Python 3 has not yet been installed, install it:
                      sudo apt install python3
                    
  3. Next, install the pip package installer:
                      sudo apt install python3-pip
                    
  4. To automatically make the python command point to python3:
                      sudo apt install python-is-python3
                    
    • if you do not install this package, you must replace python with python3 below. Note that in that case, some scripts may not work!

Create a Python environment

  1. First, install the required packages:
                      apt list --installed python3-venv  # check if package has already been installed
                      sudo apt install python3-venv
                    
  2. Go to the directory you want to run the Python scripts from and create a Python environment:
                      mkdir -p ˜/projects/CBs/  # create a directory (folder) in your home directory (˜)
                      cd ˜/projects/CBs/     # cd (go) into that directory
                      python -m venv CBs-env  # create the environment
                    
    • here, CBs and CBs-env are the name of the directory and environment (for the compact-binaries project); this can be changed to whatever you like
  3. Check whether the environment has been created correctly:
                      ls -la CBs-env  # list (ls) the contents (files and subdirectories) of the directory CBs-env/
                    
    • you should see something like:
                            drwxr-xr-x 2 user user 4096 Dec 13 10:40 bin
                            drwxr-xr-x 3 user user 4096 Dec 13 10:40 include
                            drwxr-xr-x 3 user user 4096 Dec 13 10:40 lib
                            lrwxrwxrwx 1 user user    3 Dec 13 10:40 lib64 -> lib
                            -rw-r--r-- 1 user user  153 Dec 13 10:40 pyvenv.cfg
                          

Use your Python environment

  1. To activate an environment, cd to the directory where you created the environment and run:
                      source CBs-env/bin/activate
                    
    • you should now see the name of the active Python environment to the left of your command line (prompt)
  2. To deactivate the current environment, simply use:
                      deactivate
                    
  3. To list all the packages installed in your environment (while it is active):
                      python -m pip list
                    
  4. To (un)install a package:
                      python -m pip install package-name
                    
    • only do this when environment is activated!
    • replace install with uninstall to remove a package

Create and run Python scripts

  1. To create a new Python file:
                      nano newpythonfile.py  # use the text editor of your choice
                    
  2. To make the script directly executable, add #!/bin/env python to the first line of your Python script, then run:
                      chmod +x newpythonfile.py
                    
    • when running ls -l, your Python script should change from white to green and show an x in the first columns if successful
  3. You can now run your script by using:
                      ./newpythonfile.py
                    

Helpful web pages

Compiling and running a computer program

t.b.a.

Other reasons not to use Microsoft (or Apple, Google, ...)

  • Commercial software aims at as much money for their shareholders per unit of quality as possible, in other words, as little quality per euro as possible. The user, stability, quality and security are not primary concerns. This is in stark contrast to open-source software, which is usually developed by the users themselves. These people want to use this software themselves, and usually want good quality. In addition, thousands or millions of other users can help in the discovery of bugs or vulnerabilities, further contributing to the software's quality, stability and security.
  • Microsoft software is not very compatible with anything. This makes sense; if I make something new, I cannot look into their source code to see how to make it compatible with my tool or how to make their software compatible with my system. If I want to collaborate with other people, this a severe drawback, comparable to a highway that only supports Volkswagens. While they are probably fine cars, I would like to have the freedom to choose my own brand of car. That freedom is not in the interest of Microsoft's shareholders, and therefore you do not get it...
  • According to the US CLOUD Act, US-American companies must share client information with their government. It is safe to assume that anything you do on your Windows computer (Mac, Android phone) can be screened by US immigration, including your opinions, if you have any. It is good to realise that this is the government that locks up innocent people in Quantanomo Bay for twenty years.
  • Microoft blocks the International Criminal Court to thwart international justice in 2025
  • Russia hacks Dutch police using Microsoft safety issue in 2024
  • Hackers abusing gap in Microsoft servers
  • US government hacked through use of Microsoft software
  • and much, much more...



Back to student projects.




1 WSL is Microsoft's attempt to mimic a real computer. However, it turns out that it is simply a virtual machine, running Linux on top of Windows, keeping the disadvantages of Windows. All these "solutions" are trying to suppress the symptoms rather than fighting the disease — a bit like deciding to make the best of things by roasting marshmallows because you've decided to move into a burning house. The real solution is of course to get a better house (preferably one that isn't on fire). Note that using a Windows machine doubles your challenge: not only do you have to solve a physics problem, but you also need to repair Microsoft's malware. However, you paid heavily for Windows, so sending someone over if you run into trouble ought to be part of the service. When they arrive, ask them to install Linux for you!

2 Unfortunately, there is no way for me to download Windows and test these things...

3 I am not sure whether not being able to access your files is a bug that Microsoft has not been able to fix in the last few decades, or a "feature" of Windows. Other operating systems have no issues with this though...