I’m having trouble with the configuration step on WSL. Please find below details from the generated configure.log file. Thanks for your help.
Vinny
MRtrix build type requested: release
Detecting OS: linux
Looking for compiler [clang++]: not found
Looking for compiler [g++]: g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Checking for C++11 compliance: ok
Checking for ::max_align_t: ok
Checking for std::max_align_t: not found
Detecting pointer size: 64 bit
Detecting byte order: little-endian
Checking for variable-length array support: yes
Checking for non-POD variable-length array support: yes
Checking for zlib compression library: 1.2.8
Checking for TIFF library: not found - TIFF support disabled
Checking for Eigen 3 library: 3.2.0
Checking JSON for Modern C++ requirements:
ERROR: error compiling JSON test application!
MRtrix3 was unable to compile a test program involving JSON for Modern C++. Your compiler may not be sufficiently up-to-date.
See the file 'configure.log' for details. If this doesn't help and you need
further assistance, please post on the MRtrix3 community forum
(http://community.mrtrix.org/), and make sure to include the full contents of
the 'configure.log' file.
The compiler version (g++ 4.8.4) is inadequate. Although this version claims to be C++11 compatible, and a basic test program may compile, it is not fully C++11 compliant, and many features will not compile or will not run properly. The contents of the file configure.log should provide more information about this.
Note also that if compiling within WSL, you will not be able to use the GUI commands, so will need to request a command-line only configuration using the -nogui option. We recommend instead installing using MSYS2 on Windows systems for this reason.
Mrtrix3 is a required as part of the ANTsR installation. So, I’m guessing that MSYS2 would not be used with ANTsR in general? How would I request a command-line only configuration using the -nogui option?
Mrtrix3 is a required as part of the ANTsR installation. So, I’m guessing that MSYS2 would not be used with ANTsR in general?
I haven’t touched WSL (or Windows 10), so I don’t know whether or not binaries / paths can be shared across subsystems. But given the dependencies you list, I’m guessing that ANTsR would not be possible to install within MSYS2.
How would I request a command-line only configuration using the -nogui option?
By using the -nogui option when you run the configure script. Simple as that
All it does is disable the Qt tests during the configuration, and instruct the build script to not attempt to compile any GUI-related components of MRtrix3, including the commands mrview and shview.
The -nogui option will only solve the inevitable issues that you would encounter if trying to compile GUI commands within WSL. However this does not do anything to solve the fundamental issue regarding the out-of-date version of GCC.
As you can see in file configure.log, the final error provides this:
#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
The link provided by the error message describes that GCC 4.8 is unsupported due to bugs in C++11 support, as I mentioned previously. Therefore the only way you will be able to install MRtrix3 is by updating the compiler. If doing a “normal” system update within WSL does not achieve this, you may need to explicitly search for a package that will install “GCC version 5” (I believe I encountered this in the past on Ubuntu, so WSL may be the same).
The configuration (including GUI) and binaries building proceeded without incident followed by setting the path. However, when I typed ‘mrview’ I got the following error message:
X Error: BadRequest (invalid request code or no such operation) 1
Extension: 143 (Uknown extension)
Minor opcode: 34 (Unknown request)
Resource id: 0x800037
mrview: [WARNING] unable to determine OpenGL version - operation may be unstable if actual version is less than 3.3
mrview: [ERROR] GLSL log [vertex shader]: 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, and 1.00 ES
mrview: [ERROR] error compiling OpenGL vertex shader ID 1
QWidget: Must construct a QApplication before a QPaintDevice
Aborted (core dumped)
There’s a bunch of issues with running on the WSL that you’ve hit on in this thread…
Some of them actually relate to the specific version of Ubuntu that you have running, and so most of the warnings on the Linux install page are relevant, in particular issues with using too old a compiler, as mentioned by @rsmith. This might actually be fixed simply by using a later version such as 16.04.
The other issue is that as far as I know, WSL comes without an X server, so the GUI components can’t run. You’ll have no trouble building them as long as the compile-time dependencies are installed, but it’ll fail to detect a suitable graphics environment at runtime, and give an error message such as cannot connect to X server (as per this post).
In your case, I expect you’ve installed a separate X server, as mentioned in other posts?
If so, then you’ve hit the exact same problem as they did:
No problem running the command-line tools though, and as @rsmith suggested, you should be able to run the two installs side-by-side, so you can use the MSYS2 version of MRView when needed. Not ideal, but that’s probably the best we can do at the moment if you absolutely need to use the WSL…
Just as a side note: there is a chance that GUI support might eventually make it to the Windows Subsystem for Linux if they implement support for Wayland (X11 is being phased out in general), as per this issue. mrview runs just fine on Wayland thanks to Qt5 supporting it out of the box. Watch this space…
Thank you very much for the clarification! I had done a config -nogui and everything went fine on WSL, so all the image processing would be done in the bash environment. So for MSYS2, I’ll have to install and build this separately on my Windows 10 platform. Do I have to transfer the outputs from bash to Windows in order to view with mrview? I’m not sure how to use these side-by-side.
I’ll take a look at that link. Also, I came across this post by someone… MRtrix, FSL, ANTS, ... on the Windows subsystem for Linux. Suggests to have both terminals (Ubuntu and MinGW) opened in the same path/folder. I’ll give this a try and see if it works. Thanks again for all your help!
This should indeed work. I’ve briefly tested/used it successfully myself before. Both environments have their own system folder structure somewhere as a bunch of folders in windows’ filesystem, but they can go to any path… so simply choose an easy/short location for your data, and you can easily do side-by-side processing and viewing. You can even leave the viewer opened, and open image files or other results from there. Purely for the processing side of things, I can happily recommend the WSL over MSYS2. Much more robust to install all dependencies (and e.g. FSL, ANTS, …). Now if they only get to implementing that Wayland support…
WSL can run GUIs. You just need to have an x server (I’ve used both Xming and mobaxterm) running and to set your DISPLAY variable. You can also install Debian or other distros if you’d prefer them over Ubuntu. “mrview” works fine.
Wow, that’s great news! I’ll give that a try later. I knew it was possible to run X11 apps on WSL with a separate X server, but I didn’t think they’d support OpenGL 3.3 – this would be awesome, and we likely change our recommended install instructions if that holds up. Thanks for the tip!
I’m just getting started with mrtrix, so I may have spoken too soon. I only tried running mrview with some simple images, and that works fine. Would that even need opengl? Maybe I just haven’t tried the thing that doesn’t work.
OK, tried WSL with Ubuntu 18.04, mobaxterm does work, but with software rendering only – hardware rendering is limited to OpenGL 3.0. I tried XMing briefly, that failed straight away, but I’m using the free version, which is probably quite outdated. I’d need to pay to install the latest version, but I’d rather know that it works before I do that… Can you confirm that you get mrview to display with Xming? And if so, which version exactly?
I’ll try later when I’m not in the middle of other work, but I suspect I’ll get the same result as you. I was speaking of guis generally when I said they worked with xming (I thought you were saying that wsl didn’t support guis at all). I only tried mrview with mobaxterm.
OK, I’ve gone and donated to the XMing project to get access to their latest version. It works if using software rendering (the default), but fails when forcing hardware rendering (the highest version officially supported is 1.4, for the same reason as for regular X11 forwarding: that’s the highest that the GLX supports).
So it looks like the simplest approach for display within WSL is mobaxterm (it’s free and works well), but with the limitations that it’s software-only, so performance won’t be as good as it could be with proper hardware acceleration (which you do get with our ‘official’ MSYS2 instructions). But that does mean that WSL can be used, making it much easier to inter-operate with FSL and ANTs, amongst others. I think that’s a very appealing solution for that reason alone, even if display performance is suboptimal…
[EDIT] note that for this to work, you need to compile against Qt4 - for some reason Qt5 doesn’t seem to detect the correct version of OpenGL…
For reference, this is what (I think) I did on a fresh Ubuntu 18.04 Windows Subsystem for Linux install: