A problem of dwifslpreproc

Following error is coming if try to run dwifslpreproc

'ERROR: Unable to locate MRtrix3 Python modules

For detailed instructions, please refer to:
External modules — MRtrix 3.0 documentation

issue is consistent for dwifslpreproc command not for dwinoise.
Please help.

Hi @math_priyanka,

That’s unexpected… and the error message is not what I’d expect to see either!

Can I ask what OS this is running on, which version, and how the software was installed exactly? I don’t expect this to happen unless something has happened to the software installation. Maybe someone deleted the mrtrix3.py file in the bin/ folder? I would expect that would cause this type of problem…

All the best,
Donald.

mrtrix3.py file is in /bin/. and the version of OS
NAME=“Ubuntu”
VERSION=“16.04.7 LTS (Xenial Xerus)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 16.04.7 LTS”
VERSION_ID=“16.04”
HOME_URL=“http://www.ubuntu.com/
SUPPORT_URL=“http://help.ubuntu.com/
BUG_REPORT_URL=“Bugs : Ubuntu
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
I dnt remember how the software was install. I will try reinstalling it.

When I try to reinstall MRtrix…i found this.

MRtrix build type requested: release version

WARNING: anaconda/miniconda detected in PATH ("**/anaconda3/bin") - removed to avoid conflicts
WARNING: anaconda/miniconda detected in PATH ("**/anaconda3/condabin") - removed to avoid conflicts

NOTE: if you intend to build with anaconda/miniconda (not recommended), pass the -conda flag to ./configure

Detecting OS: linux
Looking for compiler [clang++]: not found
Looking for compiler [g++]: g++ (conda-forge gcc 11.3.0-19) 11.3.0
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.2.92
Checking for Eigen3 Unsupported: not found; custom functions to be used
Checking for zlib compression library: 1.2.13
Checking for "JSON for Modern C++" requirements: ok
Checking for TIFF library: LIBTIFF, Version 4.4.0
Checking for PNG library: Header: 1.6.36; library: 1.6.39
Checking for FFTW library: not found - FFTW support disabled
Checking for Qt moc: moc (version 5.15.6)
Checking for Qt qmake: qmake (version 5.15.6)
Checking for Qt rcc: rcc (version 5.15.6)
Checking for Qt: 
ERROR: error linking Qt application

Ok, that’s a really old version of Ubuntu, but it looks like you have up to date versions of all the dependencies, so it should work ok. My guess is there’s a conflict with either anaconda or FSL. Can you post the full contents of the configure.log file so we can work out what’s causing the issue?

I suspect it’ll just be a matter of running the build in a clean environment, which might be just a matter of running:

bash --noprofile --norc

To start a new session without any of the settings in your startup files, and then trying configure & build again. But that depends on exactly what we see in the configure.log

This is the content of ‘configure.log’ …

REPORT: 
MRtrix build type requested: release version

REPORT: WARNING: anaconda/miniconda detected in PATH ("/home/amit/anaconda3/bin") - removed to avoid conflicts

REPORT: WARNING: anaconda/miniconda detected in PATH ("/home/amit/anaconda3/condabin") - removed to avoid conflicts
PATH set to: /home/amit/MRtrix3Tissue-master/bin:/usr/local/freesurfer/bin:/usr/local/freesurfer/fsfast/bin:/usr/local/freesurfer/tktools:/usr/local/fsl/bin:/usr/local/freesurfer/mni/bin:/home/amit/mrtrix3/bin:/usr/local/fsl/bin:/home/amit/bin:/home/amit/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
REPORT: 
NOTE: if you intend to build with anaconda/miniconda (not recommended), pass the -conda flag to ./configure

REPORT: Detecting OS: linux

REPORT: Looking for compiler [clang++]:
EXEC <<
CMD: clang++ --version
error invoking command "clang++": No such file or directory: 'clang++'
>>


REPORT: not found

REPORT: Looking for compiler [g++]:
EXEC <<
CMD: g++ --version
EXIT: 0
STDOUT:
g++ (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>


REPORT: g++ (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010

REPORT: Checking for C++11 compliance:

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

EXEC <<
CMD: g++ /tmp/tmprw0bxzaa.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: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC /tmp/tmpw2aucflh.cpp -o /tmp/tmpw2aucflh.o
EXIT: 0
>>

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


REPORT: ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmpuw427h6r.cpp:
---

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

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

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

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

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

EXEC <<
CMD: g++ /tmp/tmp3pl0z6gn.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/tmpd6xq0tju.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 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 /tmp/tmpd6xq0tju.cpp -o /tmp/tmpd6xq0tju.o
EXIT: 0
>>

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

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


REPORT: ok

REPORT: Checking for ::max_align_t:

COMPILE /tmp/tmp7qmixvdy.cpp:
---

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

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

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

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

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

EXEC <<
CMD: g++ /tmp/tmpay12layd.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/tmpk6p3c7js.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: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /usr/include/eigen3 /tmp/tmpk6p3c7js.cpp -o /tmp/tmpk6p3c7js.o
EXIT: 0
>>

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

REPORT: Checking for Eigen3 Unsupported:

COMPILE /tmp/tmpxn0lgjgd.cpp:
---

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

using array_type = Eigen::Array<double, 1, 1>;

int main (int argc, char* argv[]) {
  auto test = Eigen::betainc (array_type::Constant (10.0), array_type::Constant (0.5), array_type::Constant (1.0));
  std::cout << "Present";
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /usr/include/eigen3 -DEIGEN_DONT_PARALLELIZE /tmp/tmpxn0lgjgd.cpp -o /tmp/tmpxn0lgjgd.o
EXIT: 1
STDERR:
/tmp/tmpxn0lgjgd.cpp:4:46: fatal error: unsupported/Eigen/SpecialFunctions: No such file or directory
compilation terminated.
>>

error deleting temporary file "/tmp/tmpxn0lgjgd.o": No such file or directory
REPORT: not found; custom functions to be used
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/tmp_9nte330.cpp:
---

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

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

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

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

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

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -I/home/amit/mrtrix3/core /tmp/tmpqra7vwuq.cpp -o /tmp/tmpqra7vwuq.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpqra7vwuq.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: 1
STDERR:
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
>>

error running "pkg-config --cflags libtiff-4"

EXEC <<
CMD: pkg-config --libs libtiff-4
EXIT: 1
STDERR:
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
>>

error running "pkg-config --libs libtiff-4"


REPORT: Checking for TIFF library:

COMPILE /tmp/tmpqgovk224.cpp:
---

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

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

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 /tmp/tmpqgovk224.cpp -o /tmp/tmpqgovk224.o
EXIT: 1
STDERR:
/tmp/tmpqgovk224.cpp:3:20: fatal error: tiffio.h: No such file or directory
compilation terminated.
>>

error deleting temporary file "/tmp/tmpqgovk224.o": No such file or directory
REPORT: not found - TIFF support disabled
EXEC <<
CMD: pkg-config --cflags libpng
EXIT: 0
STDOUT:
-I/usr/include/libpng12
>>

EXEC <<
CMD: pkg-config --libs libpng
EXIT: 0
STDOUT:
-lpng12
>>


REPORT: Checking for PNG library:

COMPILE /tmp/tmpo38czrde.cpp:
---

#include <iostream>
#include <png.h>

int main() {
  std::cout << "Header: " << PNG_LIBPNG_VER_STRING << "; library: " << png_libpng_ver;
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /usr/include/libpng12 /tmp/tmpo38czrde.cpp -o /tmp/tmpo38czrde.o
EXIT: 0
>>

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

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
Header: 1.2.54; library: 1.2.54
>>


REPORT: Header: 1.2.54; library: 1.2.54
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/tmpu2cr6l_j.cpp:
---

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

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

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_PNG_SUPPORT -idirafter /usr/include/libpng12 /tmp/tmpu2cr6l_j.cpp -o /tmp/tmpu2cr6l_j.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpu2cr6l_j.o -Wl,--sort-common,--as-needed -pthread -lz -lpng12 -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: 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 network
HEADERS += qt.h
SOURCES += qt.cpp
---
EXEC <<
CMD: qmake
EXIT: 0
>>

reading Qt parameters from file 'Makefile'... ok
  qt_defines: ['-DQT_NO_DEBUG', '-DQT_OPENGL_LIB', '-DQT_SVG_LIB', '-DQT_WIDGETS_LIB', '-DQT_GUI_LIB', '-DQT_NETWORK_LIB', '-DQT_CORE_LIB']
  qt_includes: ['-I.', '-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/QtNetwork', '-isystem', '/usr/include/x86_64-linux-gnu/qt5/QtCore', '-I.', '-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64']
  qt_libs: ['$(SUBLIBS)', '-L/usr/X11R6/lib64', '-lQt5OpenGL', '-lQt5Svg', '-lQt5Widgets', '-lQt5Gui', '-lQt5Network', '-lQt5Core', '-lGL', '-lpthread']
EXEC <<
CMD: moc qt.h -o qt_moc.cpp
EXIT: 0
>>

EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_PNG_SUPPORT -idirafter /usr/include/libpng12 -DEIGEN_FFTW_DEFAULT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_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/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -idirafter /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 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_PNG_SUPPORT -idirafter /usr/include/libpng12 -DEIGEN_FFTW_DEFAULT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_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/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -idirafter /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 qt_moc.cpp -o qt_moc.o
EXIT: 0
>>

EXEC <<
CMD: g++ -Wl,--sort-common,--as-needed -pthread -lz -lpng12 -lfftw3 qt_moc.o qt.o -o qt -L/usr/X11R6/lib64 -lQt5OpenGL -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lGL -lpthread
EXIT: 0
>>

EXEC <<
CMD: /tmp/tmpn3ikv_we/qt
EXIT: 0
STDOUT:
5.5.1
>>


REPORT: 5.5.1

Hello, jdtournier, did you find anything wrong in configure.log file?

Hi @math_priyanka,

Sorry, I’ve been traveling (back from the MRtrix workshop!).

First thought is that the settings detected in your last post are clearly quite different from those you had in your first post – I suspect that last run took place in a clean shell as I’d suggested?

In your initial post, it was trying to use the anaconda compiler (which rarely works for compiling MRtrix) and Qt 5.15.6 (presumably also provided through anaconda). Now it’s trying to use the default compiler and Qt library that ship with Ubuntu 16.04: g++ 5.5.0 and Qt 5.5. Normally I would say these are too old, but it looks to me like ./configure ran through without any errors? Have you tried running ./build yet? I have a feeling it ought to work now…

All the best,
Donald

Hello Donald,

As you suggested, I cleaned the shell, restarted the kernel, and reran the configure file. However, the same error persists. I will proceed to uninstall and reinstall MRTrix and then get back to you.

Thank you
Priyanka

Hello donald,
One more request regarding this post…

I understand that this issue has been discussed extensively, and I’ve been working diligently on it for quite some time, but I’m still facing some challenges with it. Please assist me. Thank you in advance for your help.
Thank you
Priyanka

Before you uninstall everything, let’s try to figure out the issue – a full reinstall isn’t necessarily going to fix the problem if the issue is elsewhere! Please provide the exact commands you’ve tried and the full output of the terminal so we can see exactly what the problem is. I’m sure we can work it out, otherwise I’m worried your may be making your life harder than it needs to be!

1 Like

Okay, that’s really nice of you. I’ve been struggling a lot with preprocessing, and the scarcity of system resources makes it even more difficult to work. Your motivation is great. I will try to find the error and provide you with the full output.

1 Like

Hello,
The exact command I have used:

(base) amit@amit-Precision-5820-Tower:~/Desktop/preproc/sub-CC121200$ dwifslpreproc -rpe_none -pe_dir j- sub-CC121200_den_unr.mif sub_preproc.mif -eddy_options " --slm=linear --data_is_shelled"

ERROR: Unable to locate MRtrix3 Python modules

For detailed instructions, please refer to:
https://mrtrix.readthedocs.io/en/latest/tips_and_tricks/external_modules.html
(base) amit@amit-Precision-5820-Tower:~/Desktop/preproc/sub-CC121200$ 

(base) amit@amit-Precision-5820-Tower:~/Desktop/preproc/sub-CC121200$ bash --noprofile --norc
bash-5.1$ dwifslpreproc -rpe_none -pe_dir j- sub-CC121200_den_unr.mif sub_preproc.mif -eddy_options " --slm=linear --data_is_shelled"

ERROR: Unable to locate MRtrix3 Python modules

For detailed instructions, please refer to:
https://mrtrix.readthedocs.io/en/latest/tips_and_tricks/external_modules.html

(base) amit@amit-Precision-5820-Tower:~/mrtrix3$ ./configure

MRtrix build type requested: release version

WARNING: anaconda/miniconda detected in PATH ("/home/amit/anaconda3/bin") - removed to avoid conflicts
WARNING: anaconda/miniconda detected in PATH ("/home/amit/anaconda3/condabin") - removed to avoid conflicts

NOTE: if you intend to build with anaconda/miniconda (not recommended), pass the -conda flag to ./configure

Detecting OS: linux
Looking for compiler [clang++]: not found
Looking for compiler [g++]: g++ (conda-forge gcc 11.3.0-19) 11.3.0
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.2.92
Checking for Eigen3 Unsupported: not found; custom functions to be used
Checking for zlib compression library: 1.2.13
Checking for "JSON for Modern C++" requirements: ok
Checking for TIFF library: LIBTIFF, Version 4.4.0
Checking for PNG library: Header: 1.6.36; library: 1.6.39
Checking for FFTW library: not found - FFTW support disabled
Checking for Qt moc: moc (version 5.15.6)
Checking for Qt qmake: qmake (version 5.15.6)
Checking for Qt rcc: rcc (version 5.15.6)
Checking for Qt: 
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.

configure.log file content

REPORT: 
MRtrix build type requested: release version

REPORT: WARNING: anaconda/miniconda detected in PATH ("/home/amit/anaconda3/bin") - removed to avoid conflicts

REPORT: WARNING: anaconda/miniconda detected in PATH ("/home/amit/anaconda3/condabin") - removed to avoid conflicts
PATH set to: /home/amit/MRtrix3Tissue-master/bin:/usr/local/freesurfer/bin:/usr/local/freesurfer/fsfast/bin:/usr/local/freesurfer/tktools:/home/amit/fsl/bin:/home/amit/fsl/share/fsl/bin:/usr/local/freesurfer/mni/bin:/home/amit/mrtrix3/bin:/home/amit/fsl/share/fsl/bin:/home/amit/fsl/share/fsl/bin:/home/amit/bin:/home/amit/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
REPORT: 
NOTE: if you intend to build with anaconda/miniconda (not recommended), pass the -conda flag to ./configure

REPORT: Detecting OS: linux

REPORT: Looking for compiler [clang++]:
EXEC <<
CMD: clang++ --version
error invoking command "clang++": No such file or directory
>>


REPORT: not found

REPORT: Looking for compiler [g++]:
EXEC <<
CMD: g++ --version
EXIT: 0
STDOUT:
g++ (conda-forge gcc 11.3.0-19) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>


REPORT: g++ (conda-forge gcc 11.3.0-19) 11.3.0

REPORT: Checking for C++11 compliance:

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

EXEC <<
CMD: g++ /tmp/tmpmv5674iu.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: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC /tmp/tmpmursypzk.cpp -o /tmp/tmpmursypzk.o
EXIT: 0
>>

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


REPORT: ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmpe4vfwr_l.cpp:
---

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

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

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

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

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

EXEC <<
CMD: g++ /tmp/tmpqjg2w5av.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/tmp86b6v63x.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 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 /tmp/tmp86b6v63x.cpp -o /tmp/tmp86b6v63x.o
EXIT: 0
>>

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

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


REPORT: ok

REPORT: Checking for ::max_align_t:

COMPILE /tmp/tmpmp1a3523.cpp:
---

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

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

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

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

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

EXEC <<
CMD: g++ /tmp/tmpwila513z.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/tmp24wr7uw0.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: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /usr/include/eigen3 /tmp/tmp24wr7uw0.cpp -o /tmp/tmp24wr7uw0.o
EXIT: 0
>>

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

REPORT: Checking for Eigen3 Unsupported:

COMPILE /tmp/tmpfeaj6pt2.cpp:
---

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

using array_type = Eigen::Array<double, 1, 1>;

int main (int argc, char* argv[]) {
  auto test = Eigen::betainc (array_type::Constant (10.0), array_type::Constant (0.5), array_type::Constant (1.0));
  std::cout << "Present";
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /usr/include/eigen3 -DEIGEN_DONT_PARALLELIZE /tmp/tmpfeaj6pt2.cpp -o /tmp/tmpfeaj6pt2.o
EXIT: 1
STDERR:
/tmp/tmpfeaj6pt2.cpp:4:10: fatal error: unsupported/Eigen/SpecialFunctions: No such file or directory
    4 | #include <unsupported/Eigen/SpecialFunctions>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
>>

error deleting temporary file "/tmp/tmpfeaj6pt2.o": No such file or directory
REPORT: not found; custom functions to be used
EXEC <<
CMD: pkg-config --cflags zlib
EXIT: 0
STDOUT:
-I/home/amit/anaconda3/include
>>

EXEC <<
CMD: pkg-config --libs zlib
EXIT: 0
STDOUT:
-L/home/amit/anaconda3/lib -lz
>>


REPORT: Checking for zlib compression library:

COMPILE /tmp/tmpeyvi929a.cpp:
---

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

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

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /home/amit/anaconda3/include /tmp/tmpeyvi929a.cpp -o /tmp/tmpeyvi929a.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpeyvi929a.o -Wl,--sort-common,--as-needed -pthread -L/home/amit/anaconda3/lib -lz -o a.out
EXIT: 0
>>

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


REPORT: 1.2.13

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

COMPILE /tmp/tmp3af34kin.cpp:
---

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

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /home/amit/anaconda3/include -I/home/amit/mrtrix3/core /tmp/tmp3af34kin.cpp -o /tmp/tmp3af34kin.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmp3af34kin.o -Wl,--sort-common,--as-needed -pthread -L/home/amit/anaconda3/lib -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/home/amit/anaconda3/include
>>

EXEC <<
CMD: pkg-config --libs libtiff-4
EXIT: 0
STDOUT:
-L/home/amit/anaconda3/lib -ltiff
>>


REPORT: Checking for TIFF library:

COMPILE /tmp/tmp80imc4ey.cpp:
---

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

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

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /home/amit/anaconda3/include -idirafter /home/amit/anaconda3/include /tmp/tmp80imc4ey.cpp -o /tmp/tmp80imc4ey.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmp80imc4ey.o -Wl,--sort-common,--as-needed -pthread -L/home/amit/anaconda3/lib -lz -L/home/amit/anaconda3/lib -ltiff -o a.out
EXIT: 0
>>

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


REPORT: LIBTIFF, Version 4.4.0
EXEC <<
CMD: pkg-config --cflags libpng
EXIT: 0
STDOUT:
-I/home/amit/anaconda3/include/libpng16 -I/home/amit/anaconda3/include
>>

EXEC <<
CMD: pkg-config --libs libpng
EXIT: 0
STDOUT:
-L/home/amit/anaconda3/lib -lpng16 -lz
>>


REPORT: Checking for PNG library:

COMPILE /tmp/tmpsan0_cxa.cpp:
---

#include <iostream>
#include <png.h>

int main() {
  std::cout << "Header: " << PNG_LIBPNG_VER_STRING << "; library: " << png_libpng_ver;
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /home/amit/anaconda3/include -DMRTRIX_TIFF_SUPPORT -idirafter /home/amit/anaconda3/include -idirafter /home/amit/anaconda3/include/libpng16 -idirafter /home/amit/anaconda3/include /tmp/tmpsan0_cxa.cpp -o /tmp/tmpsan0_cxa.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpsan0_cxa.o -Wl,--sort-common,--as-needed -pthread -L/home/amit/anaconda3/lib -lz -L/home/amit/anaconda3/lib -ltiff -L/home/amit/anaconda3/lib -lpng16 -lz -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
Header: 1.6.36; library: 1.6.39
>>


REPORT: Header: 1.6.36; library: 1.6.39
EXEC <<
CMD: pkg-config --cflags fftw3
EXIT: 1
STDERR:
Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3' found
>>

error running "pkg-config --cflags fftw3"

EXEC <<
CMD: pkg-config --libs fftw3
EXIT: 1
STDERR:
Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3' found
>>

error running "pkg-config --libs fftw3"


REPORT: Checking for FFTW library:

COMPILE /tmp/tmp7z1kf5dz.cpp:
---

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

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

---
EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /home/amit/anaconda3/include -DMRTRIX_TIFF_SUPPORT -idirafter /home/amit/anaconda3/include -DMRTRIX_PNG_SUPPORT -idirafter /home/amit/anaconda3/include/libpng16 -idirafter /home/amit/anaconda3/include /tmp/tmp7z1kf5dz.cpp -o /tmp/tmp7z1kf5dz.o
EXIT: 1
STDERR:
/tmp/tmp7z1kf5dz.cpp:3:10: fatal error: fftw3.h: No such file or directory
    3 | #include <fftw3.h>
      |          ^~~~~~~~~
compilation terminated.
>>

error deleting temporary file "/tmp/tmp7z1kf5dz.o": No such file or directory
REPORT: not found - FFTW support disabled

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


REPORT: moc (version 5.15.6)

REPORT: Checking for Qt qmake:
EXEC <<
CMD: qmake -v
EXIT: 0
STDOUT:
QMake version 3.1
Using Qt version 5.15.6 in /home/amit/fsl/lib
>>


REPORT: qmake (version 5.15.6)

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


REPORT: rcc (version 5.15.6)

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 network
HEADERS += qt.h
SOURCES += qt.cpp
---
EXEC <<
CMD: qmake
EXIT: 0
STDOUT:
Info: creating stash file /tmp/tmpwtpgm94b/.qmake.stash
>>

reading Qt parameters from file 'Makefile'... ok
  qt_defines: ['-DQT_NO_DEBUG', '-DQT_OPENGL_LIB', '-DQT_SVG_LIB', '-DQT_WIDGETS_LIB', '-DQT_GUI_LIB', '-DQT_NETWORK_LIB', '-DQT_CORE_LIB']
  qt_includes: ['-I.', '-I/home/amit/fsl/include/qt', '-I/home/amit/fsl/include/qt/QtOpenGL', '-I/home/amit/fsl/include/qt/QtSvg', '-I/home/amit/fsl/include/qt/QtWidgets', '-I/home/amit/fsl/include/qt/QtGui', '-I/home/amit/fsl/include/qt/QtNetwork', '-I/home/amit/fsl/include/qt/QtCore', '-I.', '-I/home/amit/fsl/include', '-I/usr/include/libdrm', '-I$(CONDA_BUILD_SYSROOT)/usr/include', '-I/home/amit/fsl/mkspecs/linux-g++']
  qt_libs: ['$(SUBLIBS)', '/home/amit/fsl/lib/libQt5OpenGL.so', '/home/amit/fsl/lib/libQt5Svg.so', '/home/amit/fsl/lib/libQt5Widgets.so', '/home/amit/fsl/lib/libQt5Gui.so', '/home/amit/fsl/lib/libQt5Network.so', '/home/amit/fsl/lib/libQt5Core.so', '-L/usr/lib64', '-lGL', '-lpthread']
EXEC <<
CMD: moc qt.h -o qt_moc.cpp
EXIT: 0
>>

EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /home/amit/anaconda3/include -DMRTRIX_TIFF_SUPPORT -idirafter /home/amit/anaconda3/include -DMRTRIX_PNG_SUPPORT -idirafter /home/amit/anaconda3/include/libpng16 -idirafter /home/amit/anaconda3/include -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -idirafter /home/amit/fsl/include/qt -idirafter /home/amit/fsl/include/qt/QtOpenGL -idirafter /home/amit/fsl/include/qt/QtSvg -idirafter /home/amit/fsl/include/qt/QtWidgets -idirafter /home/amit/fsl/include/qt/QtGui -idirafter /home/amit/fsl/include/qt/QtNetwork -idirafter /home/amit/fsl/include/qt/QtCore -idirafter /home/amit/fsl/include -idirafter /usr/include/libdrm -idirafter $(CONDA_BUILD_SYSROOT)/usr/include -idirafter /home/amit/fsl/mkspecs/linux-g++ qt.cpp -o qt.o
EXIT: 0
>>

EXEC <<
CMD: g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -idirafter /home/amit/anaconda3/include -DMRTRIX_TIFF_SUPPORT -idirafter /home/amit/anaconda3/include -DMRTRIX_PNG_SUPPORT -idirafter /home/amit/anaconda3/include/libpng16 -idirafter /home/amit/anaconda3/include -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -idirafter /home/amit/fsl/include/qt -idirafter /home/amit/fsl/include/qt/QtOpenGL -idirafter /home/amit/fsl/include/qt/QtSvg -idirafter /home/amit/fsl/include/qt/QtWidgets -idirafter /home/amit/fsl/include/qt/QtGui -idirafter /home/amit/fsl/include/qt/QtNetwork -idirafter /home/amit/fsl/include/qt/QtCore -idirafter /home/amit/fsl/include -idirafter /usr/include/libdrm -idirafter $(CONDA_BUILD_SYSROOT)/usr/include -idirafter /home/amit/fsl/mkspecs/linux-g++ qt_moc.cpp -o qt_moc.o
EXIT: 0
>>

EXEC <<
CMD: g++ -Wl,--sort-common,--as-needed -pthread -L/home/amit/anaconda3/lib -lz -L/home/amit/anaconda3/lib -ltiff -L/home/amit/anaconda3/lib -lpng16 -lz qt_moc.o qt.o -o qt /home/amit/fsl/lib/libQt5OpenGL.so /home/amit/fsl/lib/libQt5Svg.so /home/amit/fsl/lib/libQt5Widgets.so /home/amit/fsl/lib/libQt5Gui.so /home/amit/fsl/lib/libQt5Network.so /home/amit/fsl/lib/libQt5Core.so -L/usr/lib64 -lGL -lpthread
EXIT: 1
STDERR:
/home/amit/fsl/bin/../lib/gcc/x86_64-conda-linux-gnu/11.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lGL: No such file or directory
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.

It’s not working.

Hi @math_priyanka,

OK, there are multiple issues going on, so there’s quite a bit to untangle. Please bear with me, I’ll try to work out what’s going on first, then we can look into how to get things working properly. I’ll go into a fair bit of detail in the hope that this also helps others who come across similar issues, but hopefully you won’t need to follow everything to get the point.


Issue 1: Unable to locate MRtrix3 Python modules

Your original issue relates to our Python handling. This is very unlikely to be anything that can be fixed by configure & build. To understand why, I’ll need to explain how the code is organised.

MRtrix consists of a collection of C++ & Python commands. C++ commands need to be compiled from the source code that we write, into binary (machine) code that the computer can execute. We use C++ for anything that requires high performance. The configure & build scripts relate exclusively to the process of compiling the C++ executables – they have no impact whatsoever on the Python commands.

The Python commands are simple Python scripts, which don’t need to be compiled. They are executed directly by the Python interpreter, which does the job of translating the instructions in the script on the fly (or at least, using just-in-time compilation behind the scenes). In MRtrix, these commands need to locate the Python libraries (modules), which contain common code to perform the various operations that these scripts require. These Python libraries are located in the lib/mrtrix3/ folder (you’re welcome to have a look).

The problem you’re having is that in your case, the mechanism that each Python command uses to locate the corresponding libraries is failing. We use a slightly unorthodox process to handle this aspect of things to ensure the correct version of the libraries/modules is used every time, using a Python module co-located with the commands in the bin/ folder, called mrtrix3.py. Its job is to look at where the command you’re trying to run is located (hopefully in your installation’s bin/ folder), and see if it can find the modules with the same version of the code in the lib/ folder, which it should find alongside the command’s bin/ folder. The message you’re seeing is precisely the error that this part of the code throws up when it can’t locate the expected modules.

What to do about it

I would start by investigating your installation and making sure that everything is as expected. First, where is the installation that you’re actually using:

which dwifslpreproc

This will hopefully print out the folder where it found the dwifslpreproc command. e.g. on my system, I get:

$ which dwifslpreproc 
/home/donald/mrtrix3/bin/dwifslpreproc

which tells me that my installation is located in /home/donald/mrtrix3/, and the command is indeed in the bin/ folder within that installation.

Next, change directory to your installation folder, and list the contents of the lib/mrtrix3/ folder. E.g. for my example above:

$ cd /home/donald/mrtrix3/
$ ls lib/mrtrix3/
_5ttgen        dwibiascorrect  __init__.pyc      __pycache__  _version.py
algorithm.py   dwinormalise    matrix.py         run.py       _version.pyc
algorithm.pyc  fsl.py          matrix.pyc        run.pyc
app.py         image.py        path.py           sh.py
app.pyc        image.pyc       path.pyc          utils.py
dwi2response   __init__.py     phaseencoding.py  utils.pyc

If you get a ‘file not found’ error, then your installation is not complete, or has somehow been corrupted. That folder must exist for the scripts to work.

If it does list the folder contents, but you don’t see at least the __init__.py file, then that would also lead to this kind of error (this file is how Python figures out that the entire folder is to be treated as a single Python module).

If everything checks out, and you do see the same folder contents as I do (you can ignore the .pyc files, by the way), then we’ll need to dig deeper. But assuming you do find this is the issue, then the next stage is to figure out what happened for you to end up with an incomplete installation. Maybe someone copied the MRtrix commands from the bin/ folder to a different location to make them available to everyone else, not realising that the presence of the associated lib/ (and share/) folders in the expected locations relative to these commands is important? If so, you can point them towards our documentation on deployment. But otherwise, you’ll have to work what happened from your side, and figure out whether this is something that can be fixed easily (e.g. you may just need to copy the lib/ folder over from where the code was originally compiled), or whether you really need to rebuild everything…


Issue 2: Failure to configure & build

Hopefully, the above will sort out your original issue. But it may be that you still need to rebuild to code for some other reason (or maybe you just want to). In this case, read on.

First off, it looks like when you start a terminal session, you’re running within an anaconda environment. While that’s not a problem when simply running MRtrix commands, it is a problem when trying to build MRtrix, because anaconda overrides the system compiler and tries to get the build to use the packages it provides, rather than the packages your Linux distribution (in your case, Ubuntu) provides for you. The issues with that is that it’s near-impossible to compile MRtrix with the anaconda packages, particularly the graphical apps (mrview, shview) – presumably because you have to use system packages to display anything (needs access to the specific drivers for your exact GPU hardware – not something anaconda can supply for everyone).

There’s an additional conflict with FSL, as it now provides a full-fledged installation of Qt5 (if someone can shed some light as to why, that would be most welcome…), and that also conflicts with your system packages.

I can see both of these issues happens when you try to configure: it’s trying to use the anaconda compiler:

Looking for compiler [g++]: g++ (conda-forge gcc 11.3.0-19) 11.3.0

and trying to compile against anaconda-supplied packages (note the location of these libraries is in your anaconda folder):

This also happens for libPNG and libTIFF.

You can see the conflict with FSL when it’s trying to find the Qt5 libraries (required for the graphical apps):

So as you can see, lots of reasons for conflicts. These are not things that we can control on user’s systems, by the way. Anaconda and FSL have both decided to override critical aspects of the environment in a way that will introduce deep conflicts of this type. I’m not convinced I understand the rationale for any of this, personally, but it is what it is, and we now have to deal with the consequences.

What to do about it

To avoid these conflicts, it should be sufficient to run a terminal session with no trace of either anaconda or FSL. Since these are typically imported into your terminal session when your startup files are read (when your shell starts up), the simplest way to avoid this is to start a bash session where we explicitly request that your startup files are not used. This is what this command does:

bash --noprofile --norc

Note that this has not impact on the Python module issue – that’s a different problem. This is purely to ensure our configure & build scripts don’t come into conflict with anaconda or FSL.

If that doesn’t work, an alternative is to modify your startup scripts (presumably ~/.bashrc and/or ~/.profile, but potentially also ~/.bash_profile – and others again if you don’t use the bash shell…), and comment out the lines responsible for setting up the anaconda and FSL environments. You should then be able to start a fresh terminal that is ‘unaware’ of these packages, and run the configure & build there. Once done, you can always undo the modifications to your startup scripts to recover your original environment.

Indeed, in one of your previous posts, it looks like the configure script managed to run to completion. As I’d noted in response to that post, this resulted in different versions of the packages being reported, notably Qt 5.5.0 rather than 5.15.6 as was the case previously. This is hopefully because the configure script found your system libraries (version 5.5.0), not the FSL-supplied ones. It also found your system compiler (g++ (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010), not the anaconda compiler (g++ (conda-forge gcc 11.3.0-19) 11.3.0).

I note that for some reason, it still found anaconda in the PATH, as reported in this warning:

which is disappointing – I wasn’t expecting to see any hint of it. But it looks like the rest of the configure script nonetheless managed to ignore it, so hopefully that was all that was needed.

I suggest you try again with that procedure, and keep going if there is no overt error. This should look like:

$ bash --noprofile --norc
$ cd mrtrix3      # <-- if needed
$ ./configure
$ ./build

If that still doesn’t work, feel free to report back with the full output of each command, and the full contents of the ./configure.log and ./build.log (if you got that far).

Hope this helps!
All the best,

Donald.

1 Like

I followed all your instructions. However, I encountered an issue while trying to remove the paths of FSL and Anaconda from source files. I disabled the paths in the source files located in ~/.bashrc , ~/.profile , and ~/.bash_profile . Despite this, there are still some files in the system that include references to FSL and Anaconda, and I am unable to locate these files.

Can you be more specific as to which ‘files in the system’ you’re referring to? What makes you think they include references to FSL or anaconda?

In general there are only a few environment variables that would influence the process. You can list their contents using the following commands – please post the full output here so we can inspect it:

echo $CC
echo $CXX
echo $PATH
echo $FSLDIR

If necessary, you can try to explicitly unset or modify these variables to something more appropriate. Something like this should do the trick:

unset CC CXX FSLDIR
export PATH=/usr/local/bin:/usr/bin

Try running these and then running the ./configure & ./build scripts in the same terminal.

Note that tweaking the PATH variable may result in things not working in your terminal. It’s nothing to worry about though, this will only impact things within that terminal session, none of these changes are persistent – if needed, just close that terminal and start again from a fresh one.

If setting the PATH doesn’t quite work, feel free to pick out parts of your PATH that might be relevant, and put something more appropriate instead. This is just a list of folder locations separated by colon (:) characters. For example, on my system, my regular PATH is:

$ echo $PATH
/home/donald/miniconda3/bin:/home/donald/mrtrix3/bin:/home/donald/exp/dev/bin:/home/donald/exp/mrpeek/bin:/home/donald/miniconda3/condabin:/home/jdt13/src/ants/bin:/home/donald/.gem/ruby/2.7.0/bin:/home/donald/mrtrix3/bin:/opt/fsl-6.0.4/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

We just want to remove any mention of anaconda, FSL or other potential conflicting packages, you can just edit that and paste it back in without those folders listed. For my example above, I may want to strip out:

  • anaconda: /home/donald/miniconda3/bin, /home/donald/miniconda3/condabin
  • FSL: /opt/fsl-6.0.4/bin
  • ANTs: /home/jdt13/src/ants/bin

So I could just copy/paste the above PATH and edit out those folders, to give something like:

export PATH=/home/donald/mrtrix3/bin:/home/donald/exp/dev/bin:/home/donald/exp/mrpeek/bin:/home/donald/.gem/ruby/2.7.0/bin:/home/donald/mrtrix3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

At this point, I should have a session that should behave as normal, but without the potential to run any commands from anaconda, FSL or ANTs.

Also: did you have a look at my instructions for issue 1 (unable to locate the python modules)? Maybe you can’t do that at the moment because your installation is no longer functional following your attempts at re-installing…?

I did as you said unset CC CXX FSLDIR
export PATH=/usr/local/bin:/usr/bin
Try running these and then running the ./configure & ./build scripts in the same terminal.

AND IT FINALLY RAN. oh my good!!
amit@amit-Precision-5820-Tower:~/Desktop/preproc/sub00$ dwifslpreproc -rpe_none -pe_dir j- sub_den_unr.mif sub_preproc.mif -eddy_options " --slm=linear --data_is_shelled"
dwifslpreproc:
dwifslpreproc: Note that this script makes use of commands / algorithms that have relevant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please consult the help page (-help option) for more information.
dwifslpreproc:
dwifslpreproc: Generated scratch directory: /home/amit/Desktop/preproc/sub00/dwifslpreproc-tmp-XPBP1W/

Thank you. Thank you very much for all your time and effort. Hope the unset of path woun’t affect other commands.

1 Like

Hello Donald
Does the path removal affect the ANTs installation? Now I am getting this error.

amit@amit-Precision-5820-Tower:~/Desktop/preproc/sub00$ dwibiascorrect -ants sub00_preproc.mif sub00_unbiased.mif -fslgrad $bvc $bvl

Error: argument algorithm: invalid choice: ‘sub00_preproc.mif’ (choose from ‘ants’, ‘fsl’)
Usage: dwibiascorrect algorithm [ options ] …
(Run dwibiascorrect -help for more information)

It shouldn’t affect anything once you start a fresh terminal. But in your case, the problem is simply that you have an extra dash – the command should be

dwibiascorrect ants ...

Not -ants

1 Like