Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing ITensor with g++ and Accelerate on macos fails #328

Open
mtfishman opened this issue Feb 10, 2020 · 2 comments
Open

Installing ITensor with g++ and Accelerate on macos fails #328

mtfishman opened this issue Feb 10, 2020 · 2 comments

Comments

@mtfishman
Copy link
Member

Installing ITensor with g++ and Accelerate on macos fails. This was pointed out by Daniel, and I just reproduced it. Normally, g++ is just an alias clang++, but if I explicitly install g++ (for example with Homebrew), and then try to compile ITensor with that g++ compiler and Accelerate, then the ITensor build process fails at lapack_wrap.cc with errors like:

Compiling itensor/tensor/lapack_wrap.cc with optimizations
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Headers/../Frameworks/vecLib.framework/Headers/vecLib.h:25,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h:20,
                 from /Users/mfishman/software/itensor/itensor/tensor/lapack_wrap.h:84,
                 from tensor/lapack_wrap.cc:16:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h: In function 'vUInt16 vU16HalfMultiply(vUInt16, vUInt16)':
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h:379:84: note: use '-flax-vector-conversions' to permit conversions between vectors with differing element types or numbers of subparts
  379 |   vUInt16   __vbasicops_vB) { return _mm_mullo_epi16(__vbasicops_vA, __vbasicops_vB); }
      |                                                                                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h:379:54: error: cannot convert 'vUInt16' {aka '__vector(8) short unsigned int'} to '__m128i' {aka '__vector(2) long long int'}
  379 |   vUInt16   __vbasicops_vB) { return _mm_mullo_epi16(__vbasicops_vA, __vbasicops_vB); }
      |                                                      ^~~~~~~~~~~~~~
      |                                                      |
      |                                                      vUInt16 {aka __vector(8) short unsigned int}
In file included from /usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/include/xmmintrin.h:1255,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h:92,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Headers/../Frameworks/vecLib.framework/Headers/vecLib.h:21,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h:20,
                 from /Users/mfishman/software/itensor/itensor/tensor/lapack_wrap.h:84,
                 from tensor/lapack_wrap.cc:16:
...

Maybe Accelerate uses features that are not available in g++? It may be a more fundamental problem, but if so we may want to point this out in the installation instructions to warn people about trying this combination.

@mtfishman
Copy link
Member Author

Just to confirm, compiling ITensor with g++ and openblas on macos works for me, so this is an Accelerate specific problem.

@XiaoTailong
Copy link

g++ with openblas and clang++ with (macos) Accelerate framework. Match is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants