Installation Error: Could not find qmake spec 'macx-clang'

Hi MRTrix user community,

Thank you everyone for reading this post.

I have encountered some error in installing mrtrix on my new machine.

In particular, ./configure returned with error as follow:

Chans-iMac-Pro:mrtrix3 cll$ ./configure

MRtrix build type requested: release version

Detecting OS: darwin
OS X deployment target: 10.14
Looking for compiler [clang++]: Apple clang version 11.0.0 (clang-1100.0.33.8)
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: ok
Checking for ::max_align_t: 16 bytes
Checking for std::max_align_t: 16 bytes
Checking for Eigen3 library: 3.3.7
Checking for zlib compression library: 1.2.11
Checking for "JSON for Modern C++" requirements: ok
Checking for TIFF library: LIBTIFF, Version 4.0.10
Checking for FFTW library: fftw-3.3.8-sse2-avx
Checking for Qt moc: moc (version 5.13.1)
Checking for Qt qmake: qmake (version 5.13.1)
Checking for Qt rcc: rcc (version 5.13.1)
Checking for Qt: 
ERROR: qmake returned with error:

Could not find qmake spec 'macx-clang'.
Error processing project file: /private/var/folders/gj/s_6jz24x759f5c1p7mlf0bp00000gn/T/tmpTlu1s9/qt.pro


ERROR: unexpected exception!

  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.

I have also included the configure.log here:

Chans-iMac-Pro:mrtrix3 cll$ vim configure.log

  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; }
---

project file "qt.pro":
---
CONFIG += c++11
QT += core gui opengl svg
HEADERS += qt.h
SOURCES += qt.cpp
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
---
EXEC <<
CMD: qmake
EXIT: 3
STDERR:
Could not find qmake spec 'macx-clang'.
Error processing project file: /private/var/folders/gj/s_6jz24x759f5c1p7mlf0bp00000gn/T/tmpTlu1s9/qt.pro
>>


ERROR: qmake returned with error:

Could not find qmake spec 'macx-clang'.
Error processing project file: /private/var/folders/gj/s_6jz24x759f5c1p7mlf0bp00000gn/T/tmpTlu1s9/qt.pro


ERROR: unexpected exception!

  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.

May I ask for your help in solving this?

Thank you.

Best regards,
Arthur

Your Mrtrix is unable to locate few files which i can clearly see.
Just a basic question Have you installed Homebrew ?
If yes, than these files will be there in the homebrew folder where you have installed your homebrew …
Go to macintosh HD
Homebrew
Opt -folder
Qt5
Bin
Or in opt folder you will find all the dependencies …
Just provide the path for the dependencies

Thanks for the reply!!

Yes I have installed homebrew and used it to build all the dependencies.

It seems like there’s some errors regarding qt5 installation on this machine. I installed qt5 with homebrew, and tried uninstalling and reinstalling with homebrew again but couldn’t really solve the issue.

When I altered the PATH, the Qt moc Qt qmake and Qt rcc became undetectable by ./configure. Therefore I was thinking maybe it wasn’t just a PATH issue.

Ok, assuming you’ve followed the instructions for installing the dependencies on macOS, including pkg-config and setting the PATH, one explanation for this might be that you have a competing install of Qt5 already on the system (maybe installed via macports or anaconda?).

What does which qmake report? If that returns a path outside of /opt/qt5, that tells you it’s trying to use a different version than the one provided via homebrew.

Thanks for the reply!

Yes I have been following the instruction by installing all the dependencies with homebrew!!

So I uninstalled my qt5 with homebrew and ran ./configure, it didn’t find Qt moc hence it stopped there.

I also ran which qmake which reported nothing. Thanks!!

Update:

After I reinstalled qt5 with homebrew and set up the path, I got stuck again at Could not find qmake spec ‘macx-clang’.

This time round, typing which qmake returns /Users/cll/homebrew/opt/qt5/bin/qmake

OK, so it’s not a competing install – that’s good.

Now that you’ve reinstalled Qt, I note it’s installed within your home folder, rather than the system-wide /opt/qt5 folder. This might be the cause of the issues…

This StackOverflow thread might offer some insights into what’s going on. Basically, check what qmake --version returns, what folder it assumes Qt was installed in. If it differs from what you expect, that would explain the issue. You’d then need to figure out why it differs…