Hi Hendrik,
-L takes a directory, not a full library path. Try:
f95 test.f90 -L/starlink/star-hawaiki/lib `sla_lib` -o main.x
or less officially:
f95 test.f90 -L/starlink/star-hawaiki/lib -lsla -o main.x
The LD_LIBRARY_PATH setting is required at runtime, not at
compile/link time. Even less officially, you could
f95 test.f90 -l/starlink/star-hawaiki/lib/libsla.a -o main.x
which would avoid linking with the .so variant. In that case,
the LD_LIBRARY_PATH setting should not be necessary at all.
Cheers,
Horst
--
Horst Meyerdierks Royal Observatory Edinburgh
Linux/Network Manager [log in to unmask]
http://www.roe.ac.uk/~hme/ +44-131-6688-309
On Fri, Oct 15, 2010 at 11:59:08AM +0200, Hendrik Van Heerden wrote:
>
> % f77 progname.o -L/star/lib ‘sla_link‘ -o progname
> Hi
>
> The learning curve is steep, but I am getting FORTRAN programs running.
> Takes input - gives output .... atc
>
> I now want to start and try to use the SLALIB libraries inside
> starlink. Checked out the necessary documentation parts as recommended.
> See below:
>
> (Need to set this)!!!
>
> At run time, the loader needs to find the shared libraries. On a
> Starlink system your
> LD_LIBRARY_PATH will have been set to enable this to occur (if you use
> the Starlink login
> files). If not, you should add /star/share to your LD_LIBRARY_PATH.
>
> (for this to work)!!!!
>
> % f77 progname.o -L/star/lib ‘sla_link‘ -o progname
>
> I have tried using "direct" linking as follows (use f95 with f90
> code)!! and get the following:
>
> [iraf@localdomain:localhost ~/fortran]$ f95 test.f90
> -L/starlink/star-hawaiki/lib/libsla.a -o main.x
> test.f90:29.13:
>
> write
> (6,:'(1x,i2.2,2i3.2,''.'',i2.2,2x,a,i2.2,2i3.2,''.'',i1)'):ihmsf,s,id
> 1
> Error: Syntax error in WRITE statement at (1)
>
> When I comment out the write part - result is as below - which is
> expected because the links are not active.
>
> [iraf@localdomain:localhost ~/fortran]$ f95 test.f90
> -L/starlink/star-hawaiki/lib/libsla.a -o main.x
> /tmp/ccUYS58k.o: In function `MAIN__':
> test.f90:(.text+0xdc): undefined reference to `sla_dafin_'
> test.f90:(.text+0x129): undefined reference to `sla_dafin_'
> test.f90:(.text+0x15f): undefined reference to `sla_fk45z_'
> test.f90:(.text+0x189): undefined reference to `sla_dr2tf_'
> test.f90:(.text+0x1b0): undefined reference to `sla_dr2af_'
> collect2: ld returned 1 exit status
>
> Therefore - please how and where in the login file
> (/starlink/star-hawaiki/etc/login) do I set the link for the above
> compile to work.
|