Closed spco closed 8 years ago
The code seems to be broken (abs() of an unsigned int?). Can you try if changing the locations to
std::abs(static_cast<int>(current_file_number) - first_data_file_number)
works?
On 02/08/2016 01:13 PM, Sam Cox wrote:
Lines 654 and 682 in |source/velocity_boundary_conditions/gplatescc| give the error |Call to abs() is ambiguous| and suggests candidate functions |abs(int)| in |/usr/include/stdlibh|, |abs( long x)| and |abs( long long x)| in |cstdlib|, and |abs(float lcpp_x)|, |abs(double __lcpp_x)|, and |abs(long double lcpp_x)| in |cmath|
Can you try and see whether this works if you write it as
std::abs(static_cast<int>(current_file_number - first_data_file_number))
in the two places?
Ah, I come to late I see...
It's also in line 676, I'd missed that. It compiles fine under @bangerth's suggestion - the brackets make a difference as @tjhei's gives the same errors. I haven't checked it with an example that uses GPlates, but it compiles and runs other examples fine.
Great. Do you think you can put this into a pull request?
Sure, I'll do that tomorrow (GMT). On 8 Feb 2016 11:03 pm, "Wolfgang Bangerth" notifications@github.com wrote:
Great. Do you think you can put this into a pull request?
— Reply to this email directly or view it on GitHub https://github.com/geodynamics/aspect/issues/746#issuecomment-181612282.
The new
GPlates::update()
commit https://github.com/geodynamics/aspect/commit/fb5b371f0b4f90389d50dfb1222a1d31c718e735 doesn't compile in Xcode.Lines 654 and 682 in
source/velocity_boundary_conditions/gplates.cc
give the errorCall to abs() is ambiguous
and suggests candidate functionsabs(int)
in/usr/include/stdlib.h
,abs( long __x)
andabs( long long __x)
incstdlib
, andabs(float __lcpp_x)
,abs(double __lcpp_x)
, andabs(long double __lcpp_x)
incmath
.Google suggests this is a known conflict between the headers, but I couldn't work out a immediate fix, as I expect several of these headers may already be in use in the include chain.
Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.3.0 Thread model: posix
OSX El Capitan 10.11.3 (15D21)
Xcode 7.2