Error build MRTRIX3 during installation on Linux

I have been trying to download MRTRIX3 on Oracle VM VirtualBox (Linux), everything is fine until I get to ./build, Usually around package 277, always regarding initialiser_helpers.o :

ERROR: (277/506) [CC] tmp/cmd/mrregister.o

g++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -pthread -fPIC -DMRTRIX_WORD64 -DMRTRIX_TIFF_SUPPORT -idirafter /usr/include/x86_64-linux-gnu -DEIGEN_FFTW_DEFAULT -Wall -O3 -DNDEBUG -Isrc -I./core -Icmd -idirafter /usr/include/eigen3 -DEIGEN_DONT_PARALLELIZE cmd/mrregister.cpp -o tmp/cmd/mrregister.o

failed with output

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.

I’ve tried this on 2-3 different computers with the same error.

Help greatly appreciated!

I suspect you are running out of RAM (see here). If you have at least 1.7GB free RAM, you might be lucky with a single-threaded build: NUMBER_OF_PROCESSORS=1 ./build. If you do not have that much memory, you can build individual executables with

export NUMBER_OF_PROCESSORS=1
for f in cmd/*.cpp; do echo ./build $(basename ${f%%.cpp}); done

but you’ll miss out on some of the functionality and scripts might break (such as population_tempalte).

On the off-chance that the issue wasn’t about running out of RAM:

Can you provide more information about your compiler and the specific version of Eigen you’re using? If you post the contents of your config file (in your MRtrix3 folder), it should contain all the relevant information.

Can I also confirm that all the different computers you’ve tried this on are all running the same Linux version? It’s not unlikely that the specific version of GCC5 included in that version might have an obscure bug that our code happens to trigger – it wouldn’t be the first time.

One way around this bug might simply be to install clang if it’s available for the specific Linux distribution you’re using. If you do that and re-run ./configure, it should detect clang++ first and use that in preference to g++. This might be sufficient to allow it to compile and run successfully.

Thank you very much !