Mixed language with Intel C++ and fortran and VS2010

Mixed language with Intel C++ and fortran and VS2010

I have successfully got a project going with VS2010 C/C++ and Intel Fortran thanks to help here but I want to compile essentially the same code on a second machine. This machine did not have VS C/C++ so we purchased Intel C/C++ and Intel Fortran. Both installed okay, but I am not having any luck getting the C++ into the fortran project at all. I can add the wrap.c to a fortran project, but it doesnt appear to get compiled. I cant create a C/C++ static library either when I have created a fortran solution.

Looking on web, it appears you have to have Visual Studio standalone before you can use Intel C/C++ inside it! I thought going all intel might reduce problems not increase them. Oh well. So... I could could presumably compile my c file from command line, but then what do I need to do in the VS fortran side to get this to link in? Do I have to create a static library from the command line as I do when Visual C/C++?

11 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Intel C++ requires Microsoft Visual C++ and this is called out explicitly in the marketing material, documentation and the warning put out by the installer. Also, since VS.NET 2002, it is not possible to mix languages in a project - the way you have to do this is have distinct projects for each language, typically one being a static library, and then combine them in a solution where the library gets linked into the main program. There are several examples of this provided with Intel Visual Fortran.
 

Retired 12/31/2016

Okay, I saw the warnings about not working with VS2010 shell, but didnt realize the compiler was dependent on MS C++ to quite that extent! That was problem doing evaluation on a machine with VS C++ installed. Dont have budget for buying a coy of MS studio immediately... If I compile the static C library on one machine, presumably I could link it on the other though?

>>>If I compile the static C library on one machine, presumably I could link it on the other though?
No, because Microsoft Visual C++ provides the linker.

patrick

Well, you might be able to link it, depending on which libraries it needs. The Fortran VS Shell has the linker and some of the C++ libraries, but only those needed for Fortran.

Retired 12/31/2016

Sigh. So standalone fortran has its own linker, but is want to link with a C static library, then you need a MS linker?

No - it is the same linker. But you may not have all the libraries referenced.

Retired 12/31/2016

Since the C only provides SEH (it simply calls back to Fortran), this it has to be worth a try. I assume just add the libary as additional dependency? I will give it a go...

Phew! That worked. I compiled CWRAP.lib on the VS2010 C++/Intel Fortran machine. Transferred the lib across and just added the lib as a source. Successfully linked. Not ideal, but perfectly workable for now.

Quote:

Steve Lionel (Intel) wrote:

No - it is the same linker. But you may not have all the libraries referenced.

Steve, I have had a related problem loading ifort 2013, as I needed to obtain the linker from an old install of ifort&VS. It is an older version of the linker, that was installed with ifort 2012 on another pc. What will happen if/when I install ifort 2014 ?

Why is the linker not provided with the ifort install ?

John

We do provide the linker if the VS Shell is part of the install. You need more than the linker, there are other tools plus Microsoft libraries that are required. We install all of those as part of the shell install. If you don't already have a supported Visual Studio installed, choose the Fortran install "including Microsoft Visual Studio Shell" and you'll get what you need. After that, you can select the updates that don't include the shell, though the online installer will just download the bits you need.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today