ecmwf / fckit

A Fortran toolkit for interoperating Fortran with C/C++
https://confluence.ecmwf.int/display/fckit
Apache License 2.0
29 stars 15 forks source link

Some fixes to enable compilation with NAG compiler #33

Closed DJDavies2 closed 3 months ago

DJDavies2 commented 7 months ago

What happened?

fckit doesn't currently compile with NAG.

There are several issues, I have a PR with some of the simpler fixes.

What are the steps to reproduce the bug?

Trying to build with NAG

Version

develop

Platform (OS and architecture)

Linux

Relevant log output

No response

Accompanying data

No response

Organisation

Met Office

wdeconinck commented 7 months ago

Hi @DJDavies2 I have merged your PR #34. Are there more fixes required to make to work with NAG? If not, please close the issue.

DJDavies2 commented 7 months ago

There are other issues but they are more difficult. Do you want me to keep using this issue or close this and create another one?

wdeconinck commented 7 months ago

You can reuse this one. If the problem relates to the fckit_shared_object and related types, know that I am preparing a refactoring of this very soon.

DJDavies2 commented 7 months ago

This is the error that I can't easily get around:

Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 117: Multiply defined symbol FUNPTR detected at ::@FUNPTR Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 117: FUNPTR is not a procedure name detected at FUNPTR@ Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 118: Implicit type for FUNPTR detected at FUNPTR@=> Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 119: Implicit type for FCKIT_EXTERNAL Warning: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 119: Result FUNPTR of function FCKIT_EXTERNAL has not been assigned a value Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 140: Multiply defined symbol FUNPTR detected at ::@FUNPTR Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 140: FUNPTR is not a procedure name detected at FUNPTR@ Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 141: Implicit type for FUNPTR detected at FUNPTR@=> Error: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 142: Implicit type for FCKIT_OWNED Warning: /home/h01/frwd/cylc-run/mi-be984/work/1/git_clone_fckit/fckit/src/fckit/module/fckit_refcount.F90, line 142: Result FUNPTR of function FCKIT_OWNED has not been assigned a value

So yes, I think this is related to the shared_object stuff. I can get around it and progress with downstream packages by commenting out chunks of fckit code in fckit_refcount, fckit_shared_object and fckit_shared_ptr; it seems that this stuff isn't really used. However I can't find a way of re-writing this stuff to make it work. I think NAG has a bug with this, I am using 7.0.0.

wdeconinck commented 3 months ago

Does #43 fix the remaining issues here?

DJDavies2 commented 3 months ago

Yes, thanks, all working now.