[ncl-talk] Unable to link to Fortran shared object created with WRAPIT

Michael Toy toy at ucar.edu
Fri May 11 15:47:31 MDT 2018


Hello,

I am trying to call a fortran subroutine from an NCL script, and have followed the documentation for “WRAPIT”.  This is my first time trying it.  When I enter the following in NCL:
ncl 0> external MLT “./mult.so"

I get the error message:
warning:An error occurred loading the external file ./mult.so, file not loaded
./mult.so: undefined symbol: mult_
warning:error at line 0


I’m testing a simple subroutine which multiplies two numbers together.  My Fortran 90 code (mult.f90) is:

module module_mult

contains

subroutine mult(x,y,z)

implicit none

real, intent(in) :: x,y
real, intent(out) :: z

z = x*y

end subroutine mult

end module module_mult


My “stub” file is:
C NCLFORTSTART
      subroutine mult(x,y,z)
      real x,y,z
C NCLEND


When I run “WRAPIT mult.stub mult.f90” it seems to run successfully, and produces the file:
mult.so


I am running NCL version 6.4.0 on the following system:
Linux x86_64 x86_64 x86_64 GNU/Linux

I know this problem has come up in the NCL users’ forum before, but I’ve not seen how the issue gets resolved.  Your help would be appreciated.  Thanks.

Best regards,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180511/cfb55c06/attachment.html>


More information about the ncl-talk mailing list