help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem building netcdf-1.0.0 on Mac OS 10.8 using recent compilers.


From: Alexander Hansen
Subject: Re: Problem building netcdf-1.0.0 on Mac OS 10.8 using recent compilers.
Date: Tue, 27 Aug 2013 16:24:51 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

On 8/27/13 1:20 PM, Alexander Barth wrote:



On Mon, Aug 26, 2013 at 6:23 PM, Alexander Hansen
<address@hidden <mailto:address@hidden>> wrote:

    Hi.

    I'm getting pretty much the same error when I use any of the
    following compilers that are available to Fink users on OS 10.8 to
    install the netcdf package:

    Apple's clang:
      clang --version
    Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)

    Apple's llvm-gcc:
    $ llvm-gcc-4.2 --version
    i686-apple-darwin11-llvm-gcc-__4.2 (GCC) 4.2.1 (Based on Apple Inc.
    build 5658) (LLVM build 2336.11.00)

    FSF gcc 4.7.3 or 4.8.1 (we have earlier gcc's for prior OS versions,
    but I'd like to be able to put out a package that works on 10.8)

    The failure is as follows (slightly re-ordered):

    mkoctfile __netcdf__.cc -L/sw/lib -lnetcdf

    __netcdf__.cc:112:15: error: ambiguous conversion for C-style cast from
           'octave_int<unsigned long long>' to 'size_t' (aka 'unsigned
    long')
               start[i] = (size_t)tmp(ndims-i-1);
                          ^~~~~~~~~~~~~~~~~~~~~~
    /sw/include/octave-3.6.4/__octave/oct-inttypes.h:777:3: note:
    candidate function
       operator T (void) const { return value (); }
       ^
    /sw/include/octave-3.6.4/__octave/oct-inttypes.h:781:3: note:
    candidate function
       operator double (void) const { return double_value (); }
       ^
    /sw/include/octave-3.6.4/__octave/oct-inttypes.h:783:3: note:
    candidate function
       operator float (void) const { return float_value (); }
       ^

I should have added the next couple of errors:

__netcdf__.cc:135:15: error: ambiguous conversion for C-style cast from
      'octave_int<unsigned long long>' to 'size_t' (aka 'unsigned long')
          count[i] = (size_t)tmp(ndims-i-1);
                     ^~~~~~~~~~~~~~~~~~~~~~
/sw/include/octave-3.6.4/octave/oct-inttypes.h:777:3: note: candidate function
  operator T (void) const { return value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:781:3: note: candidate function
  operator double (void) const { return double_value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:783:3: note: candidate function
  operator float (void) const { return float_value (); }
  ^
__netcdf__.cc:156:16: error: ambiguous conversion for C-style cast from
      'octave_int<long long>' to 'ptrdiff_t' (aka 'long')
          stride[i] = (ptrdiff_t)tmp(ndims-i-1);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/sw/include/octave-3.6.4/octave/oct-inttypes.h:777:3: note: candidate function
  operator T (void) const { return value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:781:3: note: candidate function
  operator double (void) const { return double_value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:783:3: note: candidate function
  operator float (void) const { return float_value (); }
  ^
3 errors generated.




    ...

    Any thoughts on a workaround?



Hi,

Does it work if you simply use

start[i] = tmp(ndims-i-1);

instead of

start[i] = (size_t)tmp(ndims-i-1);

at line 112 of __netcdf__.cc.

Cheers,
Alex


Thanks for the reply.

Unfortunately it looks like more tweaking will be needed. When I removed the (size_t) at line 112, I got the following:

__netcdf__.cc:112:15: error: conversion from 'octave_int<unsigned long long>' to
      'size_t' (aka 'unsigned long') is ambiguous
          start[i] = tmp(ndims-i-1);
                     ^~~~~~~~~~~~~~
/sw/include/octave-3.6.4/octave/oct-inttypes.h:777:3: note: candidate function
  operator T (void) const { return value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:781:3: note: candidate function
  operator double (void) const { return double_value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:783:3: note: candidate function
  operator float (void) const { return float_value (); }
  ^
__netcdf__.cc:112:13: error: assigning to 'size_t' (aka 'unsigned long') from
      incompatible type 'octave_int<unsigned long long>'
          start[i] = tmp(ndims-i-1);
__netcdf__.cc:135:15: error: conversion from 'octave_int<unsigned long long>' to
      'size_t' (aka 'unsigned long') is ambiguous
          count[i] = tmp(ndims-i-1);
                     ^~~~~~~~~~~~~~
/sw/include/octave-3.6.4/octave/oct-inttypes.h:777:3: note: candidate function
  operator T (void) const { return value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:781:3: note: candidate function
  operator double (void) const { return double_value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:783:3: note: candidate function
  operator float (void) const { return float_value (); }
  ^
__netcdf__.cc:135:13: error: assigning to 'size_t' (aka 'unsigned long') from
      incompatible type 'octave_int<unsigned long long>'
          count[i] = tmp(ndims-i-1);
                   ^ ~~~~~~~~~~~~~~
__netcdf__.cc:156:16: error: ambiguous conversion for C-style cast from
      'octave_int<long long>' to 'ptrdiff_t' (aka 'long')
          stride[i] = (ptrdiff_t)tmp(ndims-i-1);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/sw/include/octave-3.6.4/octave/oct-inttypes.h:777:3: note: candidate function
  operator T (void) const { return value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:781:3: note: candidate function
  operator double (void) const { return double_value (); }
  ^
/sw/include/octave-3.6.4/octave/oct-inttypes.h:783:3: note: candidate function
  operator float (void) const { return float_value (); }
  ^
5 errors generated.

--
Alexander Hansen, Ph.D.
Fink User Liaison
My package updates: http://finkakh.wordpress.com/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]