Installation problems on Fedora 24

Hello,

I’m getting an error trying to install MRtrix3 on Fedora 24 and g++ version 6.2. The error occurs at the ./configure stage. Here is a full copy of configure.log :


REPORT:
MRtrix build type requested:

REPORT: release

REPORT:

REPORT: Detecting OS: linux

REPORT: Checking for C++11 compliant compiler [g++]:
EXEC <<
CMD: g++ -dumpversion
EXIT: 0
STDOUT:
6.2.1
>>


REPORT: 6.2.1

COMPILE /tmp/tmp0s6fRr.cpp:
---

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 -march=native /tmp/tmp0s6fRr.cpp -o /tmp/tmp0s6fRr.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmp0s6fRr.o -pthread -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>


REPORT:  - tested ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmpH7zFSE.cpp:
---

#include <iostream>
int main() {
  std::cout << sizeof(void*);
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native /tmp/tmpH7zFSE.cpp -o /tmp/tmpH7zFSE.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpH7zFSE.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/tmpj6hbGu.cpp:
---


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

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 /tmp/tmpj6hbGu.cpp -o /tmp/tmpj6hbGu.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpj6hbGu.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/tmpgPd2n6.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 -march=native -DMRTRIX_WORD64 /tmp/tmpgPd2n6.cpp -o /tmp/tmpgPd2n6.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpgPd2n6.o -pthread -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>


REPORT: yes

REPORT: Checking for zlib compression library:

COMPILE /tmp/tmpvc65Ky.cpp:
---

#include <iostream>
#include <zlib.h>

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

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 /tmp/tmpvc65Ky.cpp -o /tmp/tmpvc65Ky.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpvc65Ky.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 Eigen 3 library:
EXEC <<
CMD: pkg-config --cflags eigen3
EXIT: 0
STDOUT:
-I/usr/include/eigen3
>>


COMPILE /tmp/tmphhache.cpp:
---

#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 -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmphhache.cpp -
o /tmp/tmphhache.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmphhache.o -pthread -lz -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
3.2.9
>>


REPORT: 3.2.9

REPORT: Checking shared library generation:
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmpjsOZnK.cpp -
o /tmp/tmpjsOZnK.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpjsOZnK.o -pthread -shared -pthread -lz -o libtest.so
EXIT: 0
>>


REPORT: yes

REPORT: Checking for Qt moc:
EXEC <<
CMD: moc -v
EXIT: 1
STDERR:
Qt Meta Object Compiler version 63 (Qt 4.8.7)
>>


REPORT: moc (version 4.8.7)

REPORT: Checking for Qt qmake:
EXEC <<
CMD: qmake -v
EXIT: 0
STDOUT:
QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib64
>>


REPORT: qmake (version 4.8.7)

REPORT: Checking for Qt rcc:
EXEC <<
CMD: rcc -v
EXIT: 1
STDERR:
Qt Resource Compiler version 4.8.7
>>


REPORT: rcc (version 4.8.7)

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

project file "qt.pro":
---
CONFIG += c++11
QT += core gui opengl svg
HEADERS += qt.h
SOURCES += qt.cpp
---
EXEC <<
CMD: qmake
EXIT: 0
>>

EXEC <<
CMD: moc qt.h -o qt_moc.cpp
EXIT: 0
>>

EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 -pipe -O2 -Wall -W -
D_REENTRANT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/lib64/qt4
/mkspecs/linux-g++ -isystem /usr/include/QtCore -isystem /usr/include/QtGui -isystem /usr/include/QtOpenGL -isystem /
usr/include/QtSvg -isystem /usr/include -isystem /usr/X11R6/include qt.cpp -o qt.o
EXIT: 1
STDERR:
In file included from /usr/include/c++/6.2.1/ext/string_conversions.h:41:0,
                 from /usr/include/c++/6.2.1/bits/basic_string.h:5402,
                 from /usr/include/c++/6.2.1/string:52,
                 from /usr/include/c++/6.2.1/bits/locale_classes.h:40,
                 from /usr/include/c++/6.2.1/bits/ios_base.h:41,
                 from /usr/include/c++/6.2.1/ios:42,
                 from /usr/include/c++/6.2.1/ostream:38,
                 from /usr/include/c++/6.2.1/iostream:39,
                 from qt.cpp:1:
/usr/include/c++/6.2.1/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
compilation terminated.

I found these two posts suggesting there is an issue with using the “-isystem /usr/include” flag with gcc version 6:
https://bugreports.qt.io/browse/QTBUG-53367
https://bugreports.qt.io/browse/QTBUG-53375

Can I change the configure options to not use this flag?
There doesn’t seem to be any easy way to change the g++ to a version < 6 on Fedora 24…

Any other suggestion?

Any help appreciated. Thanks

Julien

Strange, I’ve just tried this on my Arch Linux system, with GCC 6.2.1 and Qt 4.8.7 (so same as you), and there’s no issue. But then in my case there is no mention of the /usr/include folder in the search path. I’d agree with the posts you mention, that it makes no sense to explicitly include the /usr/include folder, it’s a system folder and should already be in the default search path. But it’s a bit odd that things would therefore fall over when it’s included explicitly…

Regardless, I’m not too sure what’s causing this issue on your system, but very clearly the default Qt configuration on your system pulls in /usr/include (configure basically just reads what Qt’s qmake says will be included, as stated in the Makefile it generates) - this does’t happen on my system. But it’s difficult to get around given how tightly integrated the Qt auto-detection is to the configure script. One option to try is to install Qt5 and try with that version - I’d generally recommend using that version anyway, it’ll be better supported in the long run. The chances are, its version of qmake might produce a working Makefile, and sidestep the issue altogether - worth a try…

Actually, just a thought: try the following:

CFLAGS=-I/usr/include ./configure

That should ensure /usr/include is listed in the search path before anything else, which I think might fix it. I reckon the problem is that explictily including it too late in the command line might mean it’s not ‘visible’ to headers that reside in folders listed earlier on the command-line. But it’s just a hunch…

Thanks. I’ve tried your last suggestion, but got the same error.

I have Qt5 installed I think. How do I specify that I want to use it instead of Qt4?

Good question… Different distributions handle this differently. On my system, it’s enough to set the PATH so that the correct versions of Qt’s executables (qmake, moc, rcc) appear first. This might look something like this:

PATH=/usr/lib/qt5/bin:$PATH ./configure

But unfortunately I can’t guarantee this’ll work on Fedora…

Hi. Setting the path worked and configure finally ran to its end after I installed some missing qt5 packages. Thanks!
Will try to build now…