【问题标题】:Is it possible to compile NASA Parallel Benchmarks (NPB) files in Linux using gfortran and openmpi?是否可以使用 gfortran 和 openmpi 在 Linux 中编译 NASA Parallel Benchmarks (NPB) 文件?
【发布时间】:2017-05-28 06:46:18
【问题描述】:

我正在尝试在我的 RHEL7.3 安装上运行 NPB 基准测试,但遇到了与此处提出的问题类似的问题

Error while building NAS benchmarks

尝试在 fortran 中制作 BT 基准,我收到以下错误:

cd BT; make NPROCS=16 CLASS=W SUBTYPE= VERSION=
make[1]: Entering directory '/mnt/npb_install/NPB3.3-MPI/BT'
make[2]: Entering directory '/mnt/npb_install/NPB3.3-MPI/sys'
make[2]: Nothing to be done for 'all'
make[2]: Leaving directory '/mnt/npb_install/NPB3.3-MPI/sys'
../sys/setparams bt 16 W
make[2]: Entering directory '/mnt/npb_install/NPB3.3-MPI/BT'
make[3]: Entering directory '/mnt/npb_install/NPB3.3-MPI/BT'
gfortran -O -o ../bin/bt.W.16 bt.o make_set.o initialize.o exact_solution.o exact_rhs.o set_constants.o adi.o define.o copy_faces.o rhs.o solve_subs.o x_solve.o y_solve.o z_solve.o add.o error.o verifiy.o setup_mpi.o ../common/print_results.o ../common/timers.o btio.o -L/usr/lib/openmpi-x84_64/ -lmpi
/bin/ld: cannot find -lmpi
collect2: error: ld returned 1 exit status
make[3]: *** [bt-bt] Error 1
make[3]: Leaving direc.......

但是我没有使用英特尔 MPI,而是使用 OpenMPI,虽然我不完全理解它的含义。

我的 make.def 文件有以下 mpi 相关设置

#-------------------------------------
# This is the fortran compiler usedd for MPI programs
#-----------------------------------------
MPIF77 = gfortran
# This links MPI fortran programs; usually the same as ${MPIF77}
FLINK = ${MPIF77}

#------------------------------------------
# These macros are passed to the linker to help link with MPI correctly
#-------------------------------------------
FMPI_LIB = -L/usr/lib/openmpi/lib/ -lmpi

#-----------------------------------------
# These macros are passed to the compiler to help find 'mpif.h'
#------------------------------------------
FMPI_INC = -I/usr/include/openmpi-x86_64/

与上述问题中发布的类似。

从错误中,我假设输入参数 -lmpi 在编译时不是 gfortran 的有效输入参数,但删除它会导致屏幕充满未定义的引用,例如:

 file.f:(.text+0x123): undefined reference to 'mpi_whatever_'

是否可以用 gfortran 编译 NPB?或者我显然在这里做错了什么? 我已经看到使用 ifort 是另一种选择,但我想在转向可能的解决方案之前我会问这个问题

【问题讨论】:

    标签: linux compiler-errors mpi benchmarking gfortran


    【解决方案1】:

    在破解它之后,我通过以下修复解决了这个问题,但不确定是什么。

    OpenMPI 可能没有正确安装(无法调用 mpicc 或其他包装器/comps),为了修复它我运行了以下命令

    module avail
    #displayed the openmpi-x86_64 module
    module add open-x86_64
    which mpirun
    #displayed location of mpirun
    

    更可能的解决方法是将 make.def 文件中的 gfortran 更改为 mpif77

    【讨论】:

      猜你喜欢
      • 2019-06-13
      • 2012-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-04
      • 2010-12-03
      • 2021-10-27
      • 1970-01-01
      相关资源
      最近更新 更多