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

Intel Fortran 8.1 and Microsoft Visual Studio 2003 working together

lmc
Beginner
1,545 Views
I am trying out the evaluation version of Intel Fortran 8.1. So far, I do not have a clue how to get it to work with MS VC++ 2003.
VC++ does not have a clue what to do with a .f file even though
it does say that Intel Fortran 8.1.2279.2003 is integrated. It thinks that .f files are for documentation !

Please note that my app is 10,000 lines of c code and 400,000 lines of f77 code.

Thanks,
Lynn
0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,545 Views
You need to create a Fortran project to compile Fortran files. In the VS.NET environment, projects are single-language only. When you create a project, select "Intel Fortran Projects" in the Project Types list and select the appropriate type from the "Templates" shown at the right.
If you have a mixed Fortran and C proiject, you have to create a solution with two projects, one Fortran and one C. The one that is not the main program should be a "Static Library" project type. You can then use the "Dependencies" setting to specify that the library is a dependent of the executable project.
0 Kudos
lmc
Beginner
1,545 Views
Wow ! This is going to be complicated. I have three mixed language DLLs, two f77 only executables and two c language executables to create. Adding static libraries to the mix sounds extremely painfull.

Thanks,
Lynn
0 Kudos
Steven_L_Intel1
Employee
1,545 Views
You can thank Microsoft for this, unfortunately...
Only the mixed-language DLLs will need a static library for one or the other languages. You may need to specify symbols under Linker..Force Symbol References in the DLL project to cause routines from the static lib to be linked in if they are not mentioned in the DLL project.
0 Kudos
lmc
Beginner
1,545 Views
If I make the C code as the project for the WIn32 DLL and the f77 code as the static library, will I be able to debug the .f code ?

BTW, I am able to mix .c and .cpp code in another VC++ created executable. So, I am surprised that I cannot mix .c and .f code in vc++. It really does not look good. I have even put .c and .cs code in the same exe so I am really having a hard time with this mixing of code problem.

THanks,
Lynn
0 Kudos
Steven_L_Intel1
Employee
1,545 Views
C and CPP are handled by the same MS compiler, much the way .f and .f90 is handled by the Fortran compiler.
Yes, you will be able to debug the mixed-language code.
0 Kudos
debussch
Beginner
1,545 Views
Hi Steve,

I am currently struggling with the same issue in MS Visual Studio.net 2003 and Intel Fortran 8.0. I do have my C++ files in one project, which has the main program. I have my f77 files in another project, which is set up as a static library.

Both projects compile fine, but during the link step, the C++ compiler complains about not being able to find some fortran specific core symbols. According to the documentation, I should link in libifcore.lib , but that only resulted in more unresolved symbols.

Am I going about this the wrong way?

Thanks,
Bert
0 Kudos
Steven_L_Intel1
Employee
1,545 Views
You're just missing one step - you need to add the Fortran library folder to the list of C++ library directories -again, MS puts a wall between the languages. This is specified under Tool..Options..Projects..VisualC++..Directories. Add C:Program FilesintelFortrancompiler80IA32LIB to the Libraries list.
0 Kudos
debussch
Beginner
1,545 Views
Hi Steve,
Thanks for your advice. It works now. The only other thing I had to do was enabling default library search rules for the fortran static library.
Thanks again,
Bert
0 Kudos
Steven_L_Intel1
Employee
1,545 Views
Ah, right. By default, that is disabled when building libraries, because one never knows which libraries the EXE wants to link with. I asked for this myself. But in the case of mixed-language programming, you'd probably want the default library option enabled.
0 Kudos
cmundi
Beginner
1,544 Views
Sorry to be joining this thread late. Like many I have clung to CVF knowing that I would eventually have to make a move. Like the original poster I have a mix of Fortran, C and C++. I need to understand what IVF can and can't do for me within the DevStudio and .NET environments. This business about having to make some of my libs static really got my attention!What can I readto educate myself on this before committing to IVF?
Thanks!
0 Kudos
Reply