A rough guide for setting up Root on Windows machines (work in progress)
Before you begin, do consider if the following alternatives are adequate for your needs:
- The Swan Service: Online data analysis powered by Jupyter.
- VirtualBox: Load a provided disk image with Root installed into a Virtual Machine.
- LXPLUS Service: You will probably be running your code on this anyway.
Release 5.34/36 - 2016-04-05 (Direct link: root_v5.34.36.win32.vc12.exe)
Most recent available build of ROOT for Windows.
A Visual Studio Dev Essentials subscription is now required to access the above download. See here for more information.
Required to compile C++. Express version does not include the full set of developer tools for Visual Studio, but is sufficient for compiler functionality. Web installer.
-
Install Visual Studio
(Launch after installation to check that the installation is working. Skip sign in. Initial launch might lag/Sign-in window is hidden.)
-
Install Root
(Choose 'Add ROOT to the system PATH for all users.' Default installation directroy =
C:\root_v5.34.36
) -
Test Root by typing the following commands in Command Prompt
root
(will fail if environment variables are not configured).q
(exits Root) -
For command line C++ compiler functionality, make a copy of the following shortcut and launch cmd.exe using it (auto runs vcvarsall.bat that sets up Visual Studio environment variables)
VS2013 x86 Native Tools Command Prompt (look in
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts
) -
Test compiler by building the provided Root tests
cd C:\root_v5.34.36\test
nmake /f makefile.win32
(will fail saying w32pragma.h cannot be found if environment variables are not configured) -
Benchmark
C:\root_v5.34.36\test\stress.exe
-
Modify cmd shortcut to start in your work directory
Shortcut properties > change the directory listed for 'Start in:'
-
Modify cmd shortcut to setup Root environmental variables
append the following
&& C:\root_v5.34.36\bin\thisroot.bat
to the target to run thisroot.bat on startup of cmd prompti.e.
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86 && C:\root_v5.34.36\bin\thisroot.bat
-
Search for "Turn Windows features on or off" and enable the Windows Subsystem for Linux option (Restart required)
-
Search for "Use developer features" and choose Developer mode
-
Search for "bash" and press enter/run bash from cmd prompt. Installation will begin.
-
Refer to https://root.cern/build-prerequisites under Ubuntu 10, 12 , 14 and 16 and install useful packages
-
Choose either to build from source or download the binary (Ubuntu 14 gcc4.8 root_v5.34.36.Linux-ubuntu14-x86_64-gcc4.8.tar.gz)
To download binary in bash:
wget https://root.cern.ch/download/root_v5.34.36.Linux-ubuntu14-x86_64-gcc4.8.tar.gz
-
Instructions for building root are here (https://root.cern/building-root). For the binary, simply unpack in desired directory/home (eg.
tar -xf filename
) -
Append the following lines to .bashrc (~/.bashrc)
source [path]/thisroot.sh
andexport DISPLAY=:0
Bash input:
echo 'source [path]/thisroot.sh' >> ~/.bashrc` echo 'export DISPLAY=:0' >> ~/.bashrc
Tip: navigate to the dir containing thisroot.sh and run
thisroot.sh
thenwhich thisroot.sh
to determine the right pathAlternative:
nano ~/.bashrc
to manually edit the file to include the required two lines above -
The machine name needs to be added to /etc/hosts (to fix "unable to resolve localhost").
The simplest way is to delete the hosts file
rm /etc/hosts
and restart bashexit
. The hosts file will be automatically updated. -
Restart bash, type
root
and analyse away -
Note: The latest version of Bash on Ubuntu on Windows runs on Ubuntu 16 with gcc g++ 5. Downgrade gcc g++ to 4.8 to maintain compatibility with 5.34/36. It is unclear if there's a need to use Ubuntu 14 to maintain compatibility. Alternatively, install a more recent release of Root compatible with Ubuntu 16 and gcc g++ 5.
XWin-32 X11 Server for Windows
Be sure to enable X-11 forwarding in PuTTY and follow the installation instructions in the page above carefully.
Set up XWin-32 as in the previous section and be sure to set the DISPLAY (see Step 3 of ROOT for WSL)
TODO in future if there's luxury of time.
Bitvise for file transfer: https://www.bitvise.com/ssh-client-download > Server host: lxplus.cern.ch