Intel® oneAPI HPC Toolkit
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

mpif90 error while linking

Arun_chandran
Beginner
474 Views

Hi,

 

mpif90 was giving error while executing it as given below.

 

home/arun/intel_mpi/mpi/2021.7.1/bin/mpif90 -DAdd_ -DInt=int -DUInt="unsigned int " -cpp -c a.f -o a.f.o
gfortran: warning: int: linker input file unused because linking not done
gfortran: error: int: linker input file not found: No such file or directory

 

Seems the wrapper compiler has issue in parsing "unsigned int ".

 

The below patch is fixing this issue.

$ cat intelmpi_mpif90_fix.patch
diff --git a/bin/mpif90 b/bin/mpif90
index cf0922a..1cb5fa2 100755
--- a/bin/mpif90
+++ b/bin/mpif90
@@ -550,6 +550,7 @@ for arg in "$@" ; do
;;
-D*)
cppflags="$cppflags $arg"
+ qarg="\"$arg\""
;;
*.F|*.F90|.fpp|.FPP)
# If FCCPP is not empty, then we need to do the following:

 

Could you please comment about it?

 

--Arun

 

0 Kudos
5 Replies
VarshaS_Intel
Moderator
443 Views

Hi,


Thanks for posting in Intel Communities.


Could you please let us know the OS and hardware details you are using?


And also, could you please provide us with the complete sample reproducer code along with the steps to reproduce the issue?


Thanks & Regards,

Varsha


Arun_chandran
Beginner
433 Views

Hi ,

 

The below reproduces the error for me.

 

arun@arun-VirtualBox:~/fortran$ /opt/intel/oneapi/mpi/2021.7.1/bin/mpif90 -DAdd_ -DInt=int -DUInt="unsigned int " -cpp -c a.f90 -o a.f90.o
gfortran: error: int: No such file or directory
arun@arun-VirtualBox:~/fortran$ cat a.f90
program hello
print *, "Hello World!"
end program
arun@arun-VirtualBox:~/fortran$ /opt/intel/oneapi/mpi/2021.7.1/bin/mpif90 -DAdd_ -DInt=int -cpp -c a.f90 -o a.f90.o ----> no error
f951: Warning: Nonexistent include directory _I_MPI_SUBSTITUTE_INSTALLDIR/include/gfortran/9.1.0_ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory _I_MPI_SUBSTITUTE_INSTALLDIR/include_ [-Wmissing-include-dirs]
arun@arun-VirtualBox:~/fortran$

 

--Arun

VarshaS_Intel
Moderator
386 Views

Hi,

 

Could you please try using the 'mpiifort' at the time of compilation, as we are able to get the expected results? Please find the commands:

mpiifort -DAdd_ -DInt=int -DUInt="unsigned int " -cpp -c a.f90 -o a.f90.o
mpiifort a.f90.o -o a -lmpi
mpirun -n 2 ./userhello

 

Please find the below screenshot for more details.

mpiifort.png

Thanks & Regards,

Varsha

 

Arun_chandran
Beginner
376 Views

Yes there is no issue with mpiifort, mpif90 is the problematic one.

VarshaS_Intel
Moderator
317 Views

Hi,


Thanks for reporting the bug.


We were able to reproduce it and we have informed the development team about it.


Thanks & Regards,

Varsha


Reply