Difference between revisions of "HOWTO Run Gluex Software on Windows"

From GlueXWiki
Jump to: navigation, search
(Installation)
 
(20 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
'''Gluex software runs on windows 10 out of the box'''*
 
'''Gluex software runs on windows 10 out of the box'''*
 
[[File:Bash_on_windows_chan_what.jpeg]]
 
 
'''Is it 1 April joke?''' - No. It is April 2nd and it is not a joke.
 
 
  
 
'''How?''' - Windows now comes with a new feature which is known by several names (common for all devilish): "Windows subsystem for linux"('''WSL''') or "Bash on Windows" or "Bash on Ubuntu on Windows" or even "lxrun".  
 
'''How?''' - Windows now comes with a new feature which is known by several names (common for all devilish): "Windows subsystem for linux"('''WSL''') or "Bash on Windows" or "Bash on Ubuntu on Windows" or even "lxrun".  
  
  
WSL provides a Linux-compatible kernel interface developed by Microsoft (containing no Linux kernel code), with user-mode binaries from Ubuntu running on top of it.  
+
WSL provides a Linux-compatible kernel interface (containing no Linux kernel code), with user-mode binaries from Ubuntu running on top of it.  
  
  
Roughly saying it is Ubuntu running on Windows kernel inside Windows.  
+
Roughly saying ''it is Ubuntu running on Windows kernel inside Windows.''
  
  
Line 24: Line 19:
  
 
[https://msdn.microsoft.com/en-us/commandline/wsl/about MSDN page]
 
[https://msdn.microsoft.com/en-us/commandline/wsl/about MSDN page]
 
 
'''Out of the box''' - WSL now comes with ALL versions of Windows 10. It is just one command to install and activate it.
 
  
  
Line 33: Line 25:
 
* '''Compared to VMs''' - WSL is a thin layer, which addresses linux system calls to NT kernel. Potentially performance is not wasted by virtualization, no problems like space on virtual disks. WSL has full access to windows file system and resources. Actually, it IS Windows running Ubuntu rig.  
 
* '''Compared to VMs''' - WSL is a thin layer, which addresses linux system calls to NT kernel. Potentially performance is not wasted by virtualization, no problems like space on virtual disks. WSL has full access to windows file system and resources. Actually, it IS Windows running Ubuntu rig.  
  
* '''Compared to Cygwin''' - Cygwin works in similar way but there is a huge difference. Software is built for cygwin. WSL is '''intended to be binary compatible with Ubuntu'''. And other-compatible too. So one can grab .deb package and use it. Or ctrl+c ctrl+v command from askubuntu.com and it will just work. Because of this gluex software runs on WSL out of the box.  
+
* '''Compared to Cygwin''' - Cygwin works in similar way but there is a huge difference. Software must be built/rebuilt for cygwin using cygwin environment. WSL is '''intended to be binary compatible with Ubuntu'''. And other-compatible too. So one can grab .deb package and use it. Or ctrl+c ctrl+v from askubuntu.com and it will just work. Because of this gluex software runs out of the box on WSL but it is often a pain to build a big codebase on cygwin.
  
 +
* '''Out of the box''' - WSL now comes with ALL versions of Windows 10. It is just one command to install and activate it.
  
  
'''Windows 15063.11''' - known as "Creators update". Officially release is planned on '''April 11 of 2017''' but RC available now. Starting with this version WSL comes with Ubuntu 16.04 (was 14.04 before). Historically, when WSL appeared in 2016 as an alfa feature, it had a number of bugs like no stubs for DBUS, etc. Now even if it is still a beta, many things where significantly improved and works smoothly (like running X11 apps).  
+
<nowiki />* - '''Windows 15063.11''' - known as "Creators update". Official release was '''April 11, 2017'''. Historically, when WSL appeared in 2015 as an alfa feature, it had a number of bugs. In "Creators update" it is beta, many things where significantly improved and work smoothly (like running X11 apps). Starting with "Creators update" WSL comes with Ubuntu 16.04 (was 14.04 before).
 
+
GlueX offline software was (roughly) tested on 15063.11. It most probably should work on older versions too, but it is recomended to use Windows version 15063+.  
+
 
+
  
 +
GlueX offline software was (roughly) tested on Windows 15063.11 "Creators update". It most probably should work on older versions too, but is not recommended because of the above reasons.
  
 
=Installation=
 
=Installation=
Line 47: Line 38:
 
WSL installation:
 
WSL installation:
  
* One has to enable "Developer mode" (type it in the search bar, and click that switch)
+
* One has to enable "Developer mode" (type it in the search bar, and click that switch),
 +
 
 +
* "Turn windows features on or off" and enable "Windows subsystem for linux" there
  
 
* Open terminal and write ''lxrun /install''. After several questions installation is complete.
 
* Open terminal and write ''lxrun /install''. After several questions installation is complete.
Line 53: Line 46:
 
* To run it just print ''bash'' in terminal
 
* To run it just print ''bash'' in terminal
  
 +
[https://msdn.microsoft.com/en-us/commandline/wsl/reference MSDN manual]
  
Because native windows terminal is a shame, it is a good idea to use something like xfce-terminal. To do this:
 
  
* install [https://sourceforge.net/projects/xming/ XMing X11 server]. (don't use VcXsrv, it has problems with OpenGL)
 
  
* put  ''export DISPLAY=:0'' in .bashrc
+
Because the native Windows terminal (cmd.exe) is a shame, there are several options:
  
* install xfce4-terminal (''sudo apt-get install xfce4-terminal'')
+
* MobaXTerm (which has a free version) is highly customasible multi tab terminal with support of X11 outof the box.
  
* run it: ''bash -l -c xfce4-terminal''
+
* [https://github.com/goreliu/wsl-terminal WSL-terminal] - includes mintty, wslbridge, cbwin, and some other useful tools
  
[http://askubuntu.com/questions/827952/a-better-terminal-experience-for-windows-subsystem-for-linux Stackoverlow question with more details]
+
* Finally you can install xfce4-terminal in WSL(''sudo apt-get install xfce4-terminal'') [http://askubuntu.com/questions/827952/a-better-terminal-experience-for-windows-subsystem-for-linux Stackoverlow question with more details]
  
  
'''Gluex prerequesties'''
+
X11:
 +
 
 +
* install [https://sourceforge.net/projects/xming/ XMing X11 server]. Don't use VcXsrv, it has problems with OpenGL. Skip this step for MobaXTerm it ships X11 support.
 +
 
 +
* put  ''export DISPLAY=:0'' in .bashrc
 +
 
 +
 
 +
 
 +
'''Gluex prerequisites'''
  
 
This Ubuntu version comes without compilers. Before installing hdpm prerequisites one has to also install build-essential
 
This Ubuntu version comes without compilers. Before installing hdpm prerequisites one has to also install build-essential
  
 
     > sudo apt install build-essential
 
     > sudo apt install build-essential
 
  
  
 
'''Gluex software'''
 
'''Gluex software'''
  
Just [https://github.com/JeffersonLab/hdpm/wiki/Usage use hdpm as usual] including installation of prerequesties printed by hdpm.  
+
Just [https://github.com/JeffersonLab/hdpm/wiki/Usage use hdpm as usual] including installation of prerequisites printed by hdpm.
 +
 
 +
 
 +
'''Other distributions'''
  
 +
It is possible to install other linux distributions, including Fedora and CentOS 7. But it requires more effort, see [https://github.com/RoliSoft/WSL-Distribution-Switcher WSL Distribution Switcher]
  
 
=Run GlueX software=
 
=Run GlueX software=
Line 88: Line 91:
 
* '''ROOT''' - root works. All features that where tested (like root files, DSelector) run without problems
 
* '''ROOT''' - root works. All features that where tested (like root files, DSelector) run without problems
  
* '''OpenGL''' - Surprisingly, GlueX geometry works even with OpenGL (does it rendered with DirectX under the hood???)   
+
* '''OpenGL''' - Surprisingly, GlueX geometry converted to ROOT was even rendered with OpenGL and run fast (was it rendered with DirectX under the hood???)   
 
     [[File:Bash_on_windows_geometry_opengl.png]]
 
     [[File:Bash_on_windows_geometry_opengl.png]]
  

Latest revision as of 13:47, 24 April 2017

Introduction

Gluex software runs on windows 10 out of the box*

How? - Windows now comes with a new feature which is known by several names (common for all devilish): "Windows subsystem for linux"(WSL) or "Bash on Windows" or "Bash on Ubuntu on Windows" or even "lxrun".


WSL provides a Linux-compatible kernel interface (containing no Linux kernel code), with user-mode binaries from Ubuntu running on top of it.


Roughly saying it is Ubuntu running on Windows kernel inside Windows.


Links:

Wikipedia article

GitHub page

MSDN page


WSL vs. Virtual machines vs. Cygwin

  • Compared to VMs - WSL is a thin layer, which addresses linux system calls to NT kernel. Potentially performance is not wasted by virtualization, no problems like space on virtual disks. WSL has full access to windows file system and resources. Actually, it IS Windows running Ubuntu rig.
  • Compared to Cygwin - Cygwin works in similar way but there is a huge difference. Software must be built/rebuilt for cygwin using cygwin environment. WSL is intended to be binary compatible with Ubuntu. And other-compatible too. So one can grab .deb package and use it. Or ctrl+c ctrl+v from askubuntu.com and it will just work. Because of this gluex software runs out of the box on WSL but it is often a pain to build a big codebase on cygwin.
  • Out of the box - WSL now comes with ALL versions of Windows 10. It is just one command to install and activate it.


* - Windows 15063.11 - known as "Creators update". Official release was April 11, 2017. Historically, when WSL appeared in 2015 as an alfa feature, it had a number of bugs. In "Creators update" it is beta, many things where significantly improved and work smoothly (like running X11 apps). Starting with "Creators update" WSL comes with Ubuntu 16.04 (was 14.04 before).

GlueX offline software was (roughly) tested on Windows 15063.11 "Creators update". It most probably should work on older versions too, but is not recommended because of the above reasons.

Installation

WSL installation:

  • One has to enable "Developer mode" (type it in the search bar, and click that switch),
  • "Turn windows features on or off" and enable "Windows subsystem for linux" there
  • Open terminal and write lxrun /install. After several questions installation is complete.
  • To run it just print bash in terminal

MSDN manual


Because the native Windows terminal (cmd.exe) is a shame, there are several options:

  • MobaXTerm (which has a free version) is highly customasible multi tab terminal with support of X11 outof the box.
  • WSL-terminal - includes mintty, wslbridge, cbwin, and some other useful tools


X11:

  • install XMing X11 server. Don't use VcXsrv, it has problems with OpenGL. Skip this step for MobaXTerm it ships X11 support.
  • put export DISPLAY=:0 in .bashrc


Gluex prerequisites

This Ubuntu version comes without compilers. Before installing hdpm prerequisites one has to also install build-essential

   > sudo apt install build-essential


Gluex software

Just use hdpm as usual including installation of prerequisites printed by hdpm.


Other distributions

It is possible to install other linux distributions, including Fedora and CentOS 7. But it requires more effort, see WSL Distribution Switcher

Run GlueX software

Features that where verified to work:

  • JANA and co - HDGeant runs OK. For a sake of experiment, resulting hddm file was moved to some external Windows NTFS disk. Jana was able to process it.
  • ROOT - root works. All features that where tested (like root files, DSelector) run without problems
  • OpenGL - Surprisingly, GlueX geometry converted to ROOT was even rendered with OpenGL and run fast (was it rendered with DirectX under the hood???)
   Bash on windows geometry opengl.png
  • Geant 4 - Has not been tested yet.


TL; DR; It was tested that our software runs on WSL, which is Ubuntu with windows kernel running on windows.