From: marcomarco76 on
Hi everybody,
I'm using IVF 9.1 with MSVS 2005 and I'm experiencing a strange
problem. I've got a program composed by several subroutines (each in a
different file) and it works very well. Now I'm trying to merge all
the code in a single file and I receive this message

1>------ Inizio generazione: Progetto: AIEM - single scattering -
final, Configurazione: Debug Win32 ------
1>Compiling with Intel Fortran 9.1 C:\Programmi\Intel\Compiler\Fortran
\9.1\IA32\...
1>AIEM_final.F90
1>ifort: Command line warning: overriding '/Qvc7.1' with '/Qvc8'
1>Linking...
1>AIEM_final.obj : error LNK2019: riferimento al simbolo esterno
_D_ERFC non risolto nella funzione _B6
1>Debug/AIEM - single scattering - final.exe : fatal error LNK1120: 1
esterni non risolti
1>
1>Build log written to "file://C:\Documents and Settings\Decsar
\Documenti\Fortran\AIEM - single scattering - final\Debug
\BuildLog.htm"
1>AIEM - single scattering - final build failed.
1>
========== Generazione: 0 completate, 1 non riuscite, 0 aggiornate, 0
ignorate ==========


The function with the problem is



DOUBLE PRECISION function Shadowing_single(a)
USE costanti_AIEM, ONLY : pi, k1, sds, theta_s, theta_i, L
!USE IMSL_LIBRARIES
USE ERFC_INT
implicit none


DOUBLE PRECISION :: a, lambda_S, lambda_I, sds1

sds1=dsqrt(2d0*(sds/L)**2d0)

lambda_S=0.5d0 * (dsqrt(2d0/pi) * sds1 * dtan(theta_s) * dexp(-1d0/
(2d0*(sds1**2d0)*(dtan(theta_s))**2d0) ) )&
-(erfc(1d0/(dsqrt(2d0)*sds1*dtan(theta_s))))

lambda_I=0.5d0 * (dsqrt(2d0/pi) * sds1 * dtan(theta_i) * dexp(-1d0/
(2d0*sds1**2d0*(dtan(theta_i))**2d0) ) )&
-(erfc(1d0/(dsqrt(2d0)*sds1*dtan(theta_i))))


Shadowing_single = 1d0/( lambda_S+lambda_I+1d0 )

return
end function


Sometimes I receive this kind of message even when I switch from
single to double precision.
I'm a newby and I don't know if this is a stupid problem or not.

Does someone knows the solution?

Marco

From: mecej4 on
marcomarco76(a)gmail.com wrote:
> Hi everybody,
> I'm using IVF 9.1 with MSVS 2005 and I'm experiencing a strange
> problem. I've got a program composed by several subroutines (each in a
> different file) and it works very well. Now I'm trying to merge all
> the code in a single file and I receive this message

There is nothing "strange" here; just an everyday undefined external.

> 1>------ Inizio generazione: Progetto: AIEM - single scattering -
> final, Configurazione: Debug Win32 ------
> 1>Compiling with Intel Fortran 9.1 C:\Programmi\Intel\Compiler\Fortran
> \9.1\IA32\...
> 1>AIEM_final.F90
> 1>ifort: Command line warning: overriding '/Qvc7.1' with '/Qvc8'
> 1>Linking...
> 1>AIEM_final.obj : error LNK2019: riferimento al simbolo esterno
> _D_ERFC non risolto nella funzione _B6

Look for a function call to D_ERFC within your function B6.

> 1>Debug/AIEM - single scattering - final.exe : fatal error LNK1120: 1
> esterni non risolti
> 1>
<<-- CUT -->>

> Does someone knows the solution?
>
> Marco
>

-mecej4
From: marcomarco76 on
Thanks for reply,
the "guilty" function is erfc which belong to the IMSL library. It
should be enough write "USE ERFC_INT" (at least this say the example
in the IMSL fortran user's guide). Maybe the problem is in the project
settings? I mean: the project (or something else) isn't properly
configured to use the imsl library? If so I don't know what to do.

Marco


From: jwm on
On Aug 31, 11:48 am, marcomarc...(a)gmail.com wrote:
> Thanks for reply,
> the "guilty" function is erfc which belong to the IMSL library. It
> should be enough write "USE ERFC_INT" (at least this say the example
> in the IMSL fortran user's guide). Maybe the problem is in the project
> settings? I mean: the project (or something else) isn't properly
> configured to use the imsl library? If so I don't know what to do.

The error comes from the linker, not the compiler. USE ERFC_INT is OK
for the compiler, but the linker requires the path and name of the
libraries to be used.

Check the menu "Tools>Options>Intel(R) Fortran" to see if the VNI
entries are set correctly for executables ($(VNI_DIR)\bin\$
(LIB_ARCH)), libraries ($(VNI_DIR)\lib\$(LIB_ARCH)) and include files
($(VNI_DIR)\include\$(LIB_ARCH)); ---where VNI_DIR is the path of your
Visual Numerics installation and LIB_ARCH is the target architecture
(IA32, IA64, etc.). Alternatively, you can set the libraries and
include paths in the settings for your project; set them in the
Additional include (or library) directories in the Fortran>General (or
Linker>General) property pages.

There should be some C/C++ header files in the include folder of your
VNI installation (something like link_????.h). Pick the one you want
to use (static or dll, etc.) and add an include line below the "USE
ERFC_INT"; it might be something like

USE ERFC_INT
include "link_f90_static.h"

Or, alternatively, the names of the libraries included in the
link_????.h file can go in the "Linker>Input>Additional dependencies"
section of the property pages for the project.


I hope that helps.

From: Steve Lionel on
On Aug 31, 1:48 pm, marcomarc...(a)gmail.com wrote:
> Thanks for reply,
> the "guilty" function is erfc which belong to the IMSL library. It
> should be enough write "USE ERFC_INT" (at least this say the example
> in the IMSL fortran user's guide). Maybe the problem is in the project
> settings? I mean: the project (or something else) isn't properly
> configured to use the imsl library? If so I don't know what to do.

Please read the section of the on-disk documentation regarding using
IMSL from the Visual Studio environment. You can find it under
Building Applications > Using Libraries > Using the IMSL Libraries.

Generally, you need to add the path to the IMSL libraries under Tools
> Options > Intel Fortran > Library Files and add an INCLUDE of the
appropriate link_f90_xxx.h file in your source. (For version 10, this
changes to link_fnl_xxx.h.)

If you need further help, please contact Intel Premier Support.

Steve Lionel
Developer Products Division
Intel Corporation