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

MPICH installation error with ifort

xiangshanzheshi
Beginner
2,692 Views
Hello, everyone!~
I am trying to install mpich on our cluster using ifort 10. (my cluster is 64 bit with distributed memorty)
i have set enviornmental variables like this:

export F90=/opt/intel/fc/10.0.023/bin/ifort
export FC=F90
export CC=gcc
export CCFLAGS='-ms32'
export CXX=gcc
export F77=F90
export RSHCOMMAND=ssh
LD_LIBRARY_PATH=/opt/intel/fc/10.0.023/lib

This is what i did for the installation:
./configure --with-arch=LINUX --with-device=ch_p4 -disable-short-longs - 2>&1 | tee c.txt
then make,
i got this error message in the end:
About to run installation test for Fortran programs...

** Testing if Fortran77 application can be linked with logging library
/home/yanglei/mpich-1.2.7p1/bin/mpif77 -I/home/yanglei/mpich-1.2.7p1/include -c fpi.f
/home/yanglei/mpich-1.2.7p1/bin/mpif77 -o fpilog fpi.o -L/home/yanglei/mpich-1.2.7p1/lib -lfmpich -llmpe -lmpe -lm
ld: skipping incompatible /home/yanglei/mpich-1.2.7p1/lib/libfmpich.a when searching for -lfmpich
ld: skipping incompatible /home/yanglei/mpich-1.2.7p1/lib/libfmpich.a when searching for -lfmpich
ld: cannot find -lfmpich
make[4]: *** [fpilog] Error 1
** Fortran77 application CANNOT be linked with logging library

** Testing if Fortran77 application can be linked with graphics library
/home/yanglei/mpich-1.2.7p1/bin/mpif77 -I/home/yanglei/mpich-1.2.7p1/include -c fxgraphics.f
/home/yanglei/mpich-1.2.7p1/bin/mpif77 -o fxgraphics fxgraphics.o -L/home/yanglei/mpich-1.2.7p1/lib -lmpe -L/usr/lib64 -lX11 -lm
ld: skipping incompatible /home/yanglei/mpich-1.2.7p1/lib/libmpe.a when searching for -lmpe
ld: skipping incompatible /home/yanglei/mpich-1.2.7p1/lib/libmpe.a when searching for -lmpe
ld: cannot find -lmpe
make[4]: *** [fxgraphics] Error 1
** Fortran77 application CANNOT be linked with graphics library


This was also a warning, i don't know if it is critical and don't know how to change :(

/usr/bin/ld: warning: i386 architecture of input file `/home/yanglei/mpich-1.2.7p1/lib/libmpich.a(initfcmn.o)' is incompatible with i386:x86-64 output

I figure it related to the library stuffs, but have no idea how to fix it.
can anyone throw a light on this?
Thanks very much!
Lei

0 Kudos
5 Replies
TimP
Honored Contributor III
2,692 Views
Quoting - xiangshanzheshi

I am trying to install mpich on our cluster using ifort 10. (my cluster is 64 bit with distributed memorty)
i have set enviornmental variables like this:

export F90=/opt/intel/fc/10.0.023/bin/ifort
export FC=F90
export CC=gcc
export CCFLAGS='-ms32'
export CXX=gcc
export F77=F90
export RSHCOMMAND=ssh
LD_LIBRARY_PATH=/opt/intel/fc/10.0.023/lib


The gcc flag for compatibility with 32-bit ifort is spelled -m32. The name of the gnu C++ compiler is spelled g++. That compiler also would need the -m32 flag.
If you want to use 64-bit g++, you must use 64-bit versions or flags for the other compilers. If you are building your own applications and don't require them to run on 32-bit clusters, you should consider specializing the installation to 64-bit.
If you would rely on the ifortvars script to set your ifort paths, and set F90=ifort .... you would not tie your build to the obsolete version of ifort.
0 Kudos
xiangshanzheshi
Beginner
2,692 Views
Quoting - tim18
The gcc flag for compatibility with 32-bit ifort is spelled -m32. The name of the gnu C++ compiler is spelled g++. That compiler also would need the -m32 flag.
If you want to use 64-bit g++, you must use 64-bit versions or flags for the other compilers. If you are building your own applications and don't require them to run on 32-bit clusters, you should consider specializing the installation to 64-bit.
If you would rely on the ifortvars script to set your ifort paths, and set F90=ifort .... you would not tie your build to the obsolete version of ifort.
HI,
thanks for you response!~
my cluster is 64 bit, so i wanna try to make everything for 64 bit...I tried one more time without -ms32, problem stayed same.
then i tried set CC=g++, it shows f77 and C compiler doesn't match, f77 (ifort) is ELF relocated 32-bit...and c is ..64 bit.
i am sure our ifort is for x86-64 system, so i got confused, what is correct setting in this situation?

Thanks!!


0 Kudos
TimP
Honored Contributor III
2,692 Views
So you want the 64-bit ifort, not the 32-bit one which you are using, according to your first post. In the past versions of ifort, the 64-bit compiler (now called Intel64) was installed by default in the /fce/ directory, not the /fc/ directory which you chose. The ifortvars script under the /fce directory would set up the paths for the 64-bit ifort, compatible with gcc and g++ default 64-bit compilation.
0 Kudos
xiangshanzheshi
Beginner
2,692 Views
Quoting - tim18
So you want the 64-bit ifort, not the 32-bit one which you are using, according to your first post. In the past versions of ifort, the 64-bit compiler (now called Intel64) was installed by default in the /fce/ directory, not the /fc/ directory which you chose. The ifortvars script under the /fce directory would set up the paths for the 64-bit ifort, compatible with gcc and g++ default 64-bit compilation.
HI~~~~
Following your advice, i tried this:
export cc=g++
export fc=/opt/intel/fce/10.0.023/bin/ifort
then i run ./configure
i got this error:

checking how to get verbose linking output from /opt/intel/fce/10.0.023/bin/ifort... -v
checking for Fortran 77 libraries of /opt/intel/fce/10.0.023/bin/ifort... -L/opt/intel/fce/10.0.023/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/ -L/usr/lib64 -lifport -lifcore -limf -lsvml -lm -lipgo -lirc -lirc_s -ldl
checking whether /opt/intel/fce/10.0.023/bin/ifort accepts the FLIBS found by autoconf... yes
checking whether C can link with -L/opt/intel/fce/10.0.023/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/ -L/usr/lib64 -lifport -lifcore -limf -lsvml -lm -lipgo -lirc -lirc_s -ldl... yes
checking for linker for Fortran main programs... Unable to determine how to link Fortran programs with C
checking whether Fortran 77 and C objects are compatible... no
checking for file... file
configure: error: **** Incompatible Fortran and C Object File Types! ****
F77 Object File Type produced by "/opt/intel/fce/10.0.023/bin/ifort -O2" is : : ELF 64-bit LSB relocatable, AMD x86-64, version 1 (GNU/Linux), not stripped.
C Object File Type produced by "g++ -O2" is : : ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), not stripped.


then i switch it back to gcc and add ccflags:

export fc=/opt/intel/fce/10.0.023/bin/ifort
export cc=gc
export cflags='-m64

I got different errors:
it didn't show any error mesages after make and make install, but when i run /opt/mpich2/bin/mpif90 -echo:
it gave:

+ /opt/intel/fce/10.0.023/bin/ifort -I/opt/mpich2/include -I/opt/mpich2/include -L/opt/mpich2/lib -L/opt/mpich2/lib -lmpichf90 -lmpichf90 -lmpich -lopa -lpthread -lrt
/opt/intel/fce/10.0.023/lib/for_main.o: In function `main':
/export/users/nbtester/efi2linuxx86_nightly/branch-10_0/20070427_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x26): undefined reference to `MAIN__'

if i run /opt/mpich2/bin/mpifcc:
+ gcc -m64 -I/opt/mpich2/include -L/opt/mpich2/lib -L/opt/mpich2/lib -lmpich -lopa -lpthread -lrt
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

It seems that the installation still failed.....right?
thanks!
Lei



0 Kudos
TimP
Honored Contributor III
2,692 Views
A config.log should have been left behind showing how it attempted to figure out Fortran to C linkage. You would have to look there to see how it failed. It may also be useful to read the mpich2 instructions and FAQs on this point.
I would have thought you would require
FC=ifort (with PATHs set by sourceing ifortvars)
CC=gcc
CXX=g++
There may be more than one way to get the job done, but unforeseen combinations are likely to lead to trouble.
0 Kudos
Reply