Running ATLAS software on Windows 10
Here are some instructions to get the ATLAS software running on Windows 10, using the Linux subsystem. This is all very experimental, I'm writing it up as I'm doing it. Any contributions or corrections are very welcome.
Install Windows Subsystem for Linux (WSL), following the instructions here:
https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
. You'll need at least the "Anniversary Update" of Windows 10.
We'll be doing something unsupported and installing
CentOS 7 in WSL, since it runs the ATLAS software better than the preinstalled Ubuntu. For this, we'll use a tool called "WSL Distribution Switcher". I could not get
CentOS 6 to run, which would be closer to SLC 6 currently in use. However, a lot of the software stack is already
CentOS 7 ready.
I will use `>` to symbolize a Windows cmd.exe prompt, `$` for a bash prompt, and `#` for a bash root prompt.
You'll also need:
Open a command window (`cmd`)
> mkdir src
> cd src
> git clone https://github.com/RoliSoft/WSL-Distribution-Switcher.git
> cd WSL-Distribution-Switcher
> python get-source.py centos:7
(python might be in %USERPROFILE%\AppData\Local\Programs\Python\Python35\python)
Switch user to root to circumvent a problem with
CentOS 's useradd
> lxrun /setdefaultuser root
> python install.py centos:7
(You can switch back to ubuntu by using `python switch.py ubuntu:trusty`)
Now start
CentOS as root
> bash ~
We need a few packages. HEP_OSlibs pulls in some basic HEP dependencies
# yum install gcc vim svn wget
# wget http://linuxsoft.cern.ch/wlcg/centos7/x86_64/HEP_OSlibs-7.1.5-0.el7.cern.x86_64.rpm
# yum install HEP_OSlibs-7.1.5-0.el7.cern.x86_64.rpm
Create regular user
# useradd jason
(I could not get `sudo` to work, it fails with "sudo: unable to create sockets: Socket type not supported". Strangely Ubuntu's sudo works fine. If WSL gets an update such that sudo works, you can enable it for your user with `usermod -aG wheel jason`)
Set a root password so that you can use `su` to get root.
# passwd
# # or: `passwd jason` to set the user password (for sudo)
# <Ctrl+D>
Now you should be finished with root, time to log in as your user. Tell windows what the username is and log in.
> lxrun /setdefaultuser jason
> bash.exe ~
There are still some pieces of Linux that are unimplemented in WSL, so svn doesn't work. We need to create a workaround. Save this as `getrusage.c`:
#define _GNU_SOURCE
#include <dlfcn.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <string.h>
typedef int (* getrusage_func)(int who, struct rusage *usage);
int getrusage(int who, struct rusage *usage) {
if (who == RUSAGE_THREAD) {
memset(usage, 0, sizeof(struct rusage));
return 0;
}
getrusage_func orig_getrusage;
orig_getrusage = (getrusage_func) dlsym(RTLD_NEXT, "getrusage");
return orig_getrusage(who, usage);
}
$ gcc -shared -fPIC -o getrusage.so getrusage.c
Put this into ~/.bashrc, then close bash and open it again (`bash ~`). (Actually it would belong in ~/.profile, but if you call bash from the start menu, it is not called as a login shell (bash.exe -l), and ~/.profile doesn't get sourced.)
export LD_PRELOAD=$HOME/getrusage.so
export ATLAS_LOCAL_ROOT_BASE=$HOME/alrb/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
We'll now get the ATLAS packages via
https://twiki.atlas-canada.ca/bin/view/AtlasCanada/ManageTier3SW
:
$ cd ~
$ svn co http://svn.cern.ch/guest/atcansupport/manageTier3SW/trunk userSupport/manageTier3SW
$ cd ~/userSupport/manageTier3SW
This will install a lot of stuff, I cancelled it after a while because I got impatient and it wrote more than 16 GB:
$ ./updateManageTier3SW.sh --installALRB=$HOME/alrb
I then edited ~/userSupport/cfgManageTier3SW/default/defaultConfigs.pl and commented a bunch out (not `@keepVersions`, but rather further down where it adds to e.g. `@rootList`).
or you can call
$ $ATLAS_LOCAL_ROOT_BASE/utilities/createConfigurationFiles.sh
edit
$ $ATLAS_LOCAL_ROOT_BASE/config/ALRB-other-current.lis
prefix stuff you want to uninstall and keep uninstalled with `-`. Then run
$ $ATLAS_LOCAL_ROOT_BASE/utilities/parseConfigFiles.sh
$ $ATLAS_LOCAL_ROOT_BASE/utilities/parseConfigFiles.sh --doRun
Finally call
$ ./updateManageTier3SW.sh --installOnly=root,gcc,AtlasSetup,cmt,gsl,fftw,davix
(for root, you seem to need at least root,gcc,gsl,fftw,davix)
Then you should be good to go. To check if everything worked, start the X server and try (in a separate shell):
$ setupATLAS
$ lsetup root
$ DISPLAY=:0 root
Expected result:
Known errors:
Error: /proc must be mounted
To mount /proc at boot you need an /etc/fstab line like:
proc /proc proc defaults
In the meantime, run "mount proc /proc -t proc"
This comes from `ps`, which is called by various scripts. The version shipping with
CentOS 7 uses some unimplemented features (ticket:
https://github.com/Microsoft/BashOnWindows/issues/540
). It seems to work anyway.