Configure error linking qt Ubuntu 16.04

Sorry for this basic installation question, see configure.log below.
Has anyone come across this already?

Is it to do with my qt-installation? Already tried it with both qt4 and qt5. The latest version seems to be 5.8, which I also downloaded and installed, but configure doesn’t seem to recognize it? Anyway, maybe it’s not qt?

Thanks for your help, Samuel

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


REPORT: 5.4.0

COMPILE /tmp/tmpS3LJ9e.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 -mno-avx -pthread -fPIC -march=native /tmp/tmpS3LJ9e.cpp -o /tmp/tmpS3LJ9e.o
EXIT: 0
>>

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

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


REPORT:  - tested ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmp8PbqLK.cpp:
---

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

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

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


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

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

EXEC <<
CMD: g++ /tmp/tmpSL1MIc.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/tmpCHtXtj.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 -mno-avx -pthread -fPIC -march=native -DMRTRIX_WORD64 /tmp/tmpCHtXtj.cpp -o /tmp/tmpCHtXtj.o
EXIT: 0
>>

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

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


REPORT: yes

REPORT: Checking for zlib compression library:

COMPILE /tmp/tmpp9KOCA.cpp:
---

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

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

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

EXEC <<
CMD: g++ /tmp/tmpp9KOCA.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/tmpscNVO9.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 -mno-avx -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmpscNVO9.cpp -o /tmp/tmpscNVO9.o
EXIT: 0
>>

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

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


REPORT: 3.2.92

REPORT: Checking Eigen 3 memory alignment requirements:

COMPILE /tmp/tmpUCStpy.cpp:
---

#include <iostream>
#include <Eigen/Core>

int main (int argc, char* argv[]) 
{
#ifdef EIGEN_DEFAULT_ALIGN_BYTES
  size_t default_align = std::numeric_limits<size_t>::max();
  for (size_t n = 0; n < 100; ++n) {
    struct alignas(64) X { double c[8]; };
    X* x = new X;
    size_t align = reinterpret_cast<size_t>(x) & 63U;
    if (align && align < default_align)
      default_align = align;
  }
  std::cout << "allocator memory alignment: " << default_align << ", Eigen3 needs: " << EIGEN_DEFAULT_ALIGN_BYTES << "\n";

  return default_align < EIGEN_DEFAULT_ALIGN_BYTES;
#else
  return 0;
#endif
}


---
EXEC <<
CMD: g++ -c -v -std=c++11 -mno-avx -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmpUCStpy.cpp -o /tmp/tmpUCStpy.o
EXIT: 0
STDERR:
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
COLLECT_GCC_OPTIONS='-c' '-v' '-std=c++11' '-mno-avx' '-pthread' '-fPIC' '-march=native' '-D' 'MRTRIX_WORD64' '-isystem' '/usr/include/eigen3' '-o' '/tmp/tmpUCStpy.o' '-shared-libgcc'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT -D MRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmpUCStpy.cpp -march=broadwell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic -quiet -dumpbase tmpUCStpy.cpp -mno-avx -auxbase-strip /tmp/tmpUCStpy.o -std=c++11 -version -fPIC -fstack-protector-strong -Wformat -Wformat-security -o /tmp/cc03qFRv.s
GNU C++11 (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/eigen3
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++11 (Ubuntu 5.4.0-6ubuntu1~16.04.4) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3fdb80f2154421ceaf9e22c85325a8d
COLLECT_GCC_OPTIONS='-c' '-v' '-std=c++11' '-mno-avx' '-pthread' '-fPIC' '-march=native' '-D' 'MRTRIX_WORD64' '-isystem' '/usr/include/eigen3' '-o' '/tmp/tmpUCStpy.o' '-shared-libgcc'
 as -v --64 -o /tmp/tmpUCStpy.o /tmp/cc03qFRv.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-c' '-v' '-std=c++11' '-mno-avx' '-pthread' '-fPIC' '-march=native' '-D' 'MRTRIX_WORD64' '-isystem' '/usr/include/eigen3' '-o' '/tmp/tmpUCStpy.o' '-shared-libgcc'
>>

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

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
allocator memory alignment: 16, Eigen3 needs: 16
>>


REPORT: OK

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

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


REPORT: yes

REPORT: Checking for Qt moc:
EXEC <<
CMD: moc -v
EXIT: 0
STDOUT:
moc 5.5.1
>>


REPORT: moc (version 5.5.1)

REPORT: Checking for Qt qmake:
EXEC <<
CMD: qmake -v
EXIT: 0
STDOUT:
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu
>>


REPORT: qmake (version 5.5.1)

REPORT: Checking for Qt rcc:
EXEC <<
CMD: rcc -v
EXIT: 0
STDOUT:
rcc 5.5.1
>>


REPORT: rcc (version 5.5.1)

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 -mno-avx -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 -m64 -pipe -O2 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 qt.cpp -o qt.o
EXIT: 0
>>

EXEC <<
CMD: g++ -c -std=c++11 -mno-avx -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 -m64 -pipe -O2 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 qt_moc.cpp -o qt_moc.o
EXIT: 0
>>

EXEC <<
CMD: g++ -pthread -lz qt_moc.o qt.o -o qt -m64 -Wl,-O1 -L/usr/X11R6/lib64 -lQt5OpenGL -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
EXIT: 1
STDERR:
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
>>


ERROR: error linking Qt application!

  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 relevant error here is:

/usr/bin/ld: cannot find -lGL

which seems similar to this issue. I reckon you need to install the right libgl-dev package - but that unfortunately depends on your graphics drivers. If you are using the open-source drivers (mesa), then the correct package would be libgl1-mesa-dev (as per the installation instructions on the MRtrix3 documentation). But if you’re using the nvidia proprietary drivers, then according to this search, these should come with one of the nvidia-361, nvidia-340, or nvidia-304 packages (depending on your hardware). Try installing (or re-installing) whichever package is the right one, see what happens…

Thanks, Donald, for the quick reply!

I was using the latest nvidia driver (375.26) for my card. I have installed an older version now, ended up with 367, which seems to have solved the problem. mrtrix is now running smoothly!

Thanks a lot for your help!

Samuel

Hi,
I had the same issue. Following the suggestion of jdtournier, I updated my nvidia driver, which didn’t solve the issue.
Then, following the recommendation in a stackExchange post with title " Cannot find -lGL but I’ve installed the Nvidia driver", I ran the following command line to make a symbolic link to the nvidia driver:
sudo ln -s /usr/lib/nvidia-331/libGL.so /usr/lib/libGL.so
where you should replace nvidia-331 with the driver version in your system.
This solved the problem for me.

Dropping the line in here just in case anyone stumbles upon the same issue again. Hope this helps

1 Like

Hi,

I’m receiving the same problem as described here, and it seems like I need to link something very specific to /usr/lib/libGL.so?

I have the following nvidia drivers:

$ ubuntu-drivers devices
== /sys/devices/pci0000:40/0000:40:03.1/0000:42:00.0 ==
modalias : pci:v000010DEd00001B02sv000010DEsd000011DFbc03sc00i00
manual_install: True
vendor   : NVIDIA Corporation
driver   : nvidia-415 - third-party free
driver   : nvidia-430 - third-party free recommended
driver   : nvidia-410 - third-party free
driver   : nvidia-390 - third-party free
driver   : xserver-xorg-video-nouveau - distro free builtin
driver   : nvidia-396 - third-party free
driver   : nvidia-384 - distro non-free
driver   : nvidia-418 - third-party free

And looking through my /usr/lib* directories, all the drivers are installed in /usr/lib32/: and I’m not sure which one to pick to create a symbolic link for per your suggestion. Here’s what a $ ls /usr/lib32/ looks like:

$ ls /usr/lib32/
gconv                          libGL.so                             libnvidia-glvkspirv.so.410.48
libcuda.so                     libGL.so.1                           libnvidia-ifr.so
libcuda.so.1                   libGL.so.1.7.0                       libnvidia-ifr.so.1
libcuda.so.410.48              libGLX_indirect.so.0                 libnvidia-ifr.so.410.48
libEGL_nvidia.so.0             libGLX_nvidia.so.0                   libnvidia-ml.so
libEGL_nvidia.so.410.48        libGLX_nvidia.so.410.48              libnvidia-ml.so.1
libEGL.so                      libGLX.so                            libnvidia-ml.so.410.48
libEGL.so.1                    libGLX.so.0                          libnvidia-opencl.so.1
libEGL.so.1.1.0                libnvcuvid.so                        libnvidia-opencl.so.410.48
libgcc_s.so.1                  libnvcuvid.so.1                      libnvidia-ptxjitcompiler.so
libGLdispatch.so.0             libnvcuvid.so.410.48                 libnvidia-ptxjitcompiler.so.1
libGLESv1_CM_nvidia.so.1       libnvidia-compiler.so.410.48         libnvidia-ptxjitcompiler.so.410.48
libGLESv1_CM_nvidia.so.410.48  libnvidia-eglcore.so.410.48          libnvidia-tls.so.410.48
libGLESv1_CM.so                libnvidia-encode.so                  libOpenCL.so
libGLESv1_CM.so.1              libnvidia-encode.so.1                libOpenCL.so.1
libGLESv1_CM.so.1.2.0          libnvidia-encode.so.410.48           libOpenCL.so.1.0
libGLESv2_nvidia.so.2          libnvidia-fatbinaryloader.so.410.48  libOpenCL.so.1.0.0
libGLESv2_nvidia.so.410.48     libnvidia-fbc.so                     libOpenGL.so
libGLESv2.so                   libnvidia-fbc.so.1                   libOpenGL.so.0
libGLESv2.so.2                 libnvidia-fbc.so.410.48              libvdpau_nvidia.so
libGLESv2.so.2.1.0             libnvidia-glcore.so.410.48           tls
libGL.la                       libnvidia-glsi.so.410.48             vdpau

And just in case, here’s the config.log file:


REPORT: 
MRtrix build type requested: release version

REPORT: Detecting OS: linux

REPORT: Looking for compiler [clang++]:
EXEC <<
CMD: clang++ --version
EXIT: 0
STDOUT:
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
>>


REPORT: clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)

REPORT: Checking for C++11 compliance:

COMPILE /tmp/tmprsou5mxh.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: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC /tmp/tmprsou5mxh.cpp -o /tmp/tmprsou5mxh.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmprsou5mxh.o -Wl,--sort-common,--as-needed -pthread -o a.out
EXIT: 0
>>

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


REPORT: ok

REPORT: Checking shared library generation:
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC /tmp/tmp6kj7eos3.cpp -o /tmp/tmp6kj7eos3.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmp6kj7eos3.o -shared -Wl,--sort-common,--as-needed -pthread -o libtest.so
EXIT: 0
>>


REPORT: ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmp8tfyhzfp.cpp:
---

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

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC /tmp/tmp8tfyhzfp.cpp -o /tmp/tmp8tfyhzfp.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmp8tfyhzfp.o -Wl,--sort-common,--as-needed -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/tmphlarfox6.cpp:
---

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

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 /tmp/tmphlarfox6.cpp -o /tmp/tmphlarfox6.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmphlarfox6.o -Wl,--sort-common,--as-needed -pthread -o a.out
EXIT: 0
>>

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


REPORT: ok

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

COMPILE /tmp/tmpdpvxgn8y.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: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 /tmp/tmpdpvxgn8y.cpp -o /tmp/tmpdpvxgn8y.o
EXIT: 1
STDERR:
/tmp/tmpdpvxgn8y.cpp:11:6: error: variable length array of non-POD element type 'X'
  X x[argc];
     ^
1 error generated.
>>

error deleting temporary file "/tmp/tmpdpvxgn8y.o": No such file or directory
REPORT: not found

REPORT: Checking for ::max_align_t:

COMPILE /tmp/tmppil14ob5.cpp:
---

#include <iostream>
#include <cstddef>
using ::max_align_t;
int main() {
  std::cout << alignof (max_align_t) << " bytes\n";
  return 0;
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA /tmp/tmppil14ob5.cpp -o /tmp/tmppil14ob5.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmppil14ob5.o -Wl,--sort-common,--as-needed -pthread -o a.out
EXIT: 0
>>

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


REPORT: 16 bytes

REPORT: Checking for std::max_align_t:

COMPILE /tmp/tmpjtf1w5lv.cpp:
---

#include <iostream>
#include <cstddef>
using std::max_align_t;
int main() {
  std::cout << alignof (max_align_t) << " bytes\n";
  return 0;
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA /tmp/tmpjtf1w5lv.cpp -o /tmp/tmpjtf1w5lv.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmpjtf1w5lv.o -Wl,--sort-common,--as-needed -pthread -o a.out
EXIT: 0
>>

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


REPORT: 16 bytes
EXEC <<
CMD: pkg-config --cflags eigen3
EXIT: 0
STDOUT:
-I/usr/include/eigen3
>>


REPORT: Checking for Eigen3 library:

COMPILE /tmp/tmpk9ty2pkn.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: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/include/eigen3 /tmp/tmpk9ty2pkn.cpp -o /tmp/tmpk9ty2pkn.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmpk9ty2pkn.o -Wl,--sort-common,--as-needed -pthread -o a.out
EXIT: 0
>>

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


REPORT: 3.2.92
EXEC <<
CMD: pkg-config --cflags zlib
EXIT: 0
>>

EXEC <<
CMD: pkg-config --libs zlib
EXIT: 0
STDOUT:
-lz
>>


REPORT: Checking for zlib compression library:

COMPILE /tmp/tmp32ot_dit.cpp:
---

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

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

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA /tmp/tmp32ot_dit.cpp -o /tmp/tmp32ot_dit.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmp32ot_dit.o -Wl,--sort-common,--as-needed -pthread -lz -o a.out
EXIT: 0
>>

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


REPORT: 1.2.8

REPORT: Checking for "JSON for Modern C++" requirements:

COMPILE /tmp/tmpex06n9ap.cpp:
---

#include "file/json.h"
int main (int argc, char* argv[])
{
  nlohmann::json json;
  json["key"] = "value";
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -I/home/axiezai/lab/mrtrix3/core /tmp/tmpex06n9ap.cpp -o /tmp/tmpex06n9ap.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmpex06n9ap.o -Wl,--sort-common,--as-needed -pthread -lz -o a.out
EXIT: 0
>>

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


REPORT: ok
EXEC <<
CMD: pkg-config --cflags libtiff-4
EXIT: 0
STDOUT:
-I/usr/include/x86_64-linux-gnu
>>

EXEC <<
CMD: pkg-config --libs libtiff-4
EXIT: 0
STDOUT:
-ltiff
>>


REPORT: Checking for TIFF library:

COMPILE /tmp/tmp6tfxekb3.cpp:
---

#include <iostream>
#include <tiffio.h>

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

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/include/x86_64-linux-gnu /tmp/tmp6tfxekb3.cpp -o /tmp/tmp6tfxekb3.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmp6tfxekb3.o -Wl,--sort-common,--as-needed -pthread -lz -ltiff -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
LIBTIFF, Version 4.0.6
Copyright (c) 1988-1996 Sam Leffler
Copyright (c) 1991-1996 Silicon Graphics, Inc.
>>


REPORT: LIBTIFF, Version 4.0.6
EXEC <<
CMD: pkg-config --cflags fftw3
EXIT: 0
>>

EXEC <<
CMD: pkg-config --libs fftw3
EXIT: 0
STDOUT:
-lfftw3
>>


REPORT: Checking for FFTW library:

COMPILE /tmp/tmpn2dkjgaq.cpp:
---

#include <iostream>
#include <fftw3.h>

int main() {
  std::cout << fftw_version << "\n";
  return (0);
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -DMRTRIX_TIFF_SUPPORT -isystem /usr/include/x86_64-linux-gnu /tmp/tmpn2dkjgaq.cpp -o /tmp/tmpn2dkjgaq.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /tmp/tmpn2dkjgaq.o -Wl,--sort-common,--as-needed -pthread -lz -ltiff -lfftw3 -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
fftw-3.3.4-sse2-avx
>>


REPORT: fftw-3.3.4-sse2-avx

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/lib/x86_64-linux-gnu
>>


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: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -DMRTRIX_TIFF_SUPPORT -isystem /usr/include/x86_64-linux-gnu -DEIGEN_FFTW_DEFAULT -m64 -pipe -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/share/qt4/mkspecs/linux-g++-64 -isystem /usr/include/qt4/QtCore -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtOpenGL -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4 -isystem /usr/X11R6/include qt.cpp -o qt.o
EXIT: 0
>>

EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -DMRTRIX_TIFF_SUPPORT -isystem /usr/include/x86_64-linux-gnu -DEIGEN_FFTW_DEFAULT -m64 -pipe -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/share/qt4/mkspecs/linux-g++-64 -isystem /usr/include/qt4/QtCore -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtOpenGL -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4 -isystem /usr/X11R6/include qt_moc.cpp -o qt_moc.o
EXIT: 0
>>

EXEC <<
CMD: clang++ -Wl,--sort-common,--as-needed -pthread -lz -ltiff -lfftw3 qt_moc.o qt.o -o qt -m64 -Wl,-O1 -L/usr/lib/x86_64-linux-gnu -L/usr/X11R6/lib64 -lQtSvg -lQtOpenGL -lQtGui -lQtCore -lGL -lpthread
EXIT: 1
STDERR:
/usr/bin/ld: skipping incompatible /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible //usr/lib/libGL.so when searching for -lGL
/usr/bin/ld: cannot find -lGL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
>>


ERROR: error linking Qt application!

  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.

Appreciate any help! Thanks in advance!

Yes, that’s a similar issue. The libGL.so in /usr/lib32 is no use though: it’s the 32-bit version, but you’re compiling for 64-bit. What I can’t tell from your output is which drivers are currently installed. The ubuntu-drivers devices command lists the drivers appropriate for your device, but it doesn’t report which of them is installed. This is the first time I’ve come across this command, I’m not sure whether it should say if a driver is installed…? If so, then it looks like you don’t have any drivers installed right now, in which case you can try installing one using:

sudo ubuntu-drivers autoinstall

as recommended on this post.

If that’s not the issue, then can you post the output of dpkg -l | grep nvidia, that should tell us what’s currently installed.

Thanks for the response! I believe there are definitely drivers ready on the ubuntu machine because we’ve used the GPU for some machine learning algorithms before. Per your response, the output of dpkg -l | grep nvidia is the following:

$ dpkg -l | grep nvidia
ii  libnvidia-container-tools                  1.0.2-1                                      amd64        NVIDIA container runtime library (command-line tools)
ii  libnvidia-container1:amd64                 1.0.2-1                                      amd64        NVIDIA container runtime library
ii  nvidia-container-runtime                   2.0.0+docker18.09.6-3                        amd64        NVIDIA container runtime
ii  nvidia-container-runtime-hook              1.4.0-1                                      amd64        NVIDIA container runtime hook
ii  nvidia-docker2                             2.0.3+docker18.09.6-3                        all          nvidia-docker CLI wrapper

and from some searches, the output of nvidia-smi (the nvidia system management command), the output is the following:

 $ nvidia-smi
Tue Jun  4 10:45:24 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.48                 Driver Version: 410.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  TITAN Xp            Off  | 00000000:42:00.0  On |                  N/A |
| 23%   32C    P8    18W / 250W |  11781MiB / 12194MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1509      G   /usr/lib/xorg/Xorg                           109MiB |
|    0      4710      G   compiz                                        31MiB |
|    0     16517      G   /usr/lib/xorg/Xorg                            59MiB |
|    0     86999      C   .../jiamin/.virtualenvs/py37_tf/bin/python 11527MiB |
+-----------------------------------------------------------------------------+

Seems like my driver version is 410.48, is this compatible? Not sure how I should go about tweaking these things, thanks again for all the help!

OK, I’ve never seen these packages… Are you running within a Docker container? I’m not sure how easy it is to get OpenGL 3 to work within a container like this, but the fact that there seems to be some packages to support it is encouraging. In any case, none of the packages listed have the -dev suffix, which is where I’d normally expect the files required for development to reside. See if you can find packages that provide development files similar to this one, but matching what you have installed.

On top of this, things have also got a bit more complicated on this front since the introduction of the Vendor neutral GL dispatch library, so what you may be missing is a package like libglvnd-dev - which I think will pull in the required dependencies…

I am not running this in a docker container, I’m just trying to get mrtrix set up on a regular ubuntu 16.04 machine, surprisingly, doing a sudo apt-get install nvidia-410-dev solved the issue!

I have no idea what this means in the black box of configuring mrtrix, but it seems like the development files are what were missing! Now the /.configure outputs Qt: 4.8.7 and everything looks good!

Thank you for the help!