WRAPIT issue with .F90 files

From: Walter Hannah <whannah_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 24 2011 - 09:22:20 MST

Hi,

When I use WRAPIT on a Fortan 77 file I have no problems, but when I try
to do it on a Fortran 90 file using the seperate stub file I get this
output:

/
> WRAPIT ex.stub ex.F90
         
        WRAPIT Version: 091416
        /opt/pgi/linux86-64/10.5/bin/pgf90
        LINKING
        /usr/bin/ld: WRAPIT.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object; recompile
with -fPIC
        WRAPIT.o: could not read symbols: Bad value
        END WRAPIT/

When I use the -fPIC option WRAPIT seems to make the shared object ok,
but then when I run this NCL file:

ex.ncl:

        /external EX "./ex.so"
   
        begin
          i = 5
          x = 1.3
          print("before i = " + i)
          print("before x = " + x)
          EX:: ex(i,x)
          print("after i = " + i)
          print("after x = " + x)
        end

/I get this output:

/ warning:An error occurred loading the external file ./ex.so,
file not loaded
        ./ex.so: undefined symbol: ex_
        warning:error at line 1 in file ex.ncl
      
        fatal:syntax error: line 8 in file ex.ncl before or near :
          EX:
        ----^
      
        fatal:error in statement
        fatal:Syntax Error in block, block not executed
        fatal:error at line 11 in file ex.ncl
/

I'm guessing that this might be a 32-bit vs 64-bit issue, since I'm on a
32 bit machine and ssh'ing onto a 64-bit machine. If I use the Fortran
77 version that is found on the WRAPIT help page, everything works fine.
Any ideas why this might be happening?

Here are the Fortran files,

ex.F90:
/
          SUBROUTINE EX (II,XX)
              INTEGER II
              REAL XX
      
              II = II + 5
              XX = XX - 12.345
              RETURN
          END/

ex.stub:

/ C NCLFORTSTART
              SUBROUTINE EX (II,XX)
              INTEGER II
              REAL XX
        C NCLEND

/Thanks,
Walter

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 24 09:22:27 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST