是否可以使用 gfortran 和 openmpi 在 Linux 中编译 NASA 并行基准 (NPB) 文件?
Is it possible to compile NASA Parallel Benchmarks (NPB) files in Linux using gfortran and openmpi?
我正在尝试 运行 在我的 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.......
但是我没有使用 Intel 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 是另一种选择,但我想在转向可能的解决方案之前我会问这个问题
在破解它之后,我通过以下修复解决了这个问题,但不确定是什么造成的。
OpenMPI 可能没有正确安装(无法调用 mpicc 或其他 wrappers/comps),要修复它我 运行 以下命令
module avail
#displayed the openmpi-x86_64 module
module add open-x86_64
which mpirun
#displayed location of mpirun
更可能的解决方法是简单地将 make.def 文件中的 gfort运行 更改为 mpif77
我正在尝试 运行 在我的 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.......
但是我没有使用 Intel 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 是另一种选择,但我想在转向可能的解决方案之前我会问这个问题
在破解它之后,我通过以下修复解决了这个问题,但不确定是什么造成的。
OpenMPI 可能没有正确安装(无法调用 mpicc 或其他 wrappers/comps),要修复它我 运行 以下命令
module avail
#displayed the openmpi-x86_64 module
module add open-x86_64
which mpirun
#displayed location of mpirun
更可能的解决方法是简单地将 make.def 文件中的 gfort运行 更改为 mpif77