./configure UnicodeDecodeError

Dear Mrtrix experts,
I’m trying to update mrtrix as specified here.
However, I get the following error when trying to run ./configure:

$ ./configure
MRtrix build type requested: release version
Traceback (most recent call last):
  File "./configure", line 296, in <module>
    log ('PATH set to: ' + path)
  File "./configure", line 233, in log
    logfile.write (message.encode (errors='ignore'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 160: ordinal not in range(128)

I tried following the steps here but still nothing.

The configure.log shows the following:

> ERROR:  Qt moc not found!
> 
>   MRtrix3 was unable to locate the Qt meta-object compiler 'moc'.
> 
>   Make sure your PATH environment variable includes the location of the correct
>   version of this command, for example:
>     $ export PATH=/opt/qt5/bin:$PATH
>     $./configure
>   (amend with the actual path to the Qt executables on your system)

However, the path for qt is specified in my .bash_profile as follows:
export PATH=“⁨/usr/local/Cellar/qt/5.15.1/bin⁩:$PATH”

I am working on macOS mojave (10.14.6).

Thank you in advance,
A

I also tried specifying the path of QT in .bash_profile like this:

export PATH="/usr/local/opt/qt5/bin:$PATH"

and setting the path in the terminal like suggested here:

export PATH=brew --prefix/opt/qt5/bin:$PATH

when I run ./configure, it looks like it’s able to locate qt, but there is some other error:


Checking for Qt moc: moc (version 5.15.1)
Checking for Qt qmake: qmake (version 5.15.1)
Checking for Qt rcc: rcc (version 5.15.1)
Checking for Qt:
ERROR: unexpected exception of type NameError: name ‘filetext’ is not defined

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 output of configure.log is the following:

REPORT: Checking for Qt:

source file "qt.h":
---
#include <QObject>

class Foo: public QObject {
  Q_OBJECT;
  public:
    Foo();
    ~Foo();
  public slots:
    void setValue(int value);
  signals:
    void valueChanged (int newValue);
  private:
    int value_;
};
---

source file "qt.cpp":
---
#include <iostream>
#include "qt.h"

Foo::Foo() : value_ (42) { connect (this, SIGNAL(valueChanged(int)), this, SLOT(setValue(int))); }

Foo::~Foo() { std::cout << qVersion() << "\n"; }

void Foo::setValue (int value) { value_ = value; }

int main() { Foo f; }
---

ERROR: unexpected exception of type NameError: name 'filetext' is not defined

  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.

Thank you!

The first thing to look at is the version of python you’re running. What does python --version report when run under the same conditions as the failing ./configure run? You’d need to be running at least version 2.7 – and pretty soon we’ll probably mandate a minimum version of 3.3…

My python version is 2.7.16

Note that you can install a precompiled MRtrix3 version using the instructions at https://www.mrtrix.org/download/macos-application/ . This is the recommended way to install for end-users that don’t want to modify or contribute code.

If you really want to install from source, you can follow more detailed instructions available at

After the installation of the precompiled Mrtrix3, I cannot open mrview from the terminal…is this normal? I was able to do it before…and I’m afraid something has been messed up as I’m also having problems with dwifslpreproc

(By the way, the binary for mrview is in the folder /usr/local/mrtrix3/bin/)

$ mrview
/usr/local/mrtrix3/bin/mrview: line 7: /usr/local/mrtrix3/bin//usr/local/mrtrix3/bin/MRView.app/Contents/MacOS/mrview: No such file or directory

Thank you

Replacing f="$(dirname "${BASH_SOURCE}")/$(dirname "${f}")" by f="$(dirname "${BASH_SOURCE}")" in Line 7 of the mrview binary solved the issue.

I’m having a similar issue on RHEL 7:

MRtrix build type requested: release version
Detecting OS: linux
Looking for compiler [clang++]: clang version 3.4.2 (tags/RELEASE_34/dot2-final)
Checking for C++11 compliance: ok
Checking shared library generation: ok
Detecting pointer size: 64 bit
Detecting byte order: little-endian
Checking for variable-length array support: ok
Checking for non-POD variable-length array support: not found
Checking for ::max_align_t: 16 bytes
Checking for std::max_align_t: not found
Checking for Eigen3 library: 3.3.7
Checking for zlib compression library: 1.2.7
Checking for "JSON for Modern C++" requirements: ok
Checking for TIFF library: LIBTIFF, Version 4.0.3
Checking for FFTW library: fftw-3.3.3-sse2
Checking for Qt moc: moc (version 5.9.7)
Checking for Qt qmake: qmake (version 5.9.7)
Checking for Qt rcc: rcc (version 5.9.7)
Checking for Qt: 
ERROR: unexpected exception of type NameError: name 'filetext' is not defined
  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.

My python version is 3.6

I’m not sure what’s going on here, but I would suggest you post the full contents of the configure.log file here as suggested in the error message, so we can have a look at exactly what happened.

It would also be helpful to know exactly what version of MRtrix you’re trying to compile. Assuming you’ve obtained the code via git, the command git describe will report exactly which version you have (if not, you should find the version in the file core/version.h). If it’s not 3.0.3, I’d recommend updating with git pull and trying again, on the off-chance that this issue has been fixed since…