Unable to determine pointer size

Hi, I’m getting this error when I try and configure MRtrix3

qbi-gorman:mrtrix3 s4398924$ ./configure

MRtrix build type requested: release

Detecting OS: darwin
OS X deployment target: 10.12
Looking for compiler [clang++]: Apple LLVM version 9.0.0 (clang-900.0.37)
Checking for C++11 compliance: ok
Checking shared library generation: ok
Detecting pointer size: 
ERROR: unable to determine pointer size!

  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.

I installed using homebrew if that helps.

Cheers,
Ben

Also, this was the contents of the configure.log file

REPORT: 
MRtrix build type requested:

REPORT: release

REPORT: 

REPORT: Detecting OS: darwin
EXEC <<
CMD: sw_vers -productVersion
EXIT: 0
STDOUT:
10.12.6
>>


REPORT: OS X deployment target: 10.12

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


REPORT: Apple LLVM version 9.0.0 (clang-900.0.37)

REPORT: Checking for C++11 compliance:

COMPILE /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmp40GMy_.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_MACOSX -fPIC -mmacosx-version-min=10.12 /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmp40GMy_.cpp -o /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmp40GMy_.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmp40GMy_.o -mmacosx-version-min=10.12 -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_MACOSX -fPIC -mmacosx-version-min=10.12 /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpWOEF1t.cpp -o /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpWOEF1t.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpWOEF1t.o -dynamiclib -install_name @rpath/LIBNAME -mmacosx-version-min=10.12 -mmacosx-version-min=10.12 -o libtest.dylib
EXIT: 0
>>


REPORT: ok

REPORT: Detecting pointer size:

COMPILE /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.cpp:
---

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

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.12 /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.cpp -o /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.o
EXIT: 1
STDERR:
In file included from /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:215:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:90:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:133:77: error: use of undeclared identifier 'wcschr'
wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcschr(__s, __c);}
                                                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:140:87: error: use of undeclared identifier 'wcspbrk'
wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcspbrk(__s1, __s2);}
                                                                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:147:78: error: use of undeclared identifier 'wcsrchr'; did you mean 'wcschr'?
wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcsrchr(__s, __c);}
                                                                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:135:16: note: 'wcschr' declared here
const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:154:86: error: use of undeclared identifier 'wcsstr'; did you mean 'wcschr'?
wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
                                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:137:16: note: 'wcschr' declared here
      wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:154:86: error: no matching function for call to 'wcschr'
wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
                                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:137:16: note: candidate disabled: <no message provided>
      wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:154:93: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'const wchar_t *'
wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
                                                                                            ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:137:38: note: passing argument to parameter '__s' here
      wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:161:60: error: unknown type name 'size_t'
wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return (wchar_t*)wmemchr(__s, __c, __n);}
                                                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:163:57: error: unknown type name 'size_t'
const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
                                                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:165:57: error: unknown type name 'size_t'
      wchar_t* wmemchr(      wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
                                                        ^
In file included from /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:215:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:176:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t>    streampos;
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:177:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t>    wstreampos;
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:179:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t>    u16streampos;
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:180:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t>    u32streampos;
             ^
In file included from /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:470:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:171:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:638:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:74:64: error: use of undeclared identifier 'strchr'
char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}
                                                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:81:75: error: use of undeclared identifier 'strpbrk'
char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}
                                                                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:88:65: error: use of undeclared identifier 'strrchr'; did you mean 'strchr'?
char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}
                                                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:76:13: note: 'strchr' declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:95:76: error: use of undeclared identifier 'memchr'; did you mean 'wmemchr'?
void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}
                                                                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:163:16: note: 'wmemchr' declared here
const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
               ^
In file included from /var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:470:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:171:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:638:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:102:74: error: use of undeclared identifier 'strstr'; did you mean 'strchr'?
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
                                                                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:78:13: note: 'strchr' declared here
      char* strchr(      char* __s, int __c) {return __libcpp_strchr(__s, __c);}
            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:102:74: error: no matching function for call to 'strchr'
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
                                                                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:78:13: note: candidate disabled: <no message provided>
      char* strchr(      char* __s, int __c) {return __libcpp_strchr(__s, __c);}
            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
>>

error deleting temporary file "/var/folders/xm/01whb43d09dfb8d2qr7qq7bm0000gq/T/tmpoRN0yn.o": No such file or directory
ERROR: unable to determine pointer size!

  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.

Can you clarify what you installed using homebrew? You seem to install mrtrix3 the manual way. If you want to try installing mrtrix3 using homebrew, follow the instructions in the blue box in the docs.

I’ve just tested it on my mac with the latest XCode and the master branch everything compiles fine. I’d suggest trying to install mrtrix3 via homebrew and report back to us if it doesn’t solve your problem.

I don’t know why you get the error error: use of undeclared identifier 'wcschr'. @jdtournier Any idea?

Cheers,
Max

Not really… These types of issues tend to pop up when mixing different compilers, etc. One potential candidate here might be a conflict between the version of clang++ supplied through XCode, and other compilers installed via other routes like homebrew or macports. @ben.gorman96, did you install clang++ via homebrew, in addition to XCode, by any chance…?

Also, the version of clang++ reported seems unusual. @maxpietsch, what does ./configure report at this stage on you system?

 Looking for compiler [clang++]: Apple LLVM version 9.0.0 (clang-900.0.37)

Yes, thought so too. That’s why I suggested to install it via the homebrew formula. @ben.gorman96 The homebrew package containing clang++ might be called llvm.

Same, that is the latest version shipped with XCode.

All good, thanks guys, I just had to update my iOS and it configured fine