Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

IMSL linking with IVF

lspinu
Beginner
1,115 Views
I am trying to use IMSL libraries with Intel Visual Fortran Pro 9.0 and I am obtaining a building error. I followed all the instructions from the IMSL readme file ( specify the path of the include and libraries) without any success.I created a console application using an example found on IMSL ( imslmp.f90).
I would appreciate if you can help me with this issue
Below is the obtained error message:

------ Build started: Project: Console1, Configuration: Debug Win32 ------

Linking...

Source1.obj : error LNK2019: unresolved external symbol _S_RAND_GEN referenced in function _MAIN__

Source1.obj : error LNK2019: unresolved external symbol _VERML referenced in function _MAIN__

Source1.obj : error LNK2019: unresolved external symbol _S_SHOW_V referenced in function _MAIN__

Source1.obj : error LNK2019: unresolved external symbol _ERSET referenced in function _MAIN__

Source1.obj : error LNK2019: unresolved external symbol _E1CHK referenced in function _MAIN__

Source1.obj : error LNK2019: unresolved external symbol _N1RNOF referenced in function _MAIN__

Debug/Console1.exe : fatal error LNK1120: 6 unresolved externals

Build log written to file://D:fortranprojectsConsole1DebugBuildLog.txt

Console1 build failed.

---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,115 Views
Please read the section on using IMSL in the "Using Libraries" section of the Intel Fortran "Building Applications" manual. I think you will find this more helpful than the generic IMSL readme.

If the problem persists, please submit an example to Intel Premier Support.
0 Kudos
lspinu
Beginner
1,115 Views

Thank you very much for your replay. I found one problem. It is supposed to include the statement

INCLUDE 'link_f90_static.h'

I did this and solved my building problem. However, I tried to execute the example from IMSL called "validate" (source name imslmp.f90)and I got an error message. The sourceI used is given below:

Code:

! Use files

use rand_gen_int

use show_int

INCLUDE 'link_f90_static.h'

! Declarations

real (kind(1.e0)), parameter:: zero=0.e0

real (kind(1.e0)) x(5)

type (s_options) :: iopti(2)=s_options(0,zero)

character VERSION*48, LICENSE*48, VERML*48

external VERML, E1CHK, ERSET, N1RNOF

integer n1rnof

! Start the random number generator with a known seed.

iopti(1) = s_options(s_rand_gen_generator_seed,zero)

iopti(2) = s_options(123,zero)

call rand_gen(x, iopt=iopti)

! Verify the version of the library we are running

! by retrieving the version number via verml().

! Verify correct installation of the license number

! by retrieving the customer number via verml().

!

VERSION = VERML(1)

LICENSE = VERML(4)

WRITE(*,*) 'Library version: ', VERSION

WRITE(*,*) 'Customer number: ', LICENSE

! Get the random numbers

call rand_gen(x)

! Output the random numbers

call show(x,text=' X')

! Generate error

call erset(5, 0, 0)

call e1chk (-1234.0D0)

iopti(1) = s_options(15,zero)

call rand_gen(x, iopt=iopti)

call e1chk(296323.0d0)

write(*,*)

if (n1rnof(2) .eq. 0) then

write(*,*) "The output is correct."

else

write(*,*) "The output is not correct."

endif

end



The error message reads:

*** TERMINAL ERROR 1 from VERML. The environment variable CTT_DIR is not set

What this does mean?

Thank you in advance for your help,

Leonard


0 Kudos
Steven_L_Intel1
Employee
1,115 Views
The VALIDATE example depends on certain system environment variables being defined. These are defined if you ask the IMSL install to set the system environment variables, or if you run the program from a command prompt window which has run the IMSL setup .bat file (as of 9.0.024, this is done automatically when you use the "Fortran Build Environment" shortcut in the Intel Fortran Compiler 9.0 program group.)

What you can do to test this is to start such a command prompt window, then from within that window, run the linked program.
0 Kudos
lspinu
Beginner
1,115 Views
It is working!
Thank you for your help,
Leonard
0 Kudos
felixrei
Beginner
1,115 Views
I have the same problem. I am running the IVF compiler and IMSL. I did everything the different manuals said (i.e. the Fortran help: "using the IMSL Libraries from the Integrated Development Environment" + the ISML Readme files.

I also had ISML change all the configurations it wanted during the set-up. Yet, running the validate program doesn't work. I get the following error messages:

Test IMSL 1 error LNK2019: unresolved external symbol _E1CHK referenced in function _MAIN__
Test IMSL 1 error LNK2019: unresolved external symbol _ERSET referenced in function _MAIN__
Test IMSL 1 error LNK2019: unresolved external symbol _N1RNOF referenced in function _MAIN__
Test IMSL 1 error LNK2019: unresolved external symbol _S_RAND_GEN referenced in function _MAIN__
Test IMSL 1 error LNK2019: unresolved external symbol _S_SHOW_V referenced in function _MAIN__
Test IMSL 1 error LNK2019: unresolved external symbol _VERML referenced in function _MAIN__
Test IMSL 1 fatal error LNK1120: 6 unresolved externals


If I include "INCLUDE 'link_f90_static.h'" I get a different set of errors:

Test IMSL 1 error LNK2005: ___initmbctable already defined in LIBCD.lib(mbctype.obj)
Test IMSL 1 error LNK2005: __getmbcp already defined in LIBCD.lib(mbctype.obj)
Test IMSL 1 error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj)
Test IMSL 1 error LNK2005: __setmbcp already defined in LIBCD.lib(mbctype.obj)
Test IMSL 1 error LNK2005: __tolower already defined in LIBCD.lib(tolower.obj)
Test IMSL 1 error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj)
Test IMSL 1 fatal error LNK1169: one or more multiply defined symbols found
Test IMSL 1 warning LNK4098: defaultlib 'LIBC' conflicts with use of other libs; use /NODEFAULTLIB:library
Test IMSL 1 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

I tried running the file directly from the command line, but got the same errors. What I am doing wrong and what do I need to do to use the IMSL library?

Thanks a lot for your help!

Felix
0 Kudos
Steven_L_Intel1
Employee
1,115 Views
You don't show the command line you're using. For the first case, it seems you are not naming the required IMSL libraries as described in the Building Applications manual. For the second, you seem to be pulling two different forms of the MSVC libraries - again, without seeing how you build I can't comment.

If you'd like further assistance, please submit an issue to Intel Premier Support. Attach a ZIP of your project and a log of the command line session.
0 Kudos
Reply