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

Multiple versions of fortran and MS visual studio

Timothy_H_
Beginner
1,288 Views

Hi,

I'm writing some fortran subroutines and linking them to a commercial code. The code is in the form of a library, and it was compiled with intel fortran  parallel studio XE 2013, with MS Visual Studio 2010.

I set up MS Visual Studio 2013 (with the added SDK) and I got an evaluation version of Intel Parallel Studio XE 2015 Composer Edition for Fortran Windows.  I got that to install and compiled the fortran files, and when I try to link everything up into an executable (using a makefile and MS incremental linker version 12.00.21005.1) ) I get the following:

LINK : Fatal error LNK1104: cannot open file 'LIBCMT.lib'

NMAKE :  Fatal error U1077:  'ifort' : return code '0x450'

I've tried tracking down the directories for the libraries and adding them to the LIB environment variable, but wound up with conflicts. The vendor of the commercial code is not inclined to re-compile with the newer versions, so I've re-installed MS Visual Studio 2010 and I want to install the 2013 version of the intel fortran compiler.

Questions:
a) is there a fix I can apply to my current set-up to resolve the library references in the older (2013) version of intel fortran (which is how the vendor-supplied code was compiled) ?

b) I'm planning to install the older version of fortran - MS visual studio 2010 and intel fortran 2013. Will the versions coexist on the same windows box?  That is, can I have the intel fortran compiler 2013 and the Microsoft visual studio 2010 linked up, and also have the intel fortran 2015 compiler and the Microsoft visual studio 2013 linked up, on the same machine?  or do I need to uninstall the newer versions before I install the older versions?

Thanks for any wisdom you can supply,

Tim

 

 

 

0 Kudos
5 Replies
TimP
Honored Contributor III
1,288 Views

a)  I guess you may have tried to combine /MD mode, which is the default for latest ifort, with /MT, which it seems was used for your vendor-supplied code.  If you would set all your 2015 builds to /MT, and use 2015 to link, you should be able to link with the 2013 /MT objects.

b) The older and newer VS and ifort versions you quote should be capable of coexisting.

0 Kudos
TimP
Honored Contributor III
1,288 Views

a) try setting all your 2015 stuff to /MT for consistency with the vendor builds

b) they should all coexist

0 Kudos
Steven_L_Intel1
Employee
1,288 Views

For your question about multiple versions, see How can I use multiple versions of the compiler in Microsoft Visual Studio*?

However, the "cannot open file LIBCMT.lib" has nothing to do with which versions you're using - it's that the library paths are not correctly set up. That is a Visual C++ library. It should have been found automatically if the compiler install found Visual Studio.

You cannot (reliably) link objects compiled with one version of Fortran with the run-time libraries of an older version, but there is no problem mixing compiled objects and libraries as long as you use the newest version to link.

I don't think your problem had to do with mixing library kinds, as Tim suggests.

0 Kudos
Timothy_H_
Beginner
1,288 Views

Installed MS visual studio 2010and Intel fortran XE 2013, and now the link throws this error:

 

NMAKE: fatal error U1077: 'ifort' : return code '0xc0000135'

 

Any help will be gratefully received.  What are the right path and LIB settings?

Thanks

Tim

0 Kudos
Steven_L_Intel1
Employee
1,288 Views

In which order did you install these? You should not have to manually set the paths. How are you invoking the build? nmake is not usually involved.

0 Kudos
Reply