gpusph icon indicating copy to clipboard operation
gpusph copied to clipboard

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

Open Narcolessico opened this issue 8 years ago • 8 comments

/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.

Narcolessico avatar Oct 20 '16 10:10 Narcolessico

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

ramsampath avatar Oct 20 '17 01:10 ramsampath

@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.)

Oblomov avatar Oct 20 '17 05:10 Oblomov

Hi Ram,

Have you finally resolved your issue with Chrono?

Cheers, Agnès

agnesLeroy avatar Sep 20 '18 14:09 agnesLeroy

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.

Oblomov avatar Nov 08 '18 15:11 Oblomov

Hi I install chrono and have cmake successfully , and when make I got the error like this: [72%]Linking CXX executable ../../../../bin/utest_CH_ChCSMatrix /usr/bin/ld: cannot find -lgtest_main collect2:error : ld returned 1 exit status [make1]:***[src/tests/units_test/core/CMakeFiles/utest_CH_ChCSMatrix.dir/all] Error

If is there any error with the path? And if I compile the chrono successfully,how to add the path to the GPUSPH so that I can make a link with the two program.

Dongxueyang avatar Dec 24 '18 14:12 Dongxueyang

@Dongxueyang I'm afraid I can't help you with the issues you're having building Chrono, but after Chrono is built and installed correctly, you can set CHRONO_PATH in Makefile.local (if it's different from the default /usr/local)

Oblomov avatar Jan 18 '19 10:01 Oblomov

@Oblomov @agnesLeroy How can I make output from chrono,I want to get some results which is about the floationg bodies only. Or how to output a result file with vtk format which just include the information of floatings? All regards Dongxueyang

Dongxueyang avatar Jan 27 '19 03:01 Dongxueyang

@Dongxueyang GPUSPH currently only exports the moving object data in data/rbdata.txt, expressed as position of center of mass and quaternion rotations. These can be used to reconstruct the motion of the objects over time. Please open a separate issue if you'd prefer a different and/or more complete output.

Oblomov avatar Jan 30 '19 15:01 Oblomov