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

unsolved external symbol _DRNUN

gte274s
Beginner
1,214 Views
Hi, I have a problem with the random number generator _DRNUN that I used as

call drnun (NR, R)

where NR - Number of random numbers to generate. (Input)
R - Vector of length NR containing the random uniform (0,1)deviates. (Output).

It is fine to compile the code in Compaq visual Fortran. However, it gives me error message as "error LNK2019: unresolved external symbol _DRNUN referenced in function XXX". Could anyone please tell me what is wrong and how should I correct it?

Thanks for your time and I appreciate your help.
0 Kudos
8 Replies
Steven_L_Intel1
Employee
1,214 Views
DRNUN is an IMSL routine, and therefore you have to tell either the compiler or the linker that you are using IMSL.

Method 1:

Add the line:

USE NUMERICAL_LIBRARIES

right after the PROGRAM, SUBROUTINE or FUNCTION line of the code that calls DRNUN

Method 2:

Select Project..Add to Project..Files. Files of type: Library Files (.LIB). Browse to the Program FilesMicrosoft Visual StudioDF98IMSLLIB folder. Select all the .LIB files and click OK.

Steve
0 Kudos
gte274s
Beginner
1,214 Views
Thanks, Steve.
0 Kudos
crkkos
Beginner
1,214 Views
DRNUN is an IMSL routine, and therefore you have to tell either the compiler or the linker that you are using IMSL.

Method 1:

Add the line:

USE NUMERICAL_LIBRARIES

right after the PROGRAM, SUBROUTINE or FUNCTION line of the code that calls DRNUN

Method 2:

Select Project..Add to Project..Files. Files of type: Library Files (.LIB). Browse to the Program FilesMicrosoft Visual StudioDF98IMSLLIB folder. Select all the .LIB files and click OK.

Steve

0 Kudos
crkkos
Beginner
1,214 Views
Quoting - crkkos
I tried the USE NUMERICAL LIBRARIES and couldnt get the function to work. I am using susedev1 and ifort 11

0 Kudos
crkkos
Beginner
1,214 Views
Suse 10 that is

0 Kudos
Steven_L_Intel1
Employee
1,214 Views
Intel does not offer a package with IMSL on Linux. You can buy IMSL for Linux from Visual Numerics.

The Intel Math Kernel Library, included with Intel Fortran Professional Edition, has many random number generators. Otherwise, consider using the Fortran intrinsic RANDOM_NUMBER.
0 Kudos
Peter
Beginner
1,214 Views
Quoting - crkkos


Did you try to use the method 2 ??
0 Kudos
Steven_L_Intel1
Employee
1,214 Views
Quoting - Peter

Did you try to use the method 2 ??
Peter, he's using Linux where the original posts do not apply.
0 Kudos
Reply