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: adrpo
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 Changed 8 years ago by m.thorade@…

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

comment:2 Changed 8 years ago by janK

Regarding your last note, please see #4323.

comment:3 Changed 7 years ago by tbc@…

Any feedback?

comment:4 Changed 7 years ago by anonymous

The FullAPI example now also fails on Linux.

comment:5 Changed 7 years ago by adrpo

  • Owner changed from somebody to adrpo
  • Status changed from new to accepted

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 follow-up: Changed 7 years ago by tbc@…

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

comment:7 in reply to: ↑ 6 Changed 7 years ago by adrpo

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 Changed 7 years ago by anonymous

Is there a way around that we can use meanwhile?

comment:9 Changed 6 years ago by sullivbj@…

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

comment:10 Changed 6 years ago by Matthis

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 Changed 6 years ago by sullivbj@…

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.