can't use IMSL fortran library

can't use IMSL fortran library

Dear all

I have followed the instruction as to how use IMSL from Intel Fortran Compiler. I I have the following from the log file

Compiling with Intel(R) Visual Fortran 11.1.067 [Intel(R) 64]...
ifort /nologo /debug:full /Od /I"C:\Program Files (x86)\Intel\Compiler\11.1\067\include" /module:"x64\Debug\\" /object:"x64\Debug\\" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64" "Q:\data\fortran\tml.f90"
Q:\data\fortran\tml.f90(16): error #5102: Cannot open include file 'link_fnl_static.h'
include 'link_fnl_static.h'
--------^
compilation aborted for Q:\data\fortran\tml.f90 (code 1)

awetal - 2 error(s), 0 warning(s)

I have the following configured but I cannot use the IMSL library. Your help is greatly welcome.

Tools>options> Intel Visual Fortran

The directory lists
Libraries:

$(IFortInstallDir)lib\Intel64
$(IFortInstallDir)mkl\em64t\lib
$(VCInstallDir)atlmfc\lib\amd64
$(VCInstallDir)lib\amd64
$(VCInstallDir)PlatformSDK\lib\x64
$(WindowsSdkDir)lib\x64
$(FNL_DIR)\IA32\lib

Includes:
$(IFortInstallDir)include
$(IFortInstallDir)include\Intel64
$(IFortInstallDir)mkl\include
$(VCInstallDir)atlmfc\include
$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(WindowsSdkDir)include

19 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers mecej4

Just as you show $(FNL_DIR)\IA32\lib in the list of locations to search for libraries, you need to include $(FNL_DIR)\intel64\include and $(FNL_DIR)\intel64\include\dll for the compiler to find the necessary *.h and *.mod files.

You also need to correct the entry $(FNL_DIR)\IA32\lib in the list of library locations to $(FNL_DIR)\intel64\lib, since you may not mix IA32 and Intel64 objects and libraries.

If you do not have the Intel64 version of IMSL, you will have to convert the whole project to IA32 or start from scratch and reconstruct the project.

I corrected for the errots you pointed out, and  I still could not solve the problem . Also, I do have the Inetl version of IMSL.

Below is the log file when I try to build my project.

Build Log
Build started: Project: awetal, Configuration: Debug|Win32

Output
Deleting intermediate files and output files for project 'awetal', configuration 'Debug|Win32'.
Compiling with Intel(R) Visual Fortran 11.1.067 [IA-32]...
ifort /nologo /debug:full /Od /I"C:\Program Files (x86)\Intel\Compiler\11.1\067\include" /module:"Debug\\" /object:"Debug\\" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" "Q:\data\fortran\para.f90"
ifort /nologo /debug:full /Od /I"C:\Program Files (x86)\Intel\Compiler\11.1\067\include" /module:"Debug\\" /object:"Debug\\" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" "Q:\data\fortran\ml.f90"
ifort /nologo /debug:full /Od /I"C:\Program Files (x86)\Intel\Compiler\11.1\067\include" /module:"Debug\\" /object:"Debug\\" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" "Q:\data\fortran\mm.f90"
Linking...
Link /OUT:"Debug\awetal.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files (x86)\Intel\Compiler\11.1\067\lib" /MANIFEST /MANIFESTFILE:"Q:\data\fortran\awetal\awetal\Debug\awetal.exe.intermediate.manifest" /DEBUG /PDB:"Q:\data\fortran\awetal\awetal\Debug\awetal.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"Q:\data\fortran\awetal\awetal\Debug\awetal.lib" "Debug\parameterse.obj" "Debug\ml.obj" "Debug\mm.obj"
Link: executing 'link'
ml.obj : error LNK2019: unresolved external symbol _expf referenced in function _ml
mm.obj : error LNK2001: unresolved external symbol _expf
ml.obj : error LNK2019: unresolved external symbol _sqrtf referenced in function _ml
mm.obj : error LNK2001: unresolved external symbol _sqrtf
ml.obj : error LNK2019: unresolved external symbol _for_emit_diagnostic referenced in function _ml
mm.obj : error LNK2001: unresolved external symbol _for_emit_diagnostic
ml.obj : error LNK2019: unresolved external symbol ___powr4i4 referenced in function _ml
ml.obj : error LNK2019: unresolved external symbol _for_write_seq_lis referenced in function _ml
mm.obj : error LNK2001: unresolved external symbol _for_write_seq_lis
ml.obj : error LNK2019: unresolved external symbol _for_check_mult_overflow referenced in function _ml
ml.obj : error LNK2019: unresolved external symbol _for_alloc_allocatable referenced in function _ml
ml.obj : error LNK2019: unresolved external symbol _LINDS referenced in function _ml
ml.obj : error LNK2019: unresolved external symbol _EVCSF referenced in function _ml
ml.obj : error LNK2019: unresolved external symbol _for_dealloc_allocatable referenced in function _ml
ml.obj : error LNK2019: unresolved external symbol _logf referenced in function _ml
mm.obj : error LNK2001: unresolved external symbol _logf
ml.obj : error LNK2019: unresolved external symbol _for_deallocate referenced in function _ml
mm.obj : error LNK2019: unresolved external symbol _for_set_reentrancy referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _for_open referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _for_read_seq_fmt referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _for_read_seq_fmt_xmit referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _RNNOR referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _RNUN referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _for_write_seq_fmt referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _for_close referenced in function _MAIN__
mm.obj : error LNK2019: unresolved external symbol _for_write_seq_fmt_xmit referenced in function _MAIN__
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
Debug\awetal.exe : fatal error LNK1120: 22 unresolved externals

awetal - 28 error(s), 0 warning(s)

Bild des Benutzers Steve Lionel (Intel)

You haven't entered the correct paths. Please follow the instructions in Configuring Visual Studio for using the IMSL* Fortran Numerical Library .

Steve

Hi Steve 

I followed the instruction from your link. I also experimented with:

 INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

and

INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

However I got the following message:

error #5102: Cannot open include file 'link_fnl_static.h

and 

error #5102: Cannot open include file 'link_fnl_shared.h

Bild des Benutzers Steve Lionel (Intel)

You did not follow the instructions for changing the Includes list:

  • At the right of Includes, click the "..." button.
  • Add to the end of the list,
    $(FNL_DIR)\IA32\include\dll (for IA-32 architecture target, or)
    $(FNL_DIR)\Intel64\include\dll ( for Intel 64 architecture target)

Steve

I did include wha you suggested last time but  still not working

Bild des Benutzers Steve Lionel (Intel)

You seem to have several problems here, though the symptoms are strange.

In your link options I see: /LIBPATH:"C:\Program Files (x86)\Intel\Compiler\11.1\067\lib"

This is not correct - it should have \ia32 at the end after \lib. Did you add this yourself? The library path for the compiler libraries should be automatically added.

After you fix that, please set the project property Linker > General > Show Progress Messages > Show all progress messages and then rebuild. Then on the Fortran > Command line property page, add /watch to the Additional Options pane. Now rebuild. FInd the buildlog.htm file in the Debug subfolder, create a ZIP of it, and attach the ZIP as a file to a reply here. This will help me understand the problems.

Steve

I attached herewith with buildlog file

Anlagen: 

AnhangGröße
Herunterladen buildlognew.zip2.73 KB
Bild des Benutzers mecej4

Have you checked whether the file C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll\link_fnl_shared.h exists, or has been deleted, perhaps by accident?

Your build log in message-3 of this thread shows that the header file was found, the compilation went through but a linker error occurred. Did something happen after that to make the header file disappear? Do you have both IA32 and Intel64 versions of IMSL installed?

Bild des Benutzers Steve Lionel (Intel)

The source files from the earlier post are not the same as from the build log (different file names). Indeed, the next thing to check is to see if the folder C:\Program Files (x86)\VNI\imsl\fnl600\IA32\include\dll exists and that the .h file is there.

Steve

I checked  and found out that  C:\Program Files (x86)\VNI\imsl\fnl600\Intel64\include\dll exists and the .h files are there. I have changed the directory list in the Tools >options as follows:

libraries:
$(IFortInstallDir)lib\Intel64
$(IFortInstallDir)mkl\Intel64\lib
$(VCInstallDir)atlmfc\lib
$(VCInstallDir)lib
$(VCInstallDir)PlatformSDK\lib
$(VCInstallDir)PlatformSDK\lib\x86
$(WindowsSdkDir)lib
$(FNL_DIR)\Intel64\lib

Includes:

$(IFortInstallDir)include

$(IFortInstallDir)include\Intel64
$(IFortInstallDir)mkl\include
$(VCInstallDir)atlmfc\include
$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(WindowsSdkDir)include
$(FNL_DIR)\Intel64\include\dll

I also attached the latest build log

Thank your very much for very quick replay!

Anlagen: 

AnhangGröße
Herunterladen buildlognew1.zip9.35 KB
Bild des Benutzers Steve Lionel (Intel)

Well, this is yet a different program.

Here you're building a 32-bit program - the paths you show above are for Intel 64 - but I see no evidence of any IMSL use in this latest program. This one uses MKL and you haven't added the MKL library paths - you need to do that. In a more recent release, this is done automatically when you enable "Use MKL" in Visual Studio, but 11.1 didn't do that.

S

Steve

I need to call LINDS, EVCSF, RNNOR and RNUN. And, I thought these were availabe from IMSL. Is there any way I can get the codes for these routines (to make them part of the source file for the project) instead of using libraries?

Bild des Benutzers Les Neilson

A quick look at the RogueWave site tells us that a lot of the code (e.g. LINDS) is based on the likes of LAPACK , EISPACK and so on.
A quick google of 
"inverse of a real symmetric positive definite matrix" (for LINDS) throws up a reference to www.netlib.org and
"the eigenvalues and eigenvectors of a real symmetric matrix" (for EVCSF) throws up ALGLIB from www.alglib.net
both of which are open source.
You may find something on these sites that you can use.

Les

Hi

I was able to use the mkl library. But I have encountered another problem

Build Log Build started: Project: awnew, Configuration: Debug|Win32 Output Compiling with Intel(R) Visual Fortran 11.1.067 [IA-32]... ifort /nologo /debug:full /Od /I"C:\Program Files (x86)\Intel\Compiler\11.1\067\mkl\ia32\lib" /warn:interfaces /module:"Debug\\" /object:"Debug\\" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" "C:\Program Files (x86)\Intel\Compiler\11.1\067\mkl\include\mkl_solver.f90" C:\Program Files (x86)\Intel\Compiler\11.1\067\mkl\include\mkl_rci.fi(80): error #5082: Syntax error, found END-OF-FILE when expecting one of: <END-OF-STATEMENT> ; <LABEL> BLOCK BLOCKDATA PROGRAM MODULE TYPE COMPLEX BYTE ... INTEGER DJACOBI ----------------------^ compilation aborted for C:\Program Files (x86)\Intel\Compiler\11.1\067\mkl\include\mkl_solver.f90 (code 1) ifort /nologo /debug:full /Od /I"C:\Program Files (x86)\Intel\Compiler\11.1\067\mkl\ia32\lib" /warn:interfaces /module:"Debug\\" /object:"Debug\\" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" "Q:\workdata\702734\kgab\Aw\fortran\mcmc.f90" awnew - 2 error(s), 0 warning(s)

Thanks for your very quick replay and continuous support!

Bild des Benutzers mecej4

Quote:

I need to call LINDS, EVCSF, RNNOR and RNUN. And, I thought these were available from IMSL. Is there any way I can get the codes for these routines
Here is a short program to do just that. Note that I have used the Fortran 77 calling conventions, in view of the difficulties you have described with regard to using modules. To compile and run, use the commands
 ifort /Qimsl xstat.f90 & xstat
You won't get far by attempting to obtain the source code of IMSL. A better investment of your time would focus on the documentation for IMSL and Fortran.
program xstat

!

implicit none

integer, parameter :: NR = 3

integer iseed

real x(NR),A(NR,NR),cor(NR,NR),ev(NR),eval(NR),evec(NR,NR)

!

include 'link_fnl_shared.h'

!

iseed = 20130212

CALL RNSET(iseed)
call RNNOR(NR,x)

write(*,10)' RNNOR ',x

!

call RNUN(NR,x)

write(*,10)' RNUN ',x

!

EV=(/ 1.0, 2.0, 3.0 /)*0.5

CALL RNCOR(NR,1,ev,A,NR,cor,NR)

write(*,20)' RNCOR ',cor

!

CALL EVCSF (NR,cor,NR,eval, evec,NR)

write(*,20)' EVAL ',eval

!

10 format(/,1x,A,/,2x,3G12.4)

20 format(/,1x,A,/,(2x,3G12.4))

!

end program xstat

 

Thanks mecej4

Melden Sie sich an, um einen Kommentar zu hinterlassen.