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

unable to start application with include 'link_fnl_shared.h'

mahotait
Beginner
2,534 Views

I am trying to use IMSL to solve a system of nonlinear equations, this is the test code I am using:

program main

include 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libguide.lib'

USE NEQNF_INT
USE UMACH_INT

IMPLICIT NONE
! Declare variables
character(len=100) input
INTEGER N
PARAMETER (N=3)
!
INTEGER K, NOUT
REAL FNORM, X(N), XGUESS(N)
EXTERNAL FCN
! Set values of initial guess
! XGUESS = ( 4.0 4.0 4.0 )
!
DATA XGUESS/4.0, 4.0, 4.0/
!
!
CALL UMACH (2, NOUT)
! Find the solution
CALL NEQNF (FCN, X, xguess=xguess, fnorm=fnorm)
! Output
WRITE (NOUT,99999) (X(K),K=1,N), FNORM
99999 FORMAT (' The solution to the system is', /, ' X = (', 3F5.1, &
')', /, ' with FNORM =', F5.4, //)
!

write(*,*) 'Press any key + ENTER to CONTINUE'
read(*,*) input
end program main

! User-defined subroutine
SUBROUTINE FCN (X, F, N)
INTEGER N
REAL X(N), F(N)
REAL EXP, SIN
INTRINSIC EXP, SIN
!
F(1) = X(1) + EXP(X(1)-1.0) + (X(2)+X(3))*(X(2)+X(3)) - 27.0
F(2) = EXP(X(2)-2.0)/X(1) + X(3)*X(3) - 10.0
F(3) = X(3) + SIN(X(2)-2.0) + X(2)*X(2) - 7.0
RETURN
END

Compliation is fine; however, when running I am getting an error message of acces violation.. so when I change include 'link_fnl_static.h' to include 'link_fnl_shared.h' I am getting the message: "unable to start application". The same message i get when using 'libiomp5md.lib' instead of 'libguide.lib'. Any ideas?

Thanks,

0 Kudos
1 Solution
Steven_L_Intel1
Employee
2,534 Views

Ok, that explains it. Add:

%IFORT_COMPILER10%\IA32\LIB

to PATH.

View solution in original post

0 Kudos
17 Replies
Steven_L_Intel1
Employee
2,534 Views
Remove the !DEC$ OBJCOMMENT line if you are using the shared IMSL libraries. However, I can't reproduce the problem on my system. Are you running this on the same system you built it on? Please attach the buildlog.htm from a rebuild of the project.
0 Kudos
mahotait
Beginner
2,534 Views

yeah, i am running it on the same system. I tried to remove the !DEC$ OBJCOMMENT line and I am still getting the same error, not able to run application. i attached the buildlog.htm file.

Thanks Steve,

0 Kudos
mahotait
Beginner
2,534 Views

I think the file did not go through; here is the link:

http://software.intel.com/file/25266

Thanks,

mahotait

0 Kudos
Steven_L_Intel1
Employee
2,534 Views

Ah - VERY helpful.

In your project properties, select Fortran > External Procedures. Change Calling Convention to Default.

Normally, use of CVF conventions wouldn't hurt use of IMSL when you USE the modules, but programs with callbacks are sensitive to the calling convention. IMSL requires that any callback procedures use the compiler's default convention, which is "not STDCALL". This is mentioned in my article "Migrating from CVF".

0 Kudos
mahotait
Beginner
2,534 Views

Great! I got it working perfectly with:

include 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libguide.lib'

after changing the calling convention to default. However, I am still getting the "unable..." error when I am either including 'libiomp5md.lib' instead of 'libguide.lib' or when I just use the shared.h! I am still confused about the different between the two!

Thanks again Steve,

mahotait

0 Kudos
Steven_L_Intel1
Employee
2,534 Views

Do not use libguide.lib - it is for the "legacy" version of the OpenMP libraries and is not compatible with IMSL in version 11 or 11.1. Use libiomp5md.lib (recommended) or libiomp5mt.lib.

Does your PATH environment variable include the compiler LIB folder?

0 Kudos
mahotait
Beginner
2,534 Views

yeah, i included it in the fortran linker if that is what you meant. The problem is not in reading the library because it is opening the file during compilation.

Thanks,

mahotait

0 Kudos
Steven_L_Intel1
Employee
2,534 Views

No, that's not what I meant. Compilation is not relevant here - the DLL has to be in a folder named in the system PATH environment variable or else Windows won't find it. By default the folder is added to PATH by the install.

What is the definition of PATH (not from a Fortran Build Environment command prompt)?

0 Kudos
mahotait
Beginner
2,534 Views

Oh, I see.. this is the definition of the PATH on my system:

C:\Program Files (x86)\VNI\imsl\fnl600\IA32\lib;C:\Program files\MPICH2\bin;C:\Program Files (x86)\VNI\imsl\fnl600\Intel64\lib;C:\Program files\MPICH2\bin

Thanks,

0 Kudos
Steven_L_Intel1
Employee
2,534 Views
That's probably only the user part. What is the System value of PATH?
0 Kudos
mahotait
Beginner
2,534 Views

this is the system PATH:

C:\Program Files\Intel\MKL\10.0.1.015\em64t\bin;C:\Program Files (x86)\VNI\imsl\fnl600\IA32\lib;C:\Program files\MPICH2\bin;C:\Program Files (x86)\VNI\imsl\fnl600\Intel64\lib;C:\Program files\MPICH2\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\Common\Msdev98\BIN;C:\Program Files\Microsoft Visual Studio\DF98\BIN;C:\Program Files\Microsoft Visual Studio\VC98\BIN;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2009a\bin;C:\Program Files\MATLAB\R2009a\bin\win64;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;%IFORT_COMPILER10%\EM64T\Lib;C:\Program Files (x86)\Common Files\DivX Shared\;C:\Program Files (x86)\SAS\SharedFiles\Formats;C:\Program Files (x86)\QuickTime\QTSystem\

Thanks,

mahotait

0 Kudos
Steven_L_Intel1
Employee
2,534 Views

I see the version 10 path in thetre but not version 11. Which version are you using?

I expect to see:

%IFORT_COMPILER11%\LIB\intel64;%IFORT_COMPILER11%\LIB\ia32

The DF98 and VC98 folders should come out, unless you are still using CVF.

0 Kudos
mahotait
Beginner
2,534 Views

I am using version 10 with VS2005.

mahotait

0 Kudos
Steven_L_Intel1
Employee
2,534 Views

Ok. In that case, for the static library, you should be using libguide.lib. libiomp5md doesn't exist in 10.0. 10.0 is no longer supported.

Are you building a 32-bit or 64-bit application?

0 Kudos
mahotait
Beginner
2,534 Views

a 32-bit application.

Thanks,

mahotait

0 Kudos
Steven_L_Intel1
Employee
2,535 Views

Ok, that explains it. Add:

%IFORT_COMPILER10%\IA32\LIB

to PATH.

0 Kudos
mahotait
Beginner
2,534 Views

Thanks a lot! It works.

mahotait

0 Kudos
Reply