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

MPICH2 install problem

karpen
Beginner
1,402 Views
Hi, I am trying to install and compile MPICH2 v1.2 on my Mac running OS10.5.8, and am running into a problem involving different versions of ifort vs gcc. When I run the script that comes with MPICH2 to compile it with the Intel Fortran compiler, I get the following error message: configure: error: **** Incompatible Fortran and C Object File Types! ****
F77 Object File Type produced by "ifort -O2" is : : Mach-O 64-bit object x86_64.
C Object File Type produced by "gcc -O2" is : : Mach-O object i386.

Apparently the built-in C++ compiler option is for 32-bit machines, but this is a 64-bit machine (Quad-Core Intel Xeon chips). Ifort recognizes this but Apple's gcc does not.

I have a license for Intel Fortran but not for the C++ compiler because I never write code in C++. Can this problem be solved by installing a different version of gcc than is automatically installed with the OS (and is that really a good idea), by somehow changing the gcc compiler options so it will recognize 64-bit applications (ditto), or it the only solution to buy Intel's C++ compiler? Thanks alot for your help!
0 Kudos
1 Solution
Ron_Green
Moderator
1,402 Views
Quoting - karpen
Hi, I am trying to install and compile MPICH2 v1.2 on my Mac running OS10.5.8, and am running into a problem involving different versions of ifort vs gcc. When I run the script that comes with MPICH2 to compile it with the Intel Fortran compiler, I get the following error message: configure: error: **** Incompatible Fortran and C Object File Types! ****
F77 Object File Type produced by "ifort -O2" is : : Mach-O 64-bit object x86_64.
C Object File Type produced by "gcc -O2" is : : Mach-O object i386.

Apparently the built-in C++ compiler option is for 32-bit machines, but this is a 64-bit machine (Quad-Core Intel Xeon chips). Ifort recognizes this but Apple's gcc does not.

I have a license for Intel Fortran but not for the C++ compiler because I never write code in C++. Can this problem be solved by installing a different version of gcc than is automatically installed with the OS (and is that really a good idea), by somehow changing the gcc compiler options so it will recognize 64-bit applications (ditto), or it the only solution to buy Intel's C++ compiler? Thanks alot for your help!

the gcc and g++ compilers take -m64 and -m32 to choose 64bit or 32bit. So use -m64 for CFLAGS and CXXFLAGS when you build mpich2 if you want it to create 64bit binaries.

ron

View solution in original post

0 Kudos
2 Replies
Ron_Green
Moderator
1,403 Views
Quoting - karpen
Hi, I am trying to install and compile MPICH2 v1.2 on my Mac running OS10.5.8, and am running into a problem involving different versions of ifort vs gcc. When I run the script that comes with MPICH2 to compile it with the Intel Fortran compiler, I get the following error message: configure: error: **** Incompatible Fortran and C Object File Types! ****
F77 Object File Type produced by "ifort -O2" is : : Mach-O 64-bit object x86_64.
C Object File Type produced by "gcc -O2" is : : Mach-O object i386.

Apparently the built-in C++ compiler option is for 32-bit machines, but this is a 64-bit machine (Quad-Core Intel Xeon chips). Ifort recognizes this but Apple's gcc does not.

I have a license for Intel Fortran but not for the C++ compiler because I never write code in C++. Can this problem be solved by installing a different version of gcc than is automatically installed with the OS (and is that really a good idea), by somehow changing the gcc compiler options so it will recognize 64-bit applications (ditto), or it the only solution to buy Intel's C++ compiler? Thanks alot for your help!

the gcc and g++ compilers take -m64 and -m32 to choose 64bit or 32bit. So use -m64 for CFLAGS and CXXFLAGS when you build mpich2 if you want it to create 64bit binaries.

ron
0 Kudos
karpen
Beginner
1,402 Views

the gcc and g++ compilers take -m64 and -m32 to choose 64bit or 32bit. So use -m64 for CFLAGS and CXXFLAGS when you build mpich2 if you want it to create 64bit binaries.

ron

Thanks for the help Ron! If I had read the README thoroughly, I would have answered most of my own question. It is not obvious how to implement the above however, so for anyone else in this situation, here is what you have to do: add the options "CFLAGS=-m64 CXXFLAGS=-m64" to the ./configure command mentioned in the install instructions and the README file.
0 Kudos
Reply