bugGNU Octave - Bugs: bug #46060, netcdf package: fails to build...


bug #46060: netcdf package: fails to build with octave built with --enable-64

Submitter:  John Donoghue <lostbard>
Submitted:  Sun 27 Sep 2015 01:33:52 PM UTC
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  lostbard Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Mon 02 May 2016 06:12:36 PM UTC, comment #11: 

Alright, looks to be fixed, closing.

Mike Miller <mtmiller>
Project Administrator
Mon 02 May 2016 04:46:20 PM UTC, comment #10: 

>> test_netcdf
Using NetCDF library version "4.3.2 of Apr  5 2016 13:49:54 $"
run test_netcdf_constant..............   OK
run test_netcdf_create................   OK
run test_netcdf_low_level_interface...   OK
run test_netcdf_unlim.................   OK
run test_netcdf_datatypes.............   OK
run test_netcdf_scalar_variable.......   OK
run test_netcdf_attributes............   OK
run test_netcdf_high_level_interface..   OK
run test_netcdf_ncwriteschema.........   OK
run test_netcdf_ncwriteschema_unlim...   OK
run test_netcdf_ncwriteschema_chunking   OK
run test_netcdf_ncwriteschema_group...   OK

John Donoghue <lostbard>
Project Member
Mon 02 May 2016 11:42:04 AM UTC, comment #9: 

try test_netcdf
(test are written to be matlab compatible)

Alexander Barth <abarth>
Tue 26 Apr 2016 08:18:45 PM UTC, comment #8: 

compiles for me, running tests on it:


  PASS         0
  FAIL         0

10 (of 10) .m files have no tests.

John Donoghue <lostbard>
Project Member
Tue 26 Apr 2016 04:41:02 PM UTC, comment #7: 

ok - will recompile

John Donoghue <lostbard>
Project Member
Tue 26 Apr 2016 11:48:39 AM UTC, comment #6: 

Thank you Mike for your very helpful comments.

John, can you try with the attached package (netcdf-1.0.10) to check if it solves the problem?

(file #36996)

Alexander Barth <abarth>
Mon 28 Mar 2016 10:10:27 PM UTC, comment #5: 

Actually the bug is that there actually is no constructor for octave_value with an Array<int>.

The only reason this has ever worked by accident is because there is a constructor for octave_value that takes an Array<octave_idx_type> which may be either a 32-bit or 64-bit integer. You should not rely on that to coincide with the type "int".

I am not at all familiar with the netcdf code or what the function is trying to return, but maybe use one of Octave's sized integer types instead?

At a glance it looks like you need to pass a pointer to the underlying array into the netcdf library. Maybe use an actual int array or vector, and have some conditional logic that says if sizeof(int) is not equal to sizeof(octave_int32) then copy the contents into an Array<octave_int64>?

Mike Miller <mtmiller>
Project Administrator
Tue 15 Mar 2016 10:06:36 AM UTC, comment #4: 

Thank you for testing. I filled a bug against octave since this is independent of the netcdf package.


I prefer not to use your workaround (using double) as it results in a lost of precision. If this is the only way, I will included it with CPP macros making it only active on windows.

Alexander Barth <abarth>
Wed 27 Jan 2016 01:13:56 PM UTC, comment #3: 

I get the same result as you do in comment #1 in both win32 and win64 versions of octave 4.0.1-rc3.

John Donoghue <lostbard>
Project Member
Wed 27 Jan 2016 09:23:26 AM UTC, comment #2: 

Using double for integer identifier is not an optimal solution. Maybe we can find something better.

Can you compile and run the attached code helloworld_con.cc on your system?

On my system:
mkoctfile helloworld_con.cc
octave --eval helloworld_con
ans =

  0  1  2

It makes the casting more explicit.

(file #36173)

Alexander Barth <abarth>
Wed 30 Sep 2015 12:08:26 PM UTC, comment #1: 

Pushed temporary fix to mxe-octave - http://hg.octave.org/mxe-octave/rev/85abb6c3ec8b

John Donoghue <lostbard>
Project Member
Sun 27 Sep 2015 01:33:52 PM UTC, original submission:  

Perhaps only a windows issue, when attempting to compile netcdf using mxe-octave built with the --enable-64 option, it fails to build with errors such as:

__netcdf__.cc: In function 'octave_value_list Fnetcdf_inqUnlimDims(const octave_value_list&, int)':
__netcdf__.cc:555:34: error: call of overloaded 'octave_value(Array<int>&)' is ambiguous
   return octave_value(unlimdimids);

The following patch works for me.

John Donoghue <lostbard>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #36996:  netcdf-1.0.10.tar.gz added by abarth (69KiB - application/gzip)
file #36173:  helloworld_con.cc added by abarth (282B - text/x-c++src)
file #34995:  of-netcdf-1-fixes.patch added by lostbard (2KiB - text/x-patch)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by abarth (Updated the item)
  • -email is unavailable- added by lostbard (Submitted the item)
  • -email is unavailable- added by lostbard

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.





    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-02 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-04-26 abarth Attached File- Added netcdf-1.0.10.tar.gz, #36996
    2016-03-28 mtmiller Operating SystemMicrosoft Windows Any
        Summary[octave forge] netcdf pacage fails to build with octave 32 built with --enable-64 netcdf package: fails to build with octave built with --enable-64
    2016-01-27 abarth Attached File- Added helloworld_con.cc, #36173
    2015-09-29 lostbard StatusNone Patch Submitted
    2015-09-27 lostbard Dependencies- bugs #43908 is dependent
    2015-09-27 lostbard Attached File- Added of-netcdf-1-fixes.patch, #34995
        Carbon-Copy- Added abarth

    Back to the top

    Powered by Savane 3.9