Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Use the Sun Fortran Library

807575Jun 25 2009 — edited Jun 27 2009
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2009
Added on Jun 25 2009
2 comments
166 views