1827903 Members
1694 Online
109970 Solutions
New Discussion

HP f90 compilation error

 
junjun_1
New Member

HP f90 compilation error

the version of f90 is v2.8.4

I encount an error when I compile a program
---
f90 -I./src -lm +O3 +Onoautopar +DD32 +r8 -L/opt/fortran90/lib/ielf/math/hpux32 -c src/qdiff4v.f
src/qdiff4v.f
program QDIFF
noit=int(7.8/log(1.0 + sqrt(1-spec)))
^
Error 937 at (345:src/qdiff4v.f) : This is not the name of a function
^
Error 887 at (345:src/qdiff4v.f) : Argument to this intrinsic procedure is missing
Warning 403 : Padding inserted before variable RMMIN in common SCALE

2 Errors
f90: error 213: Errors detected.
*** Error exit code 1

Stop.
----

This program has been smoothly compiled under PC Linux. I wrote a simple code that only has "write (*,*) log(4.5)", and found f90 can compile it. I don't know why HP f90 keeping saying "log" "is not the name of a function" when compiling qdiff4v.f. It's highly appreciated for any advice! Thanks in advance!
7 REPLIES 7
Peter Godron
Honored Contributor

Re: HP f90 compilation error

Hi,
not a fortran expert, but have you tried isolating the problem by:
1. output the variables before your statement
2. Use of brackets
noit=int(7.8/(log(1.0 + (sqrt(1.0 - spec))))
3. Separation of statements
a=sqrt(1.0 - spec)
b=log(1.0 + a)
c=(7.8/b)
noit=int(c)
junjun_1
New Member

Re: HP f90 compilation error

Thanks your good suggestions! I finally changed the code from
noit=int(7.8/log(1.0 + sqrt(1-spec)))
to
write (*,*) log(1.3)
and the compiling error msg is:
-------
f90 -Isrc a.f
a.f
program QDIFF
write (*,*) log(1.3)
^
Error 937 at (348:a.f) : This is not the name of a function

1 Error
f90: error 213: Errors detected, no link.
-------
Looks like f90 don't know "log". But it compiled successfully when I put "write (*,*) log(1.3)" followed by "END" into an empty file. Any suggestions? Thanks!
junjun_1
New Member

Re: HP f90 compilation error

I changed "log" in the code to "lg", and compilation passed without errors. But when linking objects, the follwing messages appeared:
-----
.....
.....
ld: Type mismatch for symbol "log"; resolving OBJECT symbol (in file ichash4.o) to FUNC symbol (in file /usr/lib/hpux32//libm.so)
ld: Type mismatch for symbol "log"; resolving OBJECT symbol (in file irhash4.o) to FUNC symbol (in file /usr/lib/hpux32//libm.so)
ld: Type mismatch for symbol "log"; resolving OBJECT symbol (in file rdhcrg.o) to FUNC symbol (in file /usr/lib/hpux32//libm.so)
ld: Type mismatch for symbol "link"; resolving OBJECT symbol (in file qdiff4v.o) to FUNC symbol (in file /usr/lib/hpux32//libc.so)
ld: Unsatisfied symbol "lg" in file qdiff4v.o
ld: Unsatisfied symbol "fdate" in file itit4j.o
ld: Unsatisfied symbol "etime" in file timef.o
ld: Unsatisfied symbol "dtime" in file timef.o
34 warnings.
4 errors.
*** Error exit code 1

Stop.
-----

Any suggestions? Thanks in advance!
Dennis Handly
Acclaimed Contributor

Re: HP f90 compilation error

Why are you using -L/opt/fortran90/lib/ielf/math/hpux32?
If this isn't documented with f90, remove it. The similar file libmielf.a there is useless for C/aC++.
Also -lm needs to be at the end of the link line.

From your linker messages:
ld: Type mismatch for symbol "log"; resolving OBJECT symbol (ichash4.o) to FUNC symbol (libm.so)

This is saying you have defined log as a data variable or array and not a function. And you have done it in ichash4.f, irhash4.f, rdhcrg.f and qdiff4v.f.

ld: Unsatisfied symbol "lg" in file qdiff4v.o

And you don't have definitions for lg (that you changed) and for fdate, etime and dtime.
junjun_1
New Member

Re: HP f90 compilation error

Now I'm required to resolve this problem. I'm hoping you kind guys can continue helping me on this problem, thanks!

Now I have two questions:
1). "lg" is the function name of natural logarithm in our f90. Why I need to define it?
2). I did a test by compiling the code "write (*,*) log(4.5)" successfully, indicating that "log" should be recognized by our f90. Why our f90 complains wrong function name when compiling "noit=int(7.8/log(1.0 + sqrt(1-spec)))" in the program code?

By the way, the program code we need to compile is an academic software and can be compiled smoothly by PGI in linux, whileas Intel fortran also can't pass the compilation.
Dennis Handly
Acclaimed Contributor

Re: HP f90 compilation error

>1) "lg" is the function name of natural logarithm in our f90. Why I need to define it?

I thought the name is log?

>2) Why our f90 complains wrong function name when compiling "noit=int(7.8/log(1.0 + sqrt(1-spec)))" in the program code?

There is nothing obviously wrong with the statement. You probably need to attach your file so we know exactly what you have.
junjun_1
New Member

Re: HP f90 compilation error

Thank you, Dennis! I just got the response from the author that I'm not allowed to send you the whole code file according to the license.

Yes, you are right. That statement is correct. I tested this statement with our HP f90 and it gives out correct result.

I'll try to find out more things to resolve this compiling problem. Thanks anyway!