Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

/fast option

MiB1980
Beginner
1,364 Views
I am trying to optimize my code and using /fast option.
I get the following error :
libifcoremt.lib(libifcoremain.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main

What does this error mean ?
0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,364 Views
Sigh - should have realized that would do no good - the .obj files just contain intermediate language for IPO.

At this point I will ask you to try this with a current, supported release,preferably 11.1. If you can't do that, then I suggest disabling /Qipo for this project. It may be that it is doing something inappropriate for your main program.

View solution in original post

0 Kudos
10 Replies
TimP
Honored Contributor III
1,364 Views
Quoting - MiB1980

libifcoremt.lib(libifcoremain.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main


This appears to mean that you don't have a successfully compiled Fortran main program in your object file list.
0 Kudos
MiB1980
Beginner
1,364 Views
The program compiles when I dont use the /fast option. Is there any particular reason for the IVF to give this error when using the /fast option?


0 Kudos
Steven_L_Intel1
Employee
1,364 Views
I can't imagine what /fast would do that would prevent you from linking. Does this happen to all programs or just one (or some)?

/fast is just shorthand for a set of options that can improve performance, at the expense of compile time. It also sets /arch:host (in 11.x) which means the program typically needs to run on the same system that compiled it.
0 Kudos
MiB1980
Beginner
1,364 Views
I am linking three other static library projects as dependencies with my main ( different name) program

The three libraries compile with /fast option but not the main program.


A similar scheme (libraries + main + /fast) succeeds on the same machine for some other solutions.


I can't imagine what /fast would do that would prevent you from linking. Does this happen to all programs or just one (or some)?

/fast is just shorthand for a set of options that can improve performance, at the expense of compile time. It also sets /arch:host (in 11.x) which means the program typically needs to run on the same system that compiled it.

0 Kudos
Steven_L_Intel1
Employee
1,364 Views
Please do this. In your main project, go to the Linker > General property page and select Show Progress Messages to "Show all progress messages (/verbose)". Do a rebuild of the main project. Go into the Release subfolder and find buildlog.htm. Zip it and attach the ZIP to a reply here (see below for atachment instructions.)
0 Kudos
MiB1980
Beginner
1,364 Views
Attaching the zip here...

Please do this. In your main project, go to the Linker > General property page and select Show Progress Messages to "Show all progress messages (/verbose)". Do a rebuild of the main project. Go into the Release subfolder and find buildlog.htm. Zip it and attach the ZIP to a reply here (see below for atachment instructions.)

0 Kudos
Steven_L_Intel1
Employee
1,364 Views
Thanks. I see you are using 9.1. You've also added /QxN /QaxN, which seems rather pointless to me - especially as /fast overrides those (though I've forgotten what 9.1 uses instead.)

There are also two unresolved references to MATVEC and MSOLVE - where are those defined? Can you attach main.obj?

What happens if you replace /fast with /Qipo? Remove the /QaxN - it isn't doing anything useful for you.
0 Kudos
MiB1980
Beginner
1,364 Views
Thanks a lot for your help...

(I have removed the /QxN and /QaxN options)

/fast and /Qipo gives the same results.

MATVEC and MSOLVE are subroutines defined in the same main project. When I dont use the /fast option I dont see the unresolved warning in the build log. I am attaching the main.obj here.




Thanks. I see you are using 9.1. You've also added /QxN /QaxN, which seems rather pointless to me - especially as /fast overrides those (though I've forgotten what 9.1 uses instead.)

There are also two unresolved references to MATVEC and MSOLVE - where are those defined? Can you attach main.obj?

What happens if you replace /fast with /Qipo? Remove the /QaxN - it isn't doing anything useful for you.

0 Kudos
Steven_L_Intel1
Employee
1,365 Views
Sigh - should have realized that would do no good - the .obj files just contain intermediate language for IPO.

At this point I will ask you to try this with a current, supported release,preferably 11.1. If you can't do that, then I suggest disabling /Qipo for this project. It may be that it is doing something inappropriate for your main program.
0 Kudos
MiB1980
Beginner
1,364 Views
It works in 11.1...

Thanks for the help..

Sigh - should have realized that would do no good - the .obj files just contain intermediate language for IPO.

At this point I will ask you to try this with a current, supported release,preferably 11.1. If you can't do that, then I suggest disabling /Qipo for this project. It may be that it is doing something inappropriate for your main program.

0 Kudos
Reply