Re: errors when using WRAPIT

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 07 2012 - 14:37:28 MST

Hi Sha,

The error:

   Symbol not found: _write_littler_onelvl_

might indicate that you have a spelling error in your Fortran function.

What does:

  nm write_littler_onelvl.so

report?

Also, can you try the small test mentioned in the "Troubleshooting" section of:

http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#TroubleShooting

The issue might also be with your version of NCL, and the version of the compiler you have now.

--Mary

On Mar 7, 2012, at 11:53 AM, Sha Feng wrote:

> Hi ncl-talkers,
>
> I tried to call a Fortran routine from NCL script, but it failed. The errors are as follows.
>
> ******************************
> Copyright (C) 1995-2010 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.2.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> warning:An error occurred loading the external file ./write_littler_onelvl.so, file not loaded
> dlopen(./write_littler_onelvl.so, 2): Symbol not found: _write_littler_onelvl_
> Referenced from:~t/write_littler_onelvl.so
> Expected in: flat namespace
> in ~/write_littler_onelvl.so
> warning:error at line 5 in file test_littler.ncl
>
> fatal:syntax error: line 62 in file test_littler.ncl before or near :
> WRITE_ONELVL:
> -------------------^
>
> fatal:error in statement
> fatal:Syntax Error in block, block not executed
> fatal:error at line 73 in file test_littler.ncl
> *****************************
>
> Line 5 is the code loading the external function ./write_littler_onelvl.so
> Line 62 is the code for calling the Fortran routine
> Line 73 is "end"
>
> The .so was created. I printed the outputs (see below) adding -d when ran WRAPIT.
>
> WRAPIT Version: 100111
> OPERATING SYSTEM: Darwin
> FORTRAN COMPILER (f90c): gfortran
> FORTRAN COMPILER OPTIONS (fopts): -m64 -fPIC -v -c -fno-second-underscore
> gcc -m64 -c -fno-common -I/usr/local/ncl_ncarg-5.2.1/include WRAPIT.c
> SHARED OBJECT NAME (SharedObj): write_littler_onelvl.so
> LINKER SUFFIX (ld_suffix): WRAPIT.o -L/usr/local/gfortran/lib -o write_littler_onelvl.so
>
> LINKING
> gcc -m64 -bundle -flat_namespace -undefined suppress WRAPIT.o -L/usr/local/gfortran/lib -o write_littler_onelvl.so -lgfortran
> END WRAPIT
> *****************************************************
>
> Is there anyone who has clues?
>
> Thank you in advance,
> Sha
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 7 11:37:38 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 13 2012 - 14:00:14 MDT