gpusph
gpusph copied to clipboard
gcc can't compile AVX instructions for Chrono (error: ‘__m256d’ was not declared...)
/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.
I was getting the same error - so I manually added #undef CHRONO_HAS_AVX in ChMatrix.h to disable AVX manually
@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.)
Hi Ram,
Have you finally resolved your issue with Chrono?
Cheers, Agnès
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.
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 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 @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 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.