Starting from Intel(R) C++ Compiler 18.0, Intel's "math.h" will only contain functions required in C99/C11 standard. For non-standard math functions include invsqrt, invsqrtf, invsqrtl, they have been moved to Intel specific math header "mathimf.h".
Developers who have called those non-standard functions from "math.h" in previous versions, will encounter compiler errors like following after upgrade to 18.0:
../pair_tersoff_intel.cpp(1375): error: no instance of overloaded function "invsqrt" matches the argument list argument types are: (float) fvec rikinv = invsqrt(rsq2); ^
There are two ways to resolve the compiler errors:
1. Change to include "mathimf.h" for Intel Compiler.
#ifdef __INTEL_COMPILER #include <mathimf.h> #endif
2. Declare those functions by yourself. For example, for C++ code, declare:
extern double invsqrt(double __x); extern float invsqrtf(float __x);
Then compile and link with icc to link with Intel(R) Math Library.