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

gcc can't compile AVX instructions for Chrono (error: ‘__m256d’ was not declared...) #19

Narcolessico opened this Issue Oct 20, 2016 · 4 comments


None yet
4 participants

Narcolessico commented Oct 20, 2016

/usr/local/include/chrono/core/ChMatrix.h: In member function ‘void chrono::ChMatrix<Real>::MatrMultiplyAVX(const chrono::ChMatrix<double>&, co     nst chrono::ChMatrix<double>&)’:
/usr/local/include/chrono/core/ChMatrix.h:558:17: error: ‘__m256d’ was not declared in this scope
                 __m256d sum = _mm256_setzero_pd();

Reported by 2 users, gcc 4.6 and gcc 4.8.4, latest Chrono and GPUSPH.

Workaround: add CXXFLAGS+=-march=native to Makefile.local. The cause might be a missing include in Chrono sources and does not happen with gcc 4.9.


This comment has been minimized.

ramsampath commented Oct 20, 2017

I was getting the same error - so I manually added
#undef CHRONO_HAS_AVX in ChMatrix.h to disable AVX manually


This comment has been minimized.


Oblomov commented Oct 20, 2017

@ramsampath what happens if instead of undef'ing CHRONO_HAS_AVX you add -march=native to the GPUSPH CXXFLAGS?

(To clarify, the native arch workaround should work. We will probably add it by default for GPUSPH —even though the host code isn't considered that performance critical.)


This comment has been minimized.


agnesLeroy commented Sep 20, 2018

Hi Ram,

Have you finally resolved your issue with Chrono?



This comment has been minimized.


Oblomov commented Nov 8, 2018

Hm, the issue isn't in Chrono per se, but rather in a combination of CUDA version, compiler, and options used to build Chrono. Maybe we should look into a way to detect this during build time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment