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

libcmt.lib(chkstk.obj) : module machine type 'X86' conflicts with target machine type 'x64'

Pavan_k_
Beginner
1,407 Views

Hi all

My computer is 64 bit . I inistalled fortran in the following order:  1. installed microsoft sdk  2. installed microsoft visual studio 10.(64bit version)
 3. installed fortran compiler 9.1 for 64-bit applications, and 32-bit
 
After that i updated my system variables. 
After that, i open  command window fortran compiler 9.1 for 64-bit applications and typed ifort -o example.exe *.f (to create a exe file example by executing all fortran files of my source code)
Ifort created object files for all my fortran files in my sourcecode. and then at the end it showed the error 
 
libcmt.lib(chkstk.obj) : fatal error lnk1112: module machine type x86 conflicts with target machine type x64.
0 Kudos
12 Replies
mecej4
Honored Contributor III
1,407 Views

Pavan K. wrote:

After that i updated my system variables.

What exactly did you do? Was this step necessary at all? I suspect that the compilation environment is corrupt, possibly as a result of errors in this step.

What is the value of the environment variable LIB in the IFort 9.1 for X64 command window?

0 Kudos
Pavan_k_
Beginner
1,407 Views

thanks for your reply.

i have seen in other collegaue system there is path specified in systemvariables..>path

C:\Program Files (x86)\Intel\Compiler\Fortran\9.1\em64t\bin\ifortvars.bat; 

So i also did this step. As i am installing fortran for first time, i do not know this step necessary or not.

Thanks

0 Kudos
TimP
Honored Contributor III
1,407 Views

According to release notes, ifort 9.1 required VS2005 (professional) so it seems the required Microsoft components of the installation are missing.

0 Kudos
Steven_L_Intel1
Employee
1,407 Views

The error you are getting indicates that you have set the LIB environment variable to include the 32-bit MSVC libraries for your 64-bit configuration. Normally invoking the appropriate ifortvars,bat file (the one in the bin\Intel64 folder (might be called EM64T) will set this correctly for you automatically.

0 Kudos
Pavan_k_
Beginner
1,407 Views

Dear all

my system environment variables

LIB                            : C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib;C:\Program Files (x86)\Microsoft                                      SDKs\Windows\v7.0A\Bin;C:\Program Files (x86)\Intel\Compiler\Fortran\9.1\em64t\bin\ifortvars.bat;

IDB_PATH                   : C:\Program Files (x86)\Intel\

IFORT_COMPILER91  :  C:\Program Files (x86)\Intel\Compiler\Fortran\9.1

INCLUDE                    : %IFORT_COMPILER91%\IA32\Include;%IFORT_COMPILER91%\EM64T\Include

still i have the error. I am extremley confused which one has the problem.

I have one more question. during installation of fortran, 64t installed without any problem and during 32 bit installation it said microsoft visual c++.net 2002 or 2003 is required for installtion for 32bit applications; (please see the attached image). 

I do not have microsoft visual c++.net 2002 installed. In my system visual c++2005 is installed. therefore, i assumed  microsoft visual c++.net 2002 is necessary. Is this really a problem. Please help me .. i am really confused a lot to sort of this problem

Thanks a lot

0 Kudos
mecej4
Honored Contributor III
1,407 Views

The LIB environment variable is definitely corrupted. It should be a concatenation of ...\lib strings, not ...\bin, and the terminal path to the batch file is definitely not supposed to be here. If this happened on my computer, I know things to try, but I am reluctant to tell you to do the same. Instead, try this:

  1. open a command window for VS/VC 64-bit native compilation (I do not know the exact name, but you will find it under Visual Studio or Microsoft Visual Studio or Micrisoft Visual C++ in the Start Menu.
  2. In that window, run the Ifort batch file that Steve referred to in #5.
  3. Try running the Intel Fortran compiler.
0 Kudos
Pavan_k_
Beginner
1,407 Views

I am using command line for running fortran.

i changed 

LIB : C:\Program Files (x86)\Intel\Compiler\Fortran\9.1\IA32\Lib;C:\Program Files (x86)\Intel\Compiler\Fortran\9.1\EM64T\Lib;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A; 

now i get the error 

fatal error LNK1104: cannot open file kernel132.lib

 

0 Kudos
Steven_L_Intel1
Employee
1,407 Views

You need to fix the Microsoft SDKs reference to be the complete path to the Lib folder (and probably Lib\AMD64 in this case.)

0 Kudos
Pavan_k_
Beginner
1,407 Views

Thanks a lot Steve.

I put the complete path for Microsoft SDKs C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64 and it worked.

Now i can run fortran from build environment for fortran EM64T-based applications.

but one more small question :

During 32-bit installation. it said microsoft visual c++.net 2002 or 2003 is required for installtion for 32bit applications; (please see the attached image in this thread ). 

In my control panel...programs,  i can see

Microsoft Visual c++2005  redistibutable x64  

Microsoft Visual c++2008  redistibutable x64 , Microsoft Visual c++2008  redistibutable x86   

Microsoft Visual c++2010  redistibutable x64 , Microsoft Visual c++2010  redistibutable x86   

Microsoft Visual c++2012  redistibutable x64 , Microsoft Visual c++2012  redistibutable x86   

Microsoft Visual c++2013  redistibutable x64 , Microsoft Visual c++2013  redistibutable x86   

Eventhough high versions of  MSVC is installed, still microsoft visual c++.net 2002 is needed to run fortran in  build environment for fortran IA-32 applications.

I want to see both 64 and 32 applicatiosn are working. This will greatly help in understanding fortran much better.

Thanks

-Pavan

0 Kudos
Steven_L_Intel1
Employee
1,407 Views

You have the redistributable libraries installed, not Visual Studio itself.

0 Kudos
mecej4
Honored Contributor III
1,407 Views

When IFort 9.1 was released, the contemporary VC version was probably c++.net 2002. You should not be surprised that the installer does not recognize that you have later versions if VC on your PC -- the installer does not know about the future, nor about versions of VC that were not yet born, etc.

0 Kudos
Reply