- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just purchased the Intel Visual Fortran Compiler Professional Edition with IMSL Math Library. I used an example code in the IMSL library and tried to compile it. The code is provided below.
use lin_sol_gen_int
use rand_gen_int
use error_option_packet
implicit none
! This is Example 1 for LIN_SOL_GEN.
integer, parameter :: n=32
real(kind(1e0)), parameter :: one=1e0
real(kind(1e0)) err
real(kind(1e0)) A(n,n), b(n,n), x(n,n), res(n,n), y(n**2)
! Generate a random matrix.
call rand_gen(y)
A = reshape(y,(/n,n/))
! Generate random right-hand sides.
call rand_gen(y)
b = reshape(y,(/n,n/))
! Compute the solution matrix of Ax=b.
call lin_sol_gen(A, b, x)
! Check the results for small residuals.
res = b - matmul(A,x)
err = maxval(abs(res))/sum(abs(A)+abs(b))
if (err <= sqrt(epsilon(one))) then
write (*,*) 'Example 1 for LIN_SOL_GEN is correct.'
end if
end
I used the following command to run this code on the C:\\ Prompt:
ifort Example_1.f90
It produced the following errors:
Error LNK2019: unresolved external symbol _S_RAND_GEN referenced in function _MAIN_
Error LNK2019: unresolved external symbol _S_LIN_SOL_GEN referenced in function _MAIN_
Could you help me resolve this and get going? Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to tell the compiler to link to the IMSL libraries, and to which set of libraries. This is described in the on-disk documentation under Using Libraries > Using IMSL.
The easiest way is to add the following lines to your source, before the USE statements:
[fortran]include 'link_fnl_static.h' !dec$ objcomment lib:'libiomp5md.lib'[/fortran]For additional information, see Installing and Configuring the IMSL Libraries.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page