Hi Steve.
Sorry for not getting back to you sooner, I was off on a training
course for most of last week.
It appears to be an issue for the Sun C++ compiler. The C compiler
only provides one implementation of sqrt and pow (using a double), but
the C++ compiler also provides a float version in the std namespace
(though you are not explicitly using it, so I'm not sure why the
compiler is trying to). We've found a few other places with all of the
packages installed where this occurs:
These are all ambiguities between fabs(double) and std::fabs(float)
compute_ke_atom_eff.cpp: 99
compute_ke_eff.cpp: 74
compute_temp_deform_eff.cpp: 111,162,213
compute_temp_eff.cpp: 82, 116, 155
compute_temp_region_eff.cpp: 118,131,177
fix_nh_eff.cpp: 61, 88, 109
fix_nve_eff.cpp: 100, 135
fix_nvt_sllod_eff.cpp: 124
The example below compiles fine with the suncc compiler but complains
with the sunCC (C++) compiler as shown below.
#include "math.h"
#include "stdio.h"
int main()
{
printf("sqrt(2) = %f\n", sqrt(2));
printf("pow(2, 2) = %f\n", pow(2, 2));
}
compiles fine with suncc but fails to compile with sunCC
Same errors:
"lammps-sun.c", line 7: Error: Overloading ambiguity between
"sqrt(double)" and "std::sqrt(float)".
"lammps-sun.c", line 8: Error: Overloading ambiguity between
"std::pow(double, int)" and "std::pow(long double, int)".
2 Error(s) detected.