Compiling using the Fortran NAG library under Linux RedHat 7.1 
Author Message
 Compiling using the Fortran NAG library under Linux RedHat 7.1

[ Perhaps my first reply got lost so I did it again (Oops!) ]

Quote:

> LIBS = -lnag
> LDFLAGS =  -L/usr/local/common/NAGnl/flsol18da/
> OPT = -u -ieee=full -f77
> all: immatrix107
> immatrix107.o: immatrix107.f95
>    f95 -dusty $(LDFLAGS) $(LIBS) $(OPT) -c immatrix107.f95  
> immatrix107: immatrix107.o
>    f95 -dusty $(LDFLAGS) $(LIBS) $(OPT) -o immatrix107 immatrix107.o
> clean:
>    rm -rf *.o  core   # creates a command to remove old .o and core
> files
> but always get the error message:
> immatrix107.o: In function `main':
> immatrix107.o(.text+0xdb99): undefined reference to `g02caf_'
> collect2: ld returned 1 exit status
> make: *** [immatrix107] Error 1

What happens if you call the linker from the command line? Like

$ f95 -dusty -L/usr/local/common/NAGnl/flsol18da/ -lnag -u -ieee=full -f77 -o immatrix107 immatrix107.o

Also try removing the trailing / from the -L Argument.

Martin



Fri, 28 Jan 2005 20:32:51 GMT  
 Compiling using the Fortran NAG library under Linux RedHat 7.1


<snip>

:> but always get the error message:

:> immatrix107.o: In function `main':
:> immatrix107.o(.text+0xdb99): undefined reference to `g02caf_'
:> collect2: ld returned 1 exit status
:> make: *** [immatrix107] Error 1

: What happens if you call the linker from the command line? Like

: $ f95 -dusty -L/usr/local/common/NAGnl/flsol18da/ -lnag -u -ieee=full -f77 -o immatrix107 immatrix107.o

: Also try removing the trailing / from the -L Argument.

Check to see how the symbol go2caf appears in the library:

nm /usr/local/common/NAGnl/flsol18da/libnag* | grep g02caf

Does is appear with a single trailing underscore in the library?
Also, is that second character a zero or an alphabetic "O"?

Norm Wood



Sat, 29 Jan 2005 04:37:13 GMT  
 Compiling using the Fortran NAG library under Linux RedHat 7.1


Quote:


><snip>

>:> but always get the error message:

>:> immatrix107.o: In function `main':
>:> immatrix107.o(.text+0xdb99): undefined reference to `g02caf_'
>:> collect2: ld returned 1 exit status
>:> make: *** [immatrix107] Error 1

>: What happens if you call the linker from the command line? Like

>: $ f95 -dusty -L/usr/local/common/NAGnl/flsol18da/ -lnag -u -ieee=full -f77 -o immatrix107 immatrix107.o

>: Also try removing the trailing / from the -L Argument.

>Check to see how the symbol go2caf appears in the library:

>nm /usr/local/common/NAGnl/flsol18da/libnag* | grep g02caf

On my machine, which has the NAG fortran Library Mark 19, I get

kaveri 57% nm libnag.a | grep g02caf
libnag.a[g02caft.o]:
[1]     |         0|       0|FILE |LOCL |0    |ABS    |../g/g02caft.f
[19]    |         0|       8|OBJT |LOCL |0    |5      |GPB.g02caf.F77StrConst.70
[13]    |        64|       8|OBJT |LOCL |0    |3      |GPB.g02caf.bignum
[9]     |        32|       8|OBJT |LOCL |0    |3      |GPB.g02caf.fn
[12]    |        56|       4|OBJT |LOCL |0    |3      |GPB.g02caf.i
[15]    |        80|       4|OBJT |LOCL |0    |3      |GPB.g02caf.ierror
[6]     |        96|       1|OBJT |LOCL |0    |3      |GPB.g02caf.p01rec
[4]     |         0|       8|OBJT |LOCL |0    |3      |GPB.g02caf.r
[10]    |        40|       8|OBJT |LOCL |0    |3      |GPB.g02caf.small
[5]     |         8|       8|OBJT |LOCL |0    |3      |GPB.g02caf.stdx
[7]     |        16|       8|OBJT |LOCL |0    |3      |GPB.g02caf.stdy
[16]    |        88|       8|OBJT |LOCL |0    |3      |GPB.g02caf.xbar
[11]    |        48|       8|OBJT |LOCL |0    |3      |GPB.g02caf.xi
[8]     |        24|       8|OBJT |LOCL |0    |3      |GPB.g02caf.ybar
[14]    |        72|       8|OBJT |LOCL |0    |3      |GPB.g02caf.yi
[22]    |        44|    1952|FUNC |GLOB |0    |2      |g02caf_
kaveri 58%

So, it is there, allright.

Quote:
>Does is appear with a single trailing underscore in the library?
>Also, is that second character a zero or an alphabetic "O"?

Should be a zero. The second character in the NAG filenames is
a numeric character.

I would check on the origin of the library. If it was loaded correctly
you should have the subroutine. It appears to do linear regression on
a given data set.

--


                         Remove 'bounceback' for email address



Sat, 29 Jan 2005 04:29:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to compile Mopac 7.1 using intel fortran or gfortran

2. Lahey F95 in RedHat 7.1 Linux

3. redhat 7.1 linux upgrade of Python 1.52 to 2.0

4. Large files in Fortran with Redhat 7.1

5. Where to find NAG libraries Source (to compile under Linux)

6. Get the version of IMSL/Fortran Mathematics and Statistics and NAG/Fortran Numeric Algorithms Library Library

7. dll interface for MS fortran 5.1 compiled NAG library

8. How to compile Mopac 7.1 using g77 or gfortran

9. Hello world gets errors Intel fortran 7.1 linux help

10. Intel Fortran 7.1 & Fedora Linux

11. xlf / nag / ifort / pgf90 vs g95 / sun f90 / ifc 7.1

12. NASM broken in RedHat 7.1?

 

 
Powered by phpBB® Forum Software