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

Fortran in Visual Studio, error: project created by later version of Fortan. help?!

nikablatt
Beginner
605 Views
Hello everybody,


i try to install the LAPACK library (written in Fortran) to use it Visual Studio 2008 C++ project (os: WinXP pro) and i use Intel Visual Fortran Composer XE 2011 for Windows for building.

i followed the guide for building LAPACK with cmake ( http://icl.cs.utk.edu/lapack-for-windows/lapack/index.html#build ), but at the point to click "configure" in cmake i get two errors:



1. an error-message from Microsoft Development Environment says:
The selected project was created by a later version of Intel Visual Fortan. It can not be loaded with this version.


2. in cmake:
Check for working Fortran compiler using: Visual Studio 9 2008

Check for working Fortran compiler using: Visual Studio 9 2008 -- broken

CMake Error at C:/Programme/CMake 2.8/share/cmake-2.8/Modules/CMakeTestFortranCompiler.cmake:40 (MESSAGE):

The Fortran compiler "C:/Programme/Intel/ComposerXE-2011/bin/ia32/ifort.exe" is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/lapack/lapack-3.3.0-build/CMakeFiles/CMakeTmp

Run Build Command:C:PROGRA~1MICROS~1.0Common7IDEdevenv.com
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec

Microsoft Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. Alle Rechte vorbehalten.

Mindestens ein Projekt in der Projektmappe konnte aus folgenden Grnden
nicht geladen werden:
/*One or more project could not be loaded for the reason:*/

Die Anwendung fr das Projekt wurde nicht installiert.
/*The application (or program) for the project is not installed.*/




so i took a look at the compiler and found that when i try to run fortcom -help in the cmd, i get this error:

"catastrophic error: Compiler configuration problem encountered. The expected target architecture compiler is missing (unset != 12.0-ia32)"

runnig ifort -help was ok.



can somebody help me? i need to finish a project quickly...

sincerely
nika
0 Kudos
6 Replies
Steven_L_Intel1
Employee
605 Views
You should never run fortcom directly - an error like that is what you'll get. ifort is what to run.

My guess is that even though you installed version 12 (Composer XE 2011), the VS integration installed is still an earlier version. Try this. Uninstall Fortran. Delete the "Intel Fortran" folder under Microsoft Visual Studio 9.0. Reinstall Fortran.

Can you attach the .vfproj file you're using? Can you run Visual Studio directly, create and build a project?
0 Kudos
nikablatt
Beginner
605 Views
Hi Steve, thanks for your answer, unfortunately it did not help..

I uninstalled fortran, and it uninstalled the intergration and deleted the "Intel Fortran" folder itself. Now i install fortran now again, but just for completeness. I already uninstalled and installed two times without paying attention to the folder.

I think, LAPACK is written in Fortran (not Visual Fortran), anyway there is not any .vfproj file in the source package. If you want to see the package, its here: http://www.netlib.org/lapack/lapack-3.3.0.tgz (6MB, untared 32MB).
0 Kudos
mecej4
Honored Contributor III
605 Views

I think, LAPACK is written in Fortran (not Visual Fortran), anyway there is not any .vfproj file in the source package.

The Netlib sources are in standard Fortran, and are expected to be suitable for compilation on a wide range of platforms. There is no reason to expect a special "Visual Fortran" version. As is typical of most of the software available from Netlib, Lapack is distributed with makefiles with a configurable makefile segment that you can adapt to your platform and compiler and use with the Make program.

A couple of lines are all that you need to change, after which you can move to the source directory and run a "make double" command, etc.

However, given that you do not have much experience building packages, why are you spending time building Lapack even though Intel Fortran comes with MKL, which contains most of Lapack and Blas in library form?

0 Kudos
nikablatt
Beginner
605 Views
Because i did not know that :) I searched for some matrix decomposition functions, lapack was the first i found, and i am used to spend lots of time for installation, so i started installing without further searching.

Right now im installing the MKL - i did not do that first to save disc space. Thanks for your help!


(Just out of curiosity i still woul like to know what causes above errors.)
0 Kudos
mecej4
Honored Contributor III
605 Views
Just out of curiosity i still woul like to know what causes above errors

The instructions for Cmake that you used pertain to an older version of Lapack than the one that is on Netlib now. The more the number of packages (Cmake, VisualStudio, Ifort) involved in building the library, the more the chances of the instructions not working because of unfamiliarity with the packages and mismatched package versions.

The Lapack distribution comes with instructions for building on a Unix-like system. The makefile in the SRC directory assumes that object files have a .o extension, which is not the default for Ifort. The fix is to change the lines in the makefile that give explicit rules to build objects: change "-o $@" to "-Fo$@". The makefile works with GNU Make, but not with MS Nmake -- this requires that you have an installed GNU Make (or compatible). You also need to save a copy of make.inc.example as make.inc, and change it by inserting the compiler command name and options.

With these changes, I type 'make' in the SRC directory (GNU Make is available since I have Cygwin installed) and the lapack library was built using IFort 12.0.0 with no errors. I would have little use for this library given that I have MKL, which provides better-optimized code. However, there are a small number of routines that are present in Lapack that may be missing in MKL (as of six months ago).
0 Kudos
A__Valle
Beginner
605 Views

All,

This error can happen again when updating to version Compiler version 14.0.

Just out of curiosity i still woul like to know what causes above errors

The real error that was present at that time and is present again is that:

The Fortran compiler "C:/Programme/Intel/ComposerXE-2011/bin/ia32/ifort.exe" is not able to compile a simple test program.

Cmake is trying to create a .vfproj file with Version="14.0". The version number that is actually used is Version="11.0"

To resolve this problem, you can rebuild CMake where you adjust the file: cmLocalVisualStudio7Generator.cxx replacing

[cpp]if (intelVersion.find("13") == 0 ||
      intelVersion.find("12") == 0 ||
      intelVersion.find("11") == 0)
    {[/cpp]
with

[cpp]if (intelVersion.find("14") == 0 ||
      intelVersion.find("13") == 0 ||
      intelVersion.find("12") == 0 ||
      intelVersion.find("11") == 0)
    {[/cpp]

Replace the cmake.exe to ensure that the problem is gone.

Dirk

ps. The reason I edited an old post is that the problem can occur again and this is the first post that is found when using a search engine.

0 Kudos
Reply