Issues installing latest MRTrix3 on Windows

Following the instructions here: http://mrtrix.readthedocs.io/en/latest/installation/windows_install.html

I’m getting:

MRtrix build type requested: release

Detecting OS: windows
Looking for compiler [g++]: not found
Looking for compiler [clang++]: not found

ERROR: no suitable compiler found!



  Set the CXX environment variable to inform 'configure' of the path to the
  compiler on your system, as follows:
    $ export CXX=/usr/bin/g++-5.5
    $./configure
  (amend with the actual path to the compiler on your system)

  If you are using a compiler other than gcc, you can also set the CXX_ARGS
  environment variable to specify how your compiler expects different arguments
  to be presented on the command line, for instance as follows:
    $ export CXX_ARGS="-c CFLAGS SRC -o OBJECT"
    $ ./configure

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.

Any thoughts? What should I try next?

-Ty

Sorry about the delay in responding. Quick check: did you install all the dependencies via the pacman command line (here in the instructions)? Otherwise nothing will work…

Yup, I followed those instructions and everything seems to have installed, but it’s still giving me the same error.

OK, that’s weird. First off, can you check that you’re running within the right shell: you should be using the MinGW64 Win64 Shell (as per this warning). I think g++ won’t be in the your PATH if you use the standard MSYS2 shell.

Next, check that the relevant package is actually installed:

$ pacman -Qi mingw-w64-x86_64-gcc
Name            : mingw-w64-x86_64-gcc
Version         : 6.3.0-3
Description     : GNU Compiler Collection (C,C++,OpenMP) for MinGW-w64
Architecture    : any
URL             : https://gcc.gnu.org
Licenses        : GPL  LGPL  FDL  custom
Groups          : mingw-w64-x86_64-toolchain
Provides        : mingw-w64-x86_64-gcc-base
Depends On      : mingw-w64-x86_64-binutils  mingw-w64-x86_64-crt  mingw-w64-x86_64-headers  mingw-w64-x86_64-isl  mingw-w64-x86_64-libiconv  mingw-w64-x86_64-mpc  mingw-w64-x86_64-gcc-libs=6.3.0-3  mingw-w64-x86_64-windows-default-manifest  mingw-w64-x86_64-winpthreads
                  mingw-w64-x86_64-zlibhttp://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004692
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : mingw-w64-x86_64-gcc-base
Replaces        : None
Installed Size  : 111.24 MiB
Packager        : Alexey Pavlov <alexpux@gmail.com>
Build Date      : Mon, May 15, 2017 9:59:37 AM
Install Date    : Tue, May 30, 2017 4:42:03 PM
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

and that it actually provides g++:

$ pacman -Ql mingw-w64-x86_64-gcc | grep g++
mingw-w64-x86_64-gcc /mingw64/bin/g++.exe
mingw-w64-x86_64-gcc /mingw64/bin/x86_64-w64-mingw32-g++.exe
mingw-w64-x86_64-gcc /mingw64/share/man/man1/g++.1.gz

If this all checks out, then verify that g++ is in your PATH:

$ which g++
/mingw64/bin/g++

If that still checks out, then I’ve no idea what’s wrong…

Ah! That was it. I’m sorry, I was dumb! :slight_smile:
Thanks for the help!

I’m assuming you mean using the right shell…? Don’t worry, it’s caught me out a few times too… :wink:

I’ve done all of these instructions and I still get the same error

Can you provide more information about this? At the very least, post the full command and its complete output, and preferably also post the contents of the configure.log file. It might also help to post the output of pacman -Q so we can check that all the necessary packages are installed.

Hi,

I followed all the steps mentioned earlier but when trying to run ./configure I get this error:

Traceback (most recent call last):
  File "./configure", line 154, in <module>
    sys.exit (subprocess.call ([ python_cmd ] + sys.argv))
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: a bytes-like object is required, not 'str'

Anybody any thoughts on what I’m doing wrong?

1 Like

This sounds like the second of the issues discussed in this post. I haven’t got round to submitting the fix for that yet – I’ll do that shortly (thanks for the reminder…).

Hi! I had the same problem as lottevdvoort on ./configure last week but it worked today after updating with a git pull. Currently I am stuck on ./build:

> Traceback (most recent call last):
>   File "./build", line 92, in <module>
>     sys.exit (subprocess.call ([ python_cmd ] + sys.argv))
>   File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 323, in call
>     with Popen(*popenargs, **kwargs) as p:
>   File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 775, in __init__
>     restore_signals, start_new_session)
>   File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 1119, in _execute_child
>     args = list2cmdline(args)
>   File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 530, in list2cmdline
>     needquote = (" " in arg) or ("\t" in arg) or not arg
> TypeError: a bytes-like object is required, not 'str'

Any idea on how to solve this?

Thanks!

Embarrassingly, that’s exactly the same problem occurring in build as was occurring in configure – but I’d only fixed the issue in configure… Should hopefully be fixed as soon as this pull request is approved and merged…

Thanks for taking care of that! That helped me finish the installation on my Windows machine :slight_smile:

Just wanted to point out that ./set_path has (probably) the same problem as configure and build. It does not affect installation of course but just letting you know.

$ ./set_path
Traceback (most recent call last):
  File "./set_path", line 25, in <module>
    sys.exit (subprocess.call ([ python_cmd ] + sys.argv))
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: a bytes-like object is required, not 'str'

:man_facepalming:

OK, pull request to fix that one is in the works. This time, I’ve checked this is the only remaining occurrence of the particular construct where this happens…