compiler-errors - 编译示例Scalapack应用程序时出现问题

当我做:

mpif77 example1.f -L scalapack/scalapack-1.8.0/ -lscalapack -L scalapack/blacs/BLACS/LIB -l:blacsF77init_MPI-LINUX-0.a -l:blacs_MPI-LINUX-0.a -l:blacsF77init_MPI-LINUX-0.a -L scalapack/blas/BLAS/ -l:blas_LINUX.a  -L scalapack/lapack/ -llapack -L/cm/shared/apps/gcc/4.4.6/lib64/ -lgfortran

我得到:
scalapack//blas_LINUX.a(xerbla.o): In function `xerbla_':
xerbla.f:(.text+0x66): undefined reference to `_gfortran_transfer_character_write'
xerbla.f:(.text+0x76): undefined reference to `_gfortran_transfer_integer_write'
collect2: ld returned 1 exit status

链接库的顺序可能有所不同吗?

How to Run Example Program Using MPI

最佳答案

链接错误。当对库和可执行文件使用不同的fortran编译器时,通常会出现这些依赖性(f77,f90)。尝试使用mpif90编译您的示例。

您可以使用进行测试:

$ mpif77 --showme
gfortran -I/usr/lib/openmpi/include -pthread -L/usr/lib -L/usr/lib/openmpi/lib -lmpi_f77 -lmpi -ldl -lhwloc
$ mpif90 --showme
gfortran -I/usr/lib/openmpi/include -pthread -L/usr/lib -L/usr/lib/openmpi/lib -lmpi_f90 -lmpi_f77 -lmpi -ldl -lhwloc

唯一的不同是-lmpi_f90

https://stackoverflow.com/questions/27261934/

相关文章:

actionscript-3 - for(const i)而不是(var i)

compiler-errors - 无法解决错误,VHDL,语法错误,但我看不到

maven - 执行失败 : 'control build' & Failed to execute

c# - 抑制ASPX文件的生成错误

c# - 如何从 C# 中的封闭构造类中获取基类对象

android - Android Delphi xe7中的错误

compiler-errors - Latex中缺少\begin {document}

android - 关于主要 Activity : 'illegal start of expres

caching - 如何处理并发Web用户的重置CS-Script

objective-c - 隐式转换为NSIndexPath的错误