Opened 8 years ago

Last modified 6 years ago

#4356 accepted defect

netCDF reader works on Linux, not on Windows

Reported by: m.thorade@… Owned by: Adrian Pop
Priority: normal Milestone: Future
Component: *unknown* Version: v1.12.0
Keywords: netCDF Cc:

Description

More or less a copy of this issue:
https://github.com/tbeu/netCDF-DataReader/issues/6
Not sure whether this has to be fixed on OM side or in the library, one of the two issues can be closed.

The netCDF library comes with three examples, all three work on Linux, but fail on Windows.
Tested with Windows 10 64 bit, OM 1.11 32 bit release and OM 1.12 64 bit nightly.

For the Simple example the error is:

[3] 10:30:07 Fehler
Failed to write to file (not open)

[4] 10:30:07 Übersetzung Fehler
Template error: A template call failed (a call with 0 parameters: dladdr failed: not available on Windows). One possible reason could be that a template imported function call failed (which should not happen for functions called from within template code; templates preserve pure 'match'/non-failing semantics).

For the other two examples, the error is:

NMAKE : fatal error U1077: "cl": R�ckgabe-Code "0x2"
Stop.
Compilation process failed. Exited with code 2.

The full log is pasted here: http://pastebin.com/3k3e7LMB

Side note:
There seems to be some encoding wrong with the word R�ckgabe

Change History (11)

comment:1 by m.thorade@…, 8 years ago

I forgot: On windows, I tested gcc, msvc13 and msvc15.

comment:2 by Jan Kokert, 8 years ago

Regarding your last note, please see #4323.

comment:3 by tbc@…, 7 years ago

Any feedback?

comment:4 by anonymous, 7 years ago

The FullAPI example now also fails on Linux.

comment:5 by Adrian Pop, 7 years ago

Owner: changed from somebody to Adrian Pop
Status: newaccepted

On Windows we will need to:

  • install the libnetcdf-dev library for gcc in msys2 shipped with the OM installation
  • compile the libnetcdf library for msvc13, and add it to the OM installation together with the include headers

comment:6 by tbc@…, 7 years ago

What, if I would load the functions from netcdf.dll at runtime on Win. This would avoid your build and install trouble, right?

in reply to:  6 comment:7 by Adrian Pop, 7 years ago

Replying to tbc@…:

What, if I would load the functions from netcdf.dll at runtime on Win. This would avoid your build and install trouble, right?

I think that would work, however one might have issues with the different runtimes one of the process and the other one from the dll. However, if you don't send pointers through the C interface I think it should be fine.

comment:8 by anonymous, 7 years ago

Is there a way around that we can use meanwhile?

comment:9 by sullivbj@…, 6 years ago

any updates on this error? I still can't get the ncDataReader2 example files to run in OpenModelica

comment:10 by Matthis, 6 years ago

sullivbj, could you please specify your Windows version, 32/64bit, OpenModelica version, gcc version, and explain waht steps you tried (in sufficient detail to reproduce) and what error you are seeing?

comment:11 by sullivbj@…, 6 years ago

System: Microsoft Windows 10 Home x64
Software: OMEdit v1.13.0-dev (64 bit)
Not sure how to check GCC version sorry

Steps to error

  1. I open the Simple example file (NcDataReader2.Examples.Simple).
  2. I attempt to run the example file using the simulate button.

Error information
The code compiles and the simulation output opens.
Some compiler output appears then red text appears saying "Warning: corrupt .drectve at end of def file".
Then a larger wall of text appears saying "undefined reference to 'security_check_cookie'" and "undefined reference to 'GSHandlerCheck'"

Let me know what you think or if you need any more information. Thanks for the reply.

Note: See TracTickets for help on using tickets.