dmalhotra / pvfmm

A parallel kernel-independent FMM library for particle and volume potentials
http://pvfmm.org
GNU Lesser General Public License v3.0
52 stars 29 forks source link

develop branch fails to build when USE_SSE is defined #4

Closed uranix closed 7 years ago

uranix commented 7 years ago

I've tried to compile the code using g++ (Debian 6.3.0-6), but it failed when USE_SSE variable was defined with the following message

In file included from /home/uranix/pvfmm-dev/include/kernel.hpp:202:0,
                 from /home/uranix/pvfmm-dev/include/cheb_utils.hpp:12,
                 from /home/uranix/pvfmm-dev/src/cheb_utils.cpp:8:
/home/uranix/pvfmm-dev/include/kernel.txx: In function ‘void pvfmm::{anonymous}::stokesStressSSE(int, int, const double*, const double*, const double*, const double*, const double*, const double*, const double*, double*)’:
/home/uranix/pvfmm-dev/include/kernel.txx:2043:32: error: ‘T’ was not declared in this scope
         double r = pvfmm::sqrt<T>(r2);
                                ^
/home/uranix/pvfmm-dev/include/kernel.txx:2043:37: error: no matching function for call to ‘sqrt(double&)’
         double r = pvfmm::sqrt<T>(r2);
                                     ^
In file included from /home/uranix/pvfmm-dev/include/pvfmm_common.hpp:62:0,
                 from /home/uranix/pvfmm-dev/include/cheb_utils.hpp:10,
                 from /home/uranix/pvfmm-dev/src/cheb_utils.cpp:8:
/home/uranix/pvfmm-dev/include/math_utils.hpp:29:15: note: candidate: template<class Real_t> Real_t pvfmm::sqrt(Real_t)
 inline Real_t sqrt(const Real_t a){return ::sqrt(a);}

It looks like T was a template argument, but T was later hardcoded to be double.

dmalhotra commented 7 years ago

Thanks for reporting the issue. I have fixed the bug.

Also note that USE_SSE is no longer required and vectorization must now be enabled using -msse4 or -mavx flags.