我正在尝试使用 Visual Studio 2010 和 Intel Composer XE 2011 SP1 的试用版,ifort Visual fortran 编译器与 Intel Parrelel Studio 2011。我已经设法使用 64 位版本的 ifort 编译了所有目标文件,但是在链接文件时我收到以下错误:
1>------ Build started: Project: Console2, Configuration: Release x64 ------
1>Linking...
1>main.obj : error LNK2019: unresolved external symbol MPI_INIT referenced in function MAIN__
1>main.obj : error LNK2019: unresolved external symbol MPI_COMM_SIZE referenced in function MAIN__
1>main.obj : error LNK2019: unresolved external symbol MPI_COMM_RANK referenced in function MAIN__
1>general.obj : error LNK2019: unresolved external symbol MPI_BCAST referenced in function RESEAU
1>potential.obj : error LNK2001: unresolved external symbol MPI_BCAST
1>main.obj : error LNK2001: unresolved external symbol MPI_BCAST
......etc
1>x64\Release\Console2.exe : fatal error LNK1120: 7 unresolved externals
1>
1>Build log written to "file://C:\Users\Arturo\Documents\Visual Studio 2010\Projects\Console2\Console2\x64\Release\BuildLog.htm"
1>Console2 - 18 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我尝试通过添加命令 /L"C:\PathtoMPILibrary\" 链接到 64 位 Intel MPI 库以及 MPICH2 64 位库,但无济于事。我也尝试过使用这个 makefile,使用 mingw32 包中的 gmake 运行:
#Make file for the fdmnes package
objects = main.obj clemf0.obj coabs.obj convolution.obj dirac.obj fdm.obj fprime.obj general.obj hubbard.obj lecture.obj mat.obj metric.obj minim.obj potential.obj scf.obj selec.obj spgroup.obj sphere.obj sub_util.obj tab_data.obj tddft.obj tensor.obj
compiler = mpif90 -O3 -c
fdmnes_mpi : $(objects)
mpif90 -o fdmnes_mpi $(objects)
main.obj : main.f
$(compiler) main.f
clemf0.obj : clemf0.f
$(compiler) clemf0.f
.....etc
但是当我运行 gmake 时,出现以下错误:
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64,
Version 12.1.0.233 Build 20110811
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
ifort: error #10037: could not find 'link'
我已经用尽了论坛,我需要在 64 位窗口下用 MPI 编译它。任何帮助将不胜感激!谢谢。