ERROR: error compiling Eigen3 application! for MAC

Hello

I’ve got some issues in configuring mrTRIX3

First point to note is that you’re using a separate project, independent of MRtrix3, which we don’t provide support for. We would generally suggest you install an official release of MRtrix3 before investigating.

Nonetheless, I think in your case the issue is likely to be simply that the dash you used in the EIGEN_CFLAGS="–isystem ..." variable is a long em-dash, rather than the regular hyphen “-” (there are many dashes in Unicode, but only the ASCII hyphen / minus sign would be recognised as such). I suspect you may have copy/pasted that bit from a Word document or similar, which often decides to ‘upgrade’ hyphen to long dashes. – see e.g. this post for details.

To fix this, simply pull up that command again, and edit it to replace the dash with a minus sign that you’ve typed in from the keyboard. Hopefully that’ll be all that’s required here…

Sorry, but I used the regular hyphen. Quite sure about that, since I put the long em-dash and it gave me another error. I include the configure.log below

thank you

REPORT: 
MRtrix build type requested: release version
PATH set to: /usr/local/opt/qt5/bin:/usr/local/fsl/bin:/Applications/freesurfer/bin:/Applications/freesurfer/fsfast/bin:/usr/local/fsl/bin:/Applications/freesurfer/mni/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/opt/X11/bin:/Library/Apple/usr/binEXEC <<
CMD: sw_vers -productVersion
EXIT: 0
STDOUT:
10.15.7
>>


REPORT: OS X deployment target: 10.15

REPORT: Detecting OS: darwin

REPORT: Looking for compiler [clang++]:
EXEC <<
CMD: clang++ --version
EXIT: 0
STDOUT:
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
>>


REPORT: Apple clang version 12.0.0 (clang-1200.0.32.27)

REPORT: Checking for C++11 compliance:

COMPILE /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpXhqNP1.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" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpXhqNP1.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpXhqNP1.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpXhqNP1.o -mmacosx-version-min=10.15 -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" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp9WhZbC.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp9WhZbC.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp9WhZbC.o -dynamiclib -install_name @rpath/LIBNAME -mmacosx-version-min=10.15 -o libtest.dylib
EXIT: 0
>>


REPORT: ok

REPORT: Detecting pointer size:

COMPILE /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpdpGHPl.cpp:
---

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

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpdpGHPl.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpdpGHPl.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpdpGHPl.o -mmacosx-version-min=10.15 -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 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpr7PjAW.cpp:
---

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

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_BUILD_TYPE="release version" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 -DMRTRIX_WORD64 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpr7PjAW.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpr7PjAW.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpr7PjAW.o -mmacosx-version-min=10.15 -o a.out
EXIT: 0
>>

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


REPORT: ok

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

COMPILE /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp4p8ybj.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" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 -DMRTRIX_WORD64 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp4p8ybj.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp4p8ybj.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp4p8ybj.o -mmacosx-version-min=10.15 -o a.out
EXIT: 0
>>

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


REPORT: ok

REPORT: Checking for ::max_align_t:

COMPILE /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp39EtFq.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" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 -DMRTRIX_WORD64 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp39EtFq.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp39EtFq.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp39EtFq.o -mmacosx-version-min=10.15 -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 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp1KaiQB.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" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 -DMRTRIX_WORD64 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp1KaiQB.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp1KaiQB.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmp1KaiQB.o -mmacosx-version-min=10.15 -o a.out
EXIT: 0
>>

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


REPORT: 16 bytes
EXEC <<
CMD: pkg-config --cflags eigen3
error invoking command "pkg-config": No such file or directory
>>

error running "pkg-config --cflags eigen3"


REPORT: Checking for Eigen3 library:

COMPILE /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpIeyqtS.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" -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.15 -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpIeyqtS.cpp -o /var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpIeyqtS.o
EXIT: 1
STDERR:
/var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpIeyqtS.cpp:3:10: fatal error: 'Eigen/Core' file not found
#include <Eigen/Core>
         ^~~~~~~~~~~~
1 error generated.
>>

error deleting temporary file "/var/folders/0m/tmqq9pfn2b779fm1tynttqdw0000gn/T/tmpIeyqtS.o": No such file or directory
ERROR: error compiling Eigen3 application!

    MRtrix3 was unable to compile a test program involving Eigen3.

  Set the EIGEN_CFLAGS environment variable to inform 'configure' of
  the flags it must provide to the compiler in order to compile
  programs that use Eigen3 functionality; this may include the path to
  the Eigen3 include files, as well as any required flags.
  For example:
    $ export EIGEN_CFLAGS="-isystem /usr/include/eigen3"
    $./configure
  (amend with the actual path to the Eigen3 include files on your system)

Is Eigen3 located in /usr/include/eigen3 or did you add that because of the example in the error message?

If you don’t have eigen and use homebrew, I’d suggest you install eigen via brew install eigen. You can find out the location with brew info eigen and set the environment variable with
EIGEN_CFLAGS="-isystem /usr/local/Cellar/eigen/3.3.9/include/eigen3" ./configure.

Alternatively, we provide a homebrew package that installs dependencies and binary releases that don’t require compilation.

1 Like

Thank you, resolved!

How to resolve?

Can you be more specific as to what the problem is that you’re trying to resolve? We typically need at the very least the exact commands that you’re tried (all of them, and in the right order), and all of the associated terminal output. If the terminal output mentions looking at a log file (either configure.log or build.log), we would need to see that too. If you can post that information, we’ll take a look and help you through this.

Donald.