编译p3dfft驱动程序时未解析的MPI Fortran符号

时间:2017-08-17 20:57:29

标签: c mpi fftw

当我尝试编译驱动程序p3dfft程序时,我收到以下错误。我该怎么做才能避免这个错误?

latish@latish-Aspire-E5-573G:~/btp/p3dfft-2.7.5/sample/C$ mpicc  -g -O2 -lmpi_f90 -o test_sine_c.x driver_sine.o ../../build/libp3dfft.a /usr/local//lib/libfftw3.a   -lgfortran -lmpichf90 -lm
../../build/libp3dfft.a(module.o): In function `ztran_f_same_many':
/home/latish/btp/p3dfft-2.7.5/build/ftran.F90:819: undefined reference to `mpi_abort_'
/home/latish/btp/p3dfft-2.7.5/build/ftran.F90:794: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/ftran.F90:816: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/ftran.F90:803: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/ftran.F90:812: undefined reference to `mpi_wtime_'
../../build/libp3dfft.a(module.o): In function `ztran_b_same_many':
/home/latish/btp/p3dfft-2.7.5/build/btran.F90:300: undefined reference to `mpi_abort_'
/home/latish/btp/p3dfft-2.7.5/build/btran.F90:275: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/btran.F90:297: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/btran.F90:284: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/btran.F90:293: undefined reference to `mpi_wtime_'
../../build/libp3dfft.a(module.o): In function `fcomm2_many':
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:52: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:69: undefined reference to `mpi_alltoallv_'
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:72: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:74: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:79: undefined reference to `mpi_wtime_'
../../build/libp3dfft.a(module.o): In function `fcomm2':
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:213: undefined reference to `mpi_wtime_'
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:256: undefined reference to `mpi_alltoallv_'
/home/latish/btp/p3dfft-2.7.5/build/fcomm2.F90:257: undefined reference to `mpi_wtime_'


collect2: error: ld returned 1 exit status

1 个答案:

答案 0 :(得分:0)

为什么不使用mpifort代替mpicc作为链接器? 你显然是在连接Fortran应用程序。

另一种选择是在-lmpi_f90 libs 之后尝试fftw选项