Mrtrix3 configuration problem on Windows Subsystem for Linux (WSL)


#1

Hi,

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.


#2

Hi Vinny,

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.

Cheers
Rob


#3

Hi Rob,

I am installing ANTsR, which requires a number of Linux-dependent packages such as FSL and FreeSurfer,. Since I have a Windows 10 OS, I’m using WSL to get ANTsR… https://github.com/stnava/ANTsR/wiki/Installing-ANTsR-in-Windows-10-(along-with-FSL,-Rstudio,-Freesurfer,-etc).

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?

Thanks for your help,

Vinny


#4

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 :stuck_out_tongue:

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.

Rob


#5

Hi Rob,

I ran the command ./configure -nogui but still got an error. Please see below details from the configure.log file.

Thanks,
Vinny

REPORT: 

MRtrix build type requested:


REPORT: release


REPORT:  [command-line only]


REPORT: 


REPORT: Detecting OS: linux


REPORT: Looking for compiler [clang++]:

EXEC 
<<

CMD: clang++ --version

error invoking command "clang++": No such file or directory

>>



REPORT: not found


REPORT: Looking for compiler [g++]:

EXEC <<

CMD: g++ --version

EXIT: 0


STDOUT:

g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

>>



REPORT: g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4


REPORT: Checking for C++11 compliance:


COMPILE /tmp/tmpM3jw40.cpp:

---


#include <cstddef>

struct Base {
  
  Base (int);

};

struct Derived : Base {
  
  using Base::Base;

};


int main() {
 
 Derived D (int); // check for contructor inheritance
 
 return (0);

}


---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC /tmp/tmpM3jw40.cpp -o /tmp/tmpM3jw40.o

EXIT: 0

>>


EXEC <<
CMD: g++ /tmp/tmpM3jw40.o -pthread -o a.out

EXIT: 0

>>


EXEC <<
CMD: ./a.out

EXIT: 0

>>


REPORT: ok


REPORT: Checking for ::max_align_t:


COMPILE /tmp/tmpJPG5V8.cpp:

---


#include <cstddef>

using ::max_align_t;

int main() {
 
 return 0;

}


---

EXEC 
<<
CMD: g++ -c -std=c++11 -pthread -fPIC /tmp/tmpJPG5V8.cpp -o /tmp/tmpJPG5V8.o

EXIT: 0

>>

EXEC <<

CMD: g++ /tmp/tmpJPG5V8.o -pthread -o a.out

EXIT: 0

>>


EXEC <<
CMD: ./a.out

EXIT: 0

>>



REPORT: ok


REPORT: Checking for std::max_align_t:


COMPILE /tmp/tmpKnD5Iu.cpp:

---


#include <cstddef>

using std::max_align_t;

int main() {

  return 0;

}


---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC /tmp/tmpKnD5Iu.cpp -o /tmp/tmpKnD5Iu.o

EXIT: 1

STDERR:

/tmp/tmpKnD5Iu.cpp:3:12: error: std::max_align_t has not been declared

 using std::max_align_t;

            ^

>>


error deleting temporary file "/tmp/tmpKnD5Iu.o": No such file or directory

REPORT: not found


REPORT: Detecting pointer size:


COMPILE /tmp/tmpUBpB2C.cpp:

---


#include <iostream>

int main() {
 
 std::cout << sizeof(void*);

 return (0);

}


---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC -DMRTRIX_STD_MAX_ALIGN_T_NOT_DEFINED /tmp/tmpUBpB2C.cpp -o /tmp/tmpUBpB2C.o

EXIT: 0

>>


EXEC <<

CMD: g++ /tmp/tmpUBpB2C.o -pthread -o a.out

EXIT: 0

>>


EXEC <<

CMD: ./a.out

EXIT: 0

STDOUT:

8

>>



REPORT: 64 bit


REPORT: Detecting byte order:


REPORT: little-endian


REPORT: Checking for variable-length array support:


COMPILE /tmp/tmpsjCfSO.cpp:

---



int main(int argc, char* argv[]) {
 
 int x[argc];

 return 0;

}


---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC -DMRTRIX_STD_MAX_ALIGN_T_NOT_DEFINED -DMRTRIX_WORD64 /tmp/tmpsjCfSO.cpp -o /tmp/tmpsjCfSO.o

EXIT: 0

>>


EXEC <<

CMD: g++ /tmp/tmpsjCfSO.o -pthread -o a.out

EXIT: 0

>>


EXEC <<

CMD: ./a.out

EXIT: 0

>>



REPORT: yes


REPORT: Checking for non-POD variable-length array support:


COMPILE /tmp/tmptjZbq8.cpp:

---


#include <string>


class X {
 
 int x;
 
 double y;
 
 std::string s;

};


int main(int argc, char* argv[]) {
 
 X x[argc];
 
 return 0;

}


---

EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -DMRTRIX_STD_MAX_ALIGN_T_NOT_DEFINED -DMRTRIX_WORD64 /tmp/tmptjZbq8.cpp -o /tmp/tmptjZbq8.o

EXIT: 0

>>


EXEC <<

CMD: g++ /tmp/tmptjZbq8.o -pthread -o a.out

EXIT: 0

>>


EXEC <<

CMD: ./a.out

EXIT: 0

>>



REPORT: yes


REPORT: Checking for zlib compression library:


COMPILE /tmp/tmpmmh1jS.cpp:

---


#include <iostream>

#include <zlib.h>


int main() {
 
 std::cout << zlibVersion();
 
 return (0);

}


---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC -DMRTRIX_STD_MAX_ALIGN_T_NOT_DEFINED -DMRTRIX_WORD64 /tmp/tmpmmh1jS.cpp -o /tmp/tmpmmh1jS.o

EXIT: 0

>>


EXEC <<

CMD: g++ /tmp/tmpmmh1jS.o -pthread -lz -o a.out

EXIT: 0

>>


EXEC <<

CMD: ./a.out

EXIT: 0

STDOUT:
1.2.8

>>



REPORT: 1.2.8


REPORT: Checking for TIFF library:


COMPILE /tmp/tmpLVgebs.cpp:

---


#include <iostream>

#include <tiffio.h>


int main() {
 
 std::cout << TIFFGetVersion();
 
 return (0);

}


---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC -DMRTRIX_STD_MAX_ALIGN_T_NOT_DEFINED -DMRTRIX_WORD64 /tmp/tmpLVgebs.cpp -o /tmp/tmpLVgebs.o

EXIT: 1

STDERR:

/tmp/tmpLVgebs.cpp:3:20: fatal error: tiffio.h: No such file or directory
 
 #include <tiffio.h>
                    
                    ^
compilation terminated.

>>


error deleting temporary file "/tmp/tmpLVgebs.o": No such file or directory

REPORT: not found - TIFF support disabled


REPORT: Checking for Eigen 3 library:

EXEC <<

CMD: pkg-config --cflags eigen3

EXIT: 0

STDOUT:

-I/usr/include/eigen3

>>



COMPILE /tmp/tmpJ3qqH5.cpp:

---


#include <cstddef>

#include <Eigen/Core>

#include <iostream>


int main (int argc, char* argv[]) {
 
 std::cout << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << "\n";

 return 0;

}


---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC -DMRTRIX_STD_MAX_ALIGN_T_NOT_DEFINED -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmpJ3qqH5.cpp -o /tmp/tmpJ3qqH5.o

EXIT: 0

>>


EXEC <<

CMD: g++ /tmp/tmpJ3qqH5.o -pthread -lz -o a.out

EXIT: 0

>>


EXEC <<

CMD: ./a.out

EXIT: 0

STDOUT:
3.2.0

>>



REPORT: 3.2.0


REPORT: Checking JSON for Modern C++ requirements:

COMPILE /tmp/tmpk_jRJb.cpp:

---


#include "file/json.h"


int main (int argc, char* argv[])
{
 
 nlohmann::json json;
 
 json["key"] = "value";

}



---

EXEC <<

CMD: g++ -c -std=c++11 -pthread -fPIC -DMRTRIX_STD_MAX_ALIGN_T_NOT_DEFINED -DMRTRIX_WORD64 -I/home/Vinit/mrtrix3/core /tmp/tmpk_jRJb.cpp -o /tmp/tmpk_jRJb.o

EXIT: 1

STDERR:

In file included from /tmp/tmpk_jRJb.cpp:2:0:

/home/Vinit/mrtrix3/core/file/json.h:67:10: error: 
#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"

         #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
          
          ^

>>


error deleting temporary file "/tmp/tmpk_jRJb.o": No such file or directory

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.

#6

Vinny

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

Cheers
Rob


#7

Hi Rob,

I installed GCC version 5 using the following commands from https://gist.github.com/beci/2a2091f282042ed20cda:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g+±5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g+±5

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)

Thanks,
Vinny


#8

Hi again Rob,

When I run glxinfo | grep “OpenGL version”, the output is:
OpenGL version string: 2.1 Mesa 10.1.3

From what I see in previous posts, openGL drivers on a Linux platform are problematic to use.

Thanks,

Vinny


#9

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:

which is that you’re very unlikely to find any X server on Windows that will support modern OpenGL (version 3.0 and above). At the moment, the only way to get mrview to run on Windows is the MSYS2 route, as @rsmith mentioned…

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…


ERROR: error compiling Eigen3 application!
#10

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…


#11

Hi,

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.

Thanks,
Vinny


#12

Neither do I - I’ve never looked at the WSL. But the Microsoft WSL FAQ seems to answer some of your questions…?


#13

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!


#14

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… :crossed_fingers: