EdmundYuen / RootSetup

A rough guide for setting up Root on Windows machines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Root Setup

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:

  1. The Swan Service: Online data analysis powered by Jupyter.
  2. VirtualBox: Load a provided disk image with Root installed into a Virtual Machine.
  3. LXPLUS Service: You will probably be running your code on this anyway.

Root for Windows

Downloads

Root 5.34.36 (Windows Visual Studio 2013)

Most recent available build of ROOT for Windows.

Visual Studio Express 2013 for Windows Desktop with Update 5 (x86) - Web Installer (English)

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.

Installation

  1. 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.)

  2. Install Root

    (Choose 'Add ROOT to the system PATH for all users.' Default installation directroy = C:\root_v5.34.36)

  3. Test Root by typing the following commands in Command Prompt

    root (will fail if environment variables are not configured)

    .q (exits Root)

  4. 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)

  5. 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)

  6. Benchmark

    C:\root_v5.34.36\test\stress.exe

  7. Modify cmd shortcut to start in your work directory

    Shortcut properties > change the directory listed for 'Start in:'

  8. 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 prompt

    i.e. %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86 && C:\root_v5.34.36\bin\thisroot.bat

WSL (Windows Subsystem for Linux) / Bash on Ubuntu on Windows

  1. Search for "Turn Windows features on or off" and enable the Windows Subsystem for Linux option (Restart required)

  2. Search for "Use developer features" and choose Developer mode

  3. Search for "bash" and press enter/run bash from cmd prompt. Installation will begin.

  4. Refer to https://root.cern/build-prerequisites under Ubuntu 10, 12 , 14 and 16 and install useful packages

ROOT for WSL

  1. 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

  2. Instructions for building root are here (https://root.cern/building-root). For the binary, simply unpack in desired directory/home (eg. tar -xf filename)

  3. Append the following lines to .bashrc (~/.bashrc) source [path]/thisroot.sh and export 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 then which thisroot.sh to determine the right path

    Alternative: nano ~/.bashrc to manually edit the file to include the required two lines above

  4. 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 bash exit. The hosts file will be automatically updated.

  5. Restart bash, type root and analyse away

  6. 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.

GUI for LXPLUS through PuTTY with XWin-32

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.

GUI for WSL with X-win32

Set up XWin-32 as in the previous section and be sure to set the DISPLAY (see Step 3 of ROOT for WSL)

GUI for LXPLUS/WSL with VNC

TODO in future if there's luxury of time.

Utility Programs

Bitvise for file transfer: https://www.bitvise.com/ssh-client-download > Server host: lxplus.cern.ch

MISC

VNC Tutorial

Reddit wiki

More wiki

GUI tutorial

About

A rough guide for setting up Root on Windows machines