I wish to use the Sun Fortran Library of functions, but I am having trouble compiling my program. I would appreciate some help on selecting the proper compiler options, code modifications, etc.
My OS is Fedora 10 on a 64-bit system. I use the latest Sun Studio Express. I have used the Sun f95 compiler for quite some time as well, but this is my first use of one of the functions from the Sun Fortran Library.
Here is my first attempt after doing some unsuccessful research of my own on this issue:
PROGRAM test
IMPLICIT NONE
REAL*8 x, y
REAL*8, EXTERNAL :: d_lgamma
x=2.0
y=d_lgamma(x)
y=EXP(y)
WRITE(*,*) x, y
END PROGRAM test
Here's how I tried to compile:
f95 -lm test.f95
test.o: In function `MAIN_':
test.f95:(.text+0x91): undefined reference to `d_lgamma_'
Obviously I am not doing this correctly. Is it possible that the Sun compiler and libraries have not been installed correctly on my system? How can I test if this is case?
Thank you for your help with this matter.