compling problem

Hi,

i am using PGI visual fortran compiler. but while compling i am getting error

“unresolved external symbol DGETRF” in one of my .obj file.

i am calling this as

call DGETRF (14,14,JAC,14,IPVT,info)

please give suggestions.

“Unresolved external…” is a link-time error, not a compilation error

DGETRF is not part of the standard Fortran runtime libraries. To get it linked in, you need to link the Lapack library by specifying -llapack -lblas in the compiler invocation.

On Windows, you also need to compile with the -Munix option.

If you want to use MKL or ACML for better performance, follow the instructions for linking the respective libraries to your application.

thanks for rply…
i corrected the above specifed error,but now i am getting a new error with symbol “ma37” & i am sure this is also not a fortran library function.

i searched in google but didn’t find which library i should include in my program.
please tell me the procedure & source to download this library.

Hi kuldeep gupta,

“ma37” sounds like a local variable name. Can you search your source to find it’s reference?

It’s possible it’s unused external reference. If this is the case, you can add the compilation flag “-Mnoref_externals”.

  • Mat

thanks for rply,

i am using “ma37” in my program as

call ma37ad()

now please tell me what is the problem
& how can i add “-Mnoref_externals” in my project.

i am very new in fortran

“-Mnoref_externals” only matters if you have a external symbol declared but never used. Since ma37ad is called, it’s used and therefor “-Mnoref_externals” wont help.

You need to find the source file that contains the definition for the ma37ad subroutine, compile it, and then link the resulting object in with the rest of your objects. If this subroutine is found in a library, you will need determine which library, obtain the source or a pre-compiled library, and add this library to your link.

The only match that I can find to “ma37ad” from a web search is a routine in the HSL Mathematical Library ( http://www.hsl.rl.ac.uk/, http://www.hsl.rl.ac.uk/archive/specs/ma37.pdf) This may be what you need or may just be a routine with the same name.

Does the application that you are trying to build have any documentation? It should list any dependencies it needs. If not, you should ask whomever you got the code from.

  • Mat

now please tell me what is the problem

The subroutine ma37ad is part of the HSL Mathematical Software Library, and is intended for solving sparse linear equations that are nearly symmetric in structure.

You will have to request a copy from the Rutherford Lab (UK) if you do not already have the source code.

Are you too busy to use Google? See www.hsl.rl.ac.uk/archive/specs/ma37.pdf .

thanks for the rply.
i removed those error…thanks alot…
one last error is with “use dfwin” statement
please tell me the procedure how to add these library in project

Hi kuldeep gupta,

one last error is with “use dfwin” statement please tell me the procedure how to add these library in project

All you should need is the “use dfwin” statement. The dfwin module is simply an interface module to the Win32 API and necessary system libraries are automatically linked with your application.

Can you please give more information about the error you are seeing?

Note, for details about the dfwin module, please refer to the PGI Visual Fortran Reference Guide (http://www.pgroup.com/doc/pvfref.pdf)

  • Mat

this is my subroutine-

use dfwin

type(T_OPENFILENAME) ofn
character100 filter_spec
character
512 file_spec
integer status
character*(*)name

! set filter specification and string to return the file specification.

file_spec=’'C
filter_spec = ‘Data Files’C//’.dat’C// &
‘Text Files’C//’
.txt’C// &
‘All files’C//’*‘C//’'C
ofn%lStructSize = SIZEOF(ofn)
ofn%hwndOwner = NULL
ofn%hInstance = NULL
ofn%lpstrFilter = loc(filter_spec)
ofn%lpstrCustomFilter = NULL
ofn%nMaxCustFilter = 0
ofn%nFilterIndex = 1
ofn%lpstrFile = loc(file_spec)
ofn%nMaxFile = sizeof(file_spec)
ofn%nMaxFileTitle = 0
ofn%lpstrInitialDir = NULL
ofn%lpstrTitle = loc('D Y N S I M’C)
ofn%Flags = OFN_PATHMUSTEXIST
ofn%lpstrDefExt = loc('dat’C)
ofn%lpfnHook = NULL
ofn%lpTemplateName = NULL

& i am getting this error

Derived type has not been declared - t_openfilename

please give advice.

Hi kuldeep gupta,

The T_OPENFILENAME type isn’t part of DFWIN, It should be defined by your program.

  • Mat

thanks alot Mat…
i successfully compiled my program.
thanks again