报错信息
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/INTEGER(4)).
make[4]: *** [Makefile:1517: mpi_testall_f90.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
mpi_comm_spawn_multiple_f90.f90:36:57:
16 | call MPI_Comm_spawn_multiple(count, array_of_commands, array_of_argv, &
| 2
......
36 | call MPI_Comm_spawn_multiple(count, array_of_commands, array_of_argv, &
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/CHARACTER(*)).
make[4]: *** [Makefile:1517: mpi_comm_spawn_multiple_f90.lo] Error 1
mpi_waitall_f90.f90:18:45:
8 | call MPI_Waitall(count, array_of_requests, array_of_statuses, ierr)
| 2
......
18 | call MPI_Waitall(count, array_of_requests, array_of_statuses, ierr)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/INTEGER(4)).
make[4]: *** [Makefile:1517: mpi_waitall_f90.lo] Error 1
mpi_testsome_f90.f90:26:76:
12 | call MPI_Testsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses, ierr)
| 2
......
26 | call MPI_Testsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses, ierr)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/INTEGER(4)).
解决方式
在configure命令前添加变量,具体configure.sh内容如下:
#!/bin/bash
module purge
module load GCC/13.2.0
export SOURCE_DIR=~/openmpi-1.6.5
export PREFIX_DIR=~/usr/openmpi/1.6.5-20250630-1
export CC=gcc
export CXX=g++
export GC=gfortran
export CFLAGS="-O2 -Wno-error"
export CXXFLAGS="-O2 -Wno-error"
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFFLAGS="-w -fallow-argument-mismatch -O2"
# turn on failure check
set -e
set -o pipefail
../configure \
--prefix=${PREFIX_DIR} \
2>&1 | tee my_configure.log
make -j $(nproc) 2>&1 | tee my_make.log
make check -k 2>&1 | tee my_check.log
make install 2>&1 | tee my_install.log
其中最主要的是FCFLAGS和FFFLAGS两个变量。最终问题解决