Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Linking issue
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 8167 of 8551
Post > Topic >>

Linking issue

by jlar <jesper.webmail@[EMAIL PROTECTED] > Apr 23, 2008 at 06:49 AM

Hi Fortran experts,

I hope someone can help with this.

I am trying to link my application to the ngmath library. For some
reason it does not work. I have therefore written a small test program
which calls some subroutines in libngmath:

> cat test.f90
      program test
      real, dimension(2) :: xin, yin
      real, dimension(2) :: vin, xout, yout, vout
      integer :: ierr

      xin = (/1, 2/)
      yin = (/1, 2/)
      vin = (/1, -1/)
      xout = (1.5)
      yout = (1.5)
      call nnseti('EXT - extrapolation control',1)
      call nnsetr('NUL - function value when extrapolation not
allowed',-1.)
      call natgrids(2,xin,yin,vin,1,1,xout,yout,vout,ierr)
      write(0,*) vout
      end

I have placed the ngmath library file in the current working
directory:

> pgf90 -L. -lngmath -o test test.o
test.o: In function `MAIN_':
test.f90:(.text+0xdd): undefined reference to `nnseti_'
test.f90:(.text+0xf1): undefined reference to `nnsetr_'
test.f90:(.text+0x13d): undefined reference to `natgrids_'

If I use nm on the library file the subroutines seem to exist:

> nm libngmath.a  |grep nnseti_
0000000000000357 T nnseti_
> nm libngmath.a  |grep nnsetr_
000000000000063c T nnsetr_
> nm libngmath.a  |grep natgrids_
00000000000001f5 T natgrids_

I have tried using ar to extract the .o files from the library and
link to them directly. That works but is really not an option.

Regards,
Jesper
 




 3 Posts in Topic:
Linking issue
jlar <jesper.webmail@[  2008-04-23 06:49:17 
Re: Linking issue
nospam@[EMAIL PROTECTED]   2008-04-23 07:18:56 
Re: Linking issue
jlar <jesper.webmail@[  2008-04-23 20:45:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 4:22:04 CDT 2008.