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

Compiling with mpif90

Greg_R_
Beginner
2,479 Views

Let me start off by says I am not a programmer. I am an SA who installed the Intel suite of compiler. I have a little HelloWorld program that I installed. Do the Intel compilers still use the gfortran that is on the system?

mpif90 -o intel-f90 intel-impi-hello.f90
[ramos@sandy ~]$ ldd intel-f90
        linux-vdso.so.1 =>  (0x00007ffe43da5000)
        libmpifort.so.12 => /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/lib/libmpifort.so.12 (0x00002b6c78821000)
        libmpi.so.12 => /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/lib/libmpi.so.12 (0x00002b6c78bca000)
        libdl.so.2 => /lib64/libdl.so.2 (0x000000353ee00000)
        librt.so.1 => /lib64/librt.so.1 (0x000000353fa00000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000000353f200000)
        libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00002b6c798f6000)
        libm.so.6 => /lib64/libm.so.6 (0x000000353f600000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003541200000)
        libc.so.6 => /lib64/libc.so.6 (0x000000353ea00000)
        /lib64/ld-linux-x86-64.so.2 (0x000000353e600000)
[ramos@sandy ~]$

 

 

0 Kudos
13 Replies
jimdempseyatthecove
Honored Contributor III
2,479 Views

No.

Make sure you source the appropriate ...sh files, then use mpiifort (mpi ifort as one word).

Jim Dempsey

0 Kudos
Greg_R_
Beginner
2,479 Views

source /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/bin/mpivars.sh

 

 

[ramos@sandy ~]$ which mpiifort
/software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/bin/mpiifort
[ramos@sandy ~]$ mpiifort -o intel-impi-helloworld intel-impi-hello.f90
[ramos@sandy ~]$ ldd intel-impi-helloworld
        linux-vdso.so.1 =>  (0x00007fffbbfa1000)
        libmpifort.so.12 => /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/lib/libmpifort.so.12 (0x00002ae492c07000)
        libmpi.so.12 => /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/lib/libmpi.so.12 (0x00002ae492fb0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x000000353ee00000)
        librt.so.1 => /lib64/librt.so.1 (0x000000353fa00000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000000353f200000)
        libm.so.6 => /lib64/libm.so.6 (0x000000353f600000)
        libc.so.6 => /lib64/libc.so.6 (0x000000353ea00000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003541200000)
        /lib64/ld-linux-x86-64.so.2 (0x000000353e600000)
[ramos@sandy ~]$

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,479 Views

In both cases it appears that at least the Intel libraries are used. As for the compiler, you have yet to show the compiler banner as the result of mpiifort-o intel-f90 intel-impi-hello.f90

and

mpif90 -o intel-f90 intel-impi-hello.f90

The source statement you showed is sourcing the MPI system, but not necessarily the compiler selection. This would be done via:

source /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/Linux/bin/compilervars.sh intel64

Due to the fact that "which" located mpiifort it seems to imply that at some point the compilervars was sourced.

Jim Dempsey

0 Kudos
Greg_R_
Beginner
2,479 Views

Thank you for the information. I guess I don't understand the comment regarding the Intel banner. When I use either mpif90 or mpiifort, the program just compiles and returns to the command line, I don't see and banner.

 

Greg

0 Kudos
Greg_R_
Beginner
2,479 Views

I added the 'V' switch:

 

mpiifort -V  -o intel-impi-helloworld intel-impi-hello.f90
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.132 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

 Intel(R) Fortran 17.0-1632
GNU ld version 2.20.51.0.2-5.47.el6_9.1 20100205

 

 

Greg

0 Kudos
Lorri_M_Intel
Employee
2,479 Views

So, is everything OK, once the startup script was sourced, or is there still a problem?

#3 looked OK to me; just want to make sure I didn't miss something

           thanks -

                   --Lorri

0 Kudos
Greg_R_
Beginner
2,479 Views

Hi Lori. I have always been able to compile, my question is in regards to the gfortran library showing up, is that normal?

 

Greg

0 Kudos
TimP
Honored Contributor III
2,479 Views
In the original post you were compiling with gfortran so the corresponding library was linked.
0 Kudos
Greg_R_
Beginner
2,479 Views

No, I was NEVER compiling with gfortran, that is the point of my post. I was using mpiifort and mpif90 to compile. My question was how come the executable shows up with links to gfortran and if that is normal?

 

Greg

0 Kudos
Steve_Lionel
Honored Contributor III
2,479 Views

mpif90 tends to invoke gfortran. The mpixxx commands are just scripts that invoke a particular compiler along with appropriate options for MPI use.

0 Kudos
Greg_R_
Beginner
2,479 Views

OK, thank you. The last examples have used mpiifort and I still see a link to a gcc library.. Is that is what to be expected:

 

ldd intel-impi-helloworld
        linux-vdso.so.1 =>  (0x00007ffd5fdde000)
        libmpifort.so.12 => /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/lib/libmpifort.so.12 (0x00002b49eb5f3000)
        libmpi.so.12 => /software/depot/xe_2017-update-1/compilers_and_libraries_2017.1.132/linux/mpi/intel64/lib/libmpi.so.12 (0x00002b49eb99c000)
        libdl.so.2 => /lib64/libdl.so.2 (0x000000353ee00000)
        librt.so.1 => /lib64/librt.so.1 (0x000000353fa00000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000000353f200000)
        libm.so.6 => /lib64/libm.so.6 (0x000000353f600000)
        libc.so.6 => /lib64/libc.so.6 (0x000000353ea00000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003541200000)
        /lib64/ld-linux-x86-64.so.2 (0x000000353e600000)

 

 

Greg

0 Kudos
Steve_Lionel
Honored Contributor III
2,479 Views

Yes, Intel Fortran uses libgcc.

0 Kudos
Greg_R_
Beginner
2,479 Views

Thank you. All of my questions have been answered.

 

Greg

0 Kudos
Reply