error LNK2001: unresolved external symbol

error LNK2001: unresolved external symbol

Hi

I convert one CVF's project to IVF's project.

Then I found some error linking showing:

***.obj : error LNK2001: unresolved external symbol _SYSTEM@8

or error LNK2001: unresolved external symbol _IERRNO@0

These ***.obj are all for module files.

I use some IMSL functions and I have set the "library" and "include". There are no errors relating IMSL libraries.

Thank you in advance.

MikeLiu

61 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

I use Visual Studio 2008.

Another question is, when I switch to another solution and switch back to the solution using File->Recent Projects, build solution again, it shows that if I want to save as a new ***.sln. I am wondering why? Then after I save it as a new solution, build solution it again , then it shows "1>Embedding manifest...
1>mt.exe : general error c10100b1: Failed to load file ......"

I try to Rebuilt but same error appears.

MikeLiu

I went back to my old CVF project and convert it again, then I build it.

It shows several link errors as my orginal post here.

Oh this time, after I read the White Paper, I remeber to extract CVF's components.

MikeLiu

Oh, this is my first time to convert CVF to IVF for a project containing 66 source files.

Really sorry for this to stupid reply to myself.

I found the IMSL functions are changed. I need some time to modify them.

MikeLiu

After a few trial, I fixed some IMSL problems, but still remains the following:

1>------ Build started: Project: XXXXX, Configuration: Debug Win32 ------
1>Linking...
1>imsl.lib(cdgrd.obj) : error LNK2019: unresolved external symbol _SCOPY referenced in function _CDGRD
1>imsl.lib(r2ivn.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsl.lib(girts.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsl.lib(csfrg.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_global_thread_num referenced in function _E1LOCK
1>imsls_err.lib(umach.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1ucs.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1pos.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rty.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1init.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rcd.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1usr.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(r2ivn.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1psh.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1str.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(umach.obj) : error LNK2019: unresolved external symbol ___kmpc_threadprivate_cached referenced in function _UMACH
1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1ucs.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1pos.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(n1rty.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1init.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(n1rcd.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate
_cached
1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1usr.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r2ivn.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1psh.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1str.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r2ivn.obj) : error LNK2019: unresolved external symbol _SROTM referenced in function _R2IVN
1>imsl.lib(r2ivn.obj) : error LNK2019: unresolved external symbol _SSCAL referenced in function _R2IVN
1>imsl.lib(r2tdb.obj) : error LNK2001: unresolved external symbol _SSCAL
1>imsl.lib(girts.obj) : error LNK2001: unresolved external symbol _SSCAL
1>imsl.lib(girts.obj) : error LNK2019: unresolved external symbol _SGER referenced in function _GIRTS
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_critical referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_flush referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_end_critical referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_set_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_set_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_unset_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_unset_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_init_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_init_nest_lock referenced in function _E1LOCK
1>XXXXX.exe : fatal error LNK1120: 15 unresolved externals
1>

I've checked the Linker->Input and find there are kernel32.lib, three imsl libraries and one myBuild.lib which I also rebuild it by IVF now.

MikeLiu

chliuIntel:

Hi

I convert one CVF's project to IVF's project.

Then I found some error linking showing:

***.obj : error LNK2001: unresolved external symbol _SYSTEM@8

or error LNK2001: unresolved external symbol _IERRNO@0

These ***.obj are all for module files.

I use some IMSL functions and I have set the "library" and "include". There are no errors relating IMSL libraries.

Thank you in advance.

MikeLiu

The error seems caused by incorrect calling convention setting in the new project. Can you try to to go to "Project Properties Dialog -> Fortran -> External Procedures -> Calling Convention" and set it to "Default"?

MADxduan:
chliuIntel:

Hi

I convert one CVF's project to IVF's project.

Then I found some error linking showing:

***.obj : error LNK2001: unresolved external symbol _SYSTEM@8

or error LNK2001: unresolved external symbol _IERRNO@0

These ***.obj are all for module files.

I use some IMSL functions and I have set the "library" and "include". There are no errors relating IMSL libraries.

Thank you in advance.

MikeLiu

The error seems caused by incorrect calling convention setting in the new project. Can you try to to go to "Project Properties Dialog -> Fortran -> External Procedures -> Calling Convention" and set it to "Default"?

I've done it but still shows the following errors:

1>imsl.lib(cdgrd.obj) : error LNK2019: unresolved external symbol _SCOPY referenced in function _CDGRD
1>imsl.lib(r2ivn.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsl.lib(girts.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsl.lib(csfrg.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_global_thread_num referenced in function _E1LOCK
1>imsls_err.lib(umach.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1ucs.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1pos.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rty.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1init.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(n1rcd.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1usr.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsl.lib(r2ivn.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1psh.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1str.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_global_thread_num
1>imsls_err.lib(umach.obj) : error
LNK2019: unresolved external symbol ___kmpc_threadprivate_cached referenced in function _UMACH
1>imsls_err.lib(e1inpl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1ucs.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1prt.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(n1rgb.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1pos.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(n1rty.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1stl.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1init.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(n1rcd.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1pop.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1usr.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1sti.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r2ivn.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1psh.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1str.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsls_err.lib(e1mes.obj) : error LNK2001: unresolved external symbol ___kmpc_threadprivate_cached
1>imsl.lib(r2ivn.obj) : error LNK2019: unresolved external symbol _SROTM referenced in function _R2IVN
1>imsl.lib(r2ivn.obj) : error LNK2019: unresolved external symbol _SSCAL referenced in function _R2IVN
1>imsl.lib(r2tdb.obj) : error LNK2001: unresolved external symbol _SSCAL
1>imsl.lib(girts.obj) : error LNK2001: unresolved external symbol _SSCAL
1>imsl.lib(girts.obj) : error LNK2019: unresolved external symbol _SGER referenced in function _GIRTS
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_critical referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_flush referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_end_critical referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_set_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_set_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_unset_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_unset_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol ___kmpc_init_nest_lock referenced in function _E1LOCK
1>imsls_err.lib(e1lock.obj) : error LNK2019: unresolved external symbol _omp_init_nest_lock referenced in function _E1LOCK

Do I still need to have "kernel32.lib&nbsp
;imsl.lib imsls_err.lib imslmpistub.lib" in the Project properties->Linker->Input->Additional Dependencies?

Thank you very much for your reply.

MikeLiu

The problem with the calls to SYSTEM, etc., is that you converted a CVF project so that the default calling conventions are CVF's, but you did not have USE DFPORT to bring in the declarations of those so the compiler assumed the calling conventions were the same. You are probably safe to go into the project properties, Fortran > External Procedures and set the calling convention to "Default" and the string length argument passing to "".

For IMSL, please also add this line to your main program source:

!DEC$ OBJCOMMENT LIB:"libguide.lib"

Steve - Intel Developer Support

MADsblionel:The problem with the calls to SYSTEM, etc., is that you converted a CVF project so that the default calling conventions are CVF's, but you did not have USE DFPORT to bring in the declarations of those so the compiler assumed the calling conventions were the same. You are probably safe to go into the project properties, Fortran > External Procedures and set the calling convention to "Default" and the string length argument passing to "".

For IMSL, please also add this line to your main program source:

!DEC$ OBJCOMMENT LIB:"libguide.lib"

I used:

USE IFPORT
in

calling SYSTEM & IERRNO. Now I don't have errors of them.

I have done:

include 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libguide.lib'
in some IMSL's functions such as CDGRD, but thereare still errors:

imsl.lib(cdgrd.obj) : error LNK2019: unresolved external symbol _SCOPY referenced in function _CDGRD
1>imsl.lib(r2ivn.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsl.lib(girts.obj) : error LNK2001: unresolved external symbol _SCOPY
1>imsl.lib(csfrg.obj) : error LNK2001: unresolved external symbol _SCOPY

....

I find SCOPY is also a function of IMSL.

ps.

I have also found the arguments of new IMSL are different to the CVF's IMSL.

I also modified them.

MikeLiu

Does "inherit from project defaults>" show "After All Arguments"?

When I click it, it turns to "After All Arguments".

MikeLiu

Oh, it works.

I forgot also put the following lines to the main program:

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

So, if these two lines are so important for converting CVF's project to IVF's project, may I put them before PROGRAM?

Set them as global. Then will they be seen in every module?

Thank you very much.

MikeLiu

Those lines may NOT be placed before PROGRAM, but you need them in only one source, it doesn't matter which one.

Those lines are not part of "CVF conversion" directly. They are required to use IMSL 6 when you want static linking. CVF had IMSL 4 which used a different method of specifying libraries and had fewer options.

I will comment that you'll probably have to change or remove the OBJCOMMENT line once you get 11.0 and the updated IMSL.

Steve - Intel Developer Support

I have tried to use IMSL library to solve a linear optimization (using DLPRS). but I receive the following errors in Compaq visual fortran:

LPTEST.obj : error LNK2001: unresolved external symbol _SSCAL@16

 LPTEST.obj : error LNK2001: unresolved external symbol _DLPRS@52

LPTEST.obj : error LNK2001: unresolved external symbol _UMACH@8

Debug/LPTEST.exe : fatal error LNK1120: 3 unresolved externals

Error executing link.exe.

 

what should I do?

 

 I have attached the code too.

Fichiers joints: 

Fichier attachéTaille
Télécharger lptest.f90626 octets

Which version of CVF and IMSL did you use? How did you attempt to build?

Your program builds and runs fine with CVF6.6C and the IMSL4 that came with it.

Thanks a lot for your reply. I have CVF professional Edition 6.5.0. I did not really know from where I could check the version of IMSL. but I have attached the pdf of IMSL which is related to my installed CVF.  Maybe you can help me with finding the version of my IMSL?

If these errors apear because of the version of my CVF do you have any opinion about how to do LP with my current verison of CVF? or how to solve the errors?

Fichiers joints: 

Fichier attachéTaille
Télécharger math.pdf4.69 Mo

The PDF document files are not always revised when the software is, so one cannot rely upon the PDF file to find the IMSL version. Page 5 of your math.pdf lists the version as 3.0. The math.pdf file that I have also shows 3.0, although the PDF file is a bit different. There is an IMSL inquiry subroutine called VERML, which you can use to find the version number of your installation. My version was listed by this subroutine as "IMSL Fortran 90 MP Library Version 4.01".

How did you compile and link your linear program application lptest.f90? In particular, what was the command line used to link?

If I have understood your question well, I should have used a line in my program to link my code to the library to be able to use the required functions. I added the line "USE IMSL" but I received 3 other errors as follows when compiling it:

--------------------Configuration: LPTEST - Win32 Debug-------------------- Compiling Fortran...

C:\Documents and Settings\Administrator\Desktop\LPTEST.f90 C:\Documents and Settings\Administrator\Desktop\LPTEST.f90(6) : Error: The attributes of this name conflict with those made accessible by a USE statement.   [DLPRS] EXTERNAL DLPRS, SSCAL, UMACH ---------^

C:\Documents and Settings\Administrator\Desktop\LPTEST.f90(6) : Error: The attributes of this name conflict with those made accessible by a USE statement.   [SSCAL] EXTERNAL DLPRS, SSCAL, UMACH ----------------^

C:\Documents and Settings\Administrator\Desktop\LPTEST.f90(6) : Error: The attributes of this name conflict with those made accessible by a USE statement.   [UMACH] EXTERNAL DLPRS, SSCAL, UMACH -----------------------^ Error executing df.exe.

LPTEST.obj - 3 error(s), 0 warning(s)

 If you have any other suggestions about the command lines I should use to solve the problems, I'll be glad to test them.

also about the version of my IMSL, I tried to use the VERML subroutine but I was not successful. Could you please tell me how exactly can I find or use this subroutine?

 

Thanks in advance

 

 

If you provide interfaces to IMSL routines by adding statements such as "USE IMSL", you must not list the same routines in EXTERNAL declarations. Secondly, USE statements do not cause the compiler to include the IMSL libraries in the link step. You must explicitly add the imsl libraries in the IDE under Project Settings-Link-Object Libraries/Modules, or add the IMSL libraries to the linker command line.

Here is a modified version of the program in the IMSL manual for printing the version:

program IMSLVER
 INTEGER ISELCT, NOUT
 CHARACTER STRING(4)*50, TEMP*132, VERML*132
 EXTERNAL UMACH, VERML
C
 STRING(1) = '('' IMSL MATH/LIBRARY Version Number: '',A)'
 STRING(2) = '('' Operating System ID Number: '', A)'
 STRING(3) = '('' Fortran Compiler Version Number: '', A)'
 STRING(4) = '('' IMSL MATH/LIBRARY Serial Number: '', A)'
C Print the versions and numbers.
 CALL UMACH (2, NOUT)
 DO 10 ISELCT=1, 4
 TEMP = VERML(ISELCT)
 WRITE (NOUT,STRING(ISELCT)) TEMP
 10 CONTINUE
 END

 now I delete the "USE IMSL" from the code. Under Project Settings-Link-Object Libraries/Modules I had "kernel32.lib". I deleted it and added "IMSL.lib" instead. now I receive the following error:

Linking... LINK : fatal error LNK1104: cannot open file "IMSL.obj" Error executing link.exe.

the second way you suggested was to add the IMSL libraries to the linker command line. Could you please explain more about this way? where is the linker command line?

 

There is no file called imsl.obj in a CVF 6.6 installation. You could have mistyped "obj" instead of "lib" somewhere.

Open a CVF Fortran Command Prompt window. Change to the directory containing the Fortran source, and enter the command

df lptest.f90 imsl.lib imsls_err.lib imslmpistub.lib

Thanks so much. In my LPTEST.f90 I deleted the line "external..." and I added the "USE IMSL" and then I got the results.

but still I like to search the verison of my IMSL. So I used the same trick about the verlm subroutine code you provided me (I deleted the line "EXTERNAL UMACH, VERML" and added "USE IMSL"). but still I receive the following error:

Error: The attributes of this name conflict with those made accessible by a USE statement.   [VERML].

 thats because in line :"CHARACTER STRING(4)*50, TEMP*132, VERML*132 " I have again "VERML". I tried to add library using the two ways you suggested (adding IMSL.lib to project setting and using the CFV command window). the first did not show any changes in occured erros. and using the second way I received the following error:

verml.f90

f90:severe: no such file or directory  

the file is "VERLM.f90"

do you have any oppinion about these problems?

 

 

 

If you use USE IMSL..., you have to remove ", VERML*132" from the type declaration statement. Any "trick" or workaround is likely to be context dependent. If you change the context by adding a USE statement, the compiler will do its job and flag the newly redundant type declarations as errors.

 I removed ", VERML*132" from the type declaration statement. but I received the attached error after executing the program.

Fichiers joints: 

Fichier attachéTaille
Télécharger error-2.docx84.83 Ko

That variable (IMSLNT_F90) should have been set if you did your work in a CVF "Fortran Command Prompt". It should be set to the full path of the IMSL directory, which is under the DF98 directory. 

Thanks alot. I found DF98 directory but IMSLNT_F90 was not in that folder. How can I add it in that folder?

Quote:

sinereh a. wrote:

Thanks alot. I found DF98 directory but IMSLNT_F90 was not in that folder. How can I add it in that folder?

You misunderstand what needs to be done. You may need to read Windows/DOS documentation to learn about environmental variables.

If, for example, the DF98 directory has the full path C:\Program Files\Microsoft Visual Studio\DF98, you need to set the environmental variable IMSLNT_F90 to C:\Program Files\Microsoft Visual Studio\DF98\IMSL, either using the SET command in the command window, or using the System Properties->Advanced->Environmental Variables control panel (the specific panel varies slightly with the version of Windows).

thanks so much.

I have a line in my code:

WRITE (NOUT,9) OBJ, (XSOL(I),I=1,NVAR)

9 FORMAT (//, ’ Objective = ’, F9.4, //, ’ Primal Solution =’, 8F9.4)

which causes the following errors. I don't know why all of these errors occur. could you please help me with solving them?

 

Compiling Fortran...

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) --------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ----------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) -----------------------------------------^ C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ------------------------------------------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: A constant or general expression must appear in a format list in this context.   [Objective] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ----------------^ C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [j] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [c] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [v] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [=] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: The scale factor in the format list is either missing or invalid.   [PrimalSolution] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) -------------------------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [r] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [m] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [u] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [n] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [=] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^ Error

executing df.exe.

Please attach the source file LPTEST3.f90, or include it inline surrounded by Fortran language highlighting bracket tags. Merely quoting lines is not useful because embedded tabs, punctuation characters and other control characters in the source file seem to be causing the problem.

In the fortran you show there are quote marks around  'Objective =' which is correct in the error message it shows .Objective =.

 

9 FORMAT (//, ’ Objective = ’, F9.4, //, ’ Primal Solution =’, 8F9.4)
9 FORMAT (//, ' Objective = ', F9.4, //, ' Primal Solution =', 8F9.4)
 9 FORMAT (//, " Objective = ", F9.4, //, " Primal Solution =", 8F9.4)

This top line is cut from your post, the character is not a quote character, not sure what it is it is not on my UK keyboard, either of the lower two lines will work.

Thanks so much. The problem is solved now by correcting the quote characters.

My code is almost done. but there is still an error that I can not understand why it rises up! I have attached the code. could you please have a look at it?

the error is as below:

Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. The thread 0x714 has exited with code 0 (0x0). The program 'C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Debug\Bargaining_LP_check.exe' has exited with code 0 (0x0).

Thanks in advance.

 

Fichiers joints: 

Fichier attachéTaille
Télécharger bargaining-lp-check-2.f901018 octets

The program runs normally (from the Fortran point of view -- the exit code is zero).  If you run the program from a command window, you will see that the sixth call to DLPRS (on Line 114)  fails, with this error message:

*** FATAL ERROR 2 from DLPRS. Maximum number of iterations exceeded.

This failure has to do with whether the particular LP problem in this call is incorrectly defined or the algorithm fails. You may need to consult someone who is a LP specialist.

Yes thats right. This problem has results according to other linear programming methods (such as GAMS). But the fortran fails to give the results due to the maximum number of iterations exceed. now the issue is that I have to use Fortran for solving this problem because I have to link this LP model to another fortran model of mine. Do you have any opinion about how I can solve this LP with Fortran? or how I can change the maximum number of iterations allowed?

I even tried to solve my LP with another function of IMSL library but it gave me the similar error. I have attached that code too. If you can help me solve this error that would be fine too.

Thanks a lot.

Fichiers joints: 

Fichier attachéTaille
Télécharger idealpoint11test-nlp.f901.01 Ko

.

When you have a LP problem for which GAMS gave a solution but IMSL failed, there are two questions: (i) whether the same problem was given to the two solvers, and (ii). why are you comparing a 15 year old version of IMSL with (possibly) a current version of GAMS? Current versions of IMSL provide a newer routine for solving dense LP problems, called DENSE_LP.

The strategy of recasting an LP problem as an NLP problem in order to be able to try another solver is ill-advised, even if it succeeds, it is very inefficient. In your case, it also failed.

If you can post details of one small example where this happened (e.g., the fifth call to DLPRS), someone may be able to help you. Note, however, that at this stage the question belongs in an IMSL/Roguewave forum and not in a compiler forum.

thanks a lot. How may I use this DENSE_LP routine. I found an example of solving an LP with this routine but it seems my fortran does not support this routine. Should I install a newer version of CVF or add a newer IMSL to the current CVF?

 

You would need to purchase Intel Visual Fortran Composer XE 2013 with IMSL - this includes the DENSE_LP routine mentioned. Your CVF code should build ok with minor adjustments for the IMSL changes.  For more information on that see What are the differences between Compaq* Visual Fortran and Intel Visual Fortran? and Configuring Visual Studio for using the IMSL* Fortran Numerical Library.

If purchasing, ignore the choices that include "Runtime" in the product name. The commercial part number is FXI999WSGE01, Academic is FXI999WSAE01.

Steve - Intel Developer Support

Quote:

sinereh a. wrote:

thanks a lot. How may I use this DENSE_LP routine. I found an example of solving an LP with this routine but it seems my fortran does not support this routine. Should I install a newer version of CVF or add a newer IMSL to the current CVF?

 

The last version of CVF sold was 6.6C. DEC was bought by Compaq and Compaq by HP. CVF is no longer sold as a current product, and you cannot buy a current version of IMSL for it. It will probably be quite difficult to get other versions of IMSL to work with CVF.

To use DENSE_LP, you need to do three things to your code: (i) change all REAL variables to DOUBLE PRECISION, and do likewise with real constants; (ii) replace, for example,

CALL DLPRS (M, NVAR, A, LDA, B, B, C1, IRTYPE, XLB, XUB, OBJ1, X1, DSOL)
by
CALL DENSE_LP (A, B, B, C1, IRTYPE, OBJ1, X1, DSOL, XLB=XLB, XUB=XUB)
and (iii) Add "USE DENSE_LP_INT" to your program.

I did these changes in my program. But I receive the following error:

 

--------------------Configuration: Bargaining_LP_check_3 - Win32 Debug-------------------- C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(1): Could not find the file DENSE_LP_INT.mod. Compiling Fortran...

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90 C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(1) : Error: Error in opening the Library module file.   [DENSE_LP_INT] USE DENSE_LP_INT ----^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(38) : Error: Keyword arguments are invalid without an explicit interface.   [XLB] CALL DENSE_LP (AA2, BB2, BB2, C2, IRTYPEE, OBJ2, X2, DSOL, XLB=XLB, XUB=XUB) -----------------------------------------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(38) : Error: Keyword arguments are invalid without an explicit interface.   [XUB] CALL DENSE_LP (AA2, BB2, BB2, C2, IRTYPEE, OBJ2, X2, DSOL, XLB=XLB, XUB=XUB) --------------------------------------------------------------------^ Error executing df.exe.

Bargaining_LP_check_3.obj - 3 error(s), 0 warning(s)

I have attached the program too.

 

Fichiers joints: 

Fichier attachéTaille
Télécharger Bargaining_LP_check_3.f900 octets

I did these changes in my program. But I receive the following error:

 

--------------------Configuration: Bargaining_LP_check_3 - Win32 Debug-------------------- C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(1): Could not find the file DENSE_LP_INT.mod. Compiling Fortran...

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90 C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(1) : Error: Error in opening the Library module file.   [DENSE_LP_INT] USE DENSE_LP_INT ----^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(38) : Error: Keyword arguments are invalid without an explicit interface.   [XLB] CALL DENSE_LP (AA2, BB2, BB2, C2, IRTYPEE, OBJ2, X2, DSOL, XLB=XLB, XUB=XUB) -----------------------------------------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(38) : Error: Keyword arguments are invalid without an explicit interface.   [XUB] CALL DENSE_LP (AA2, BB2, BB2, C2, IRTYPEE, OBJ2, X2, DSOL, XLB=XLB, XUB=XUB) --------------------------------------------------------------------^ Error executing df.exe.

Bargaining_LP_check_3.obj - 3 error(s), 0 warning(s)

I have attached the program too.

 

DENSE_LP is not present in IMSL4. It is present in IMSL6 (available with Intel Fortran as an option; see Steve Lionel's response above) and IMSL7 (available from Roguewave).

I stated above that "Current versions of IMSL provide a newer routine for solving dense LP problems, called DENSE_LP."

Hello. Could you please help me with finding a fortran code for solving a constrained linear programming problem (having equlity and inequality constraints)? I have found one in net but it does not include the inequality constraints.

thanks in advance.

Several LP solvers are categorized and listed at Mittelman's page: http://plato.asu.edu/sub/nlores.html#LP-problem . In particular, see the freely available LP-Solve package http://lpsolve.sourceforge.net/ .

Thanks a lot.

I need to use RUNQQ command for linking a FORTRAN code with another one. But I have a problem. I have attached a simple example in which the problem occurs. When I run the "testrunqq.f90" file the "discrete2.f90" is executed itself using RUNQQ command. I have written in "discrete2.f90" that a result (y (6)) should be written in a text file (testout.txt). But this does not happen. What should I do for that? I cannot understand why this happens. Although if I run the “discrete2.f90" individually I get the appropriate result.

Thanks in advance.

Fichiers joints: 

Fichier attachéTaille
Télécharger discrete2.f90342 octets
Télécharger testrunqq.f9076 octets

I compiled the two programs at the command line and ran the second EXE file. It loaded and ran the first EXE and produced the output file with no problems.

I suspect that you are building and running using the IDE, and that the current working directory is not what you think it is. After a run which apparently failed to produce the testout.txt file, use a file search utility. You will probably find it somewhere within the project file tree.

I could not find the "testout" file anywhere in my computer. you said you suspect that I am building and running using the IDE. Could you explain about it more? I just open the "testrunqq.f90" and compile, build, and execute the code. No error is received but I can not find the output file.

Quote:

sinereh a. wrote:

you suspect that I am building and running using the IDE. Could you explain about it more? I just open the "testrunqq.f90" and compile, build, and execute the code. 

If you are doing that from within Visual Studio, that is what is meant by "using the IDE".  The alternative is to use a command window run the compiler and executable from the command line.

Pages

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui