【发布时间】:2015-02-16 04:10:46
【问题描述】:
我正在尝试首次在 Windows 中使用 Visual Studio 2010 和 Intel Composer XE 2011 SP1 的试用版,ifort Visual fortran 编译器在 Windows 中编译一个名为 FDMNES 的软件包,用于使用 MPI 进行 X 射线吸收光谱建模与 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 编译它。任何帮助将不胜感激!谢谢。
【问题讨论】:
-
您发布的第一条错误消息表明,虽然编译器找到了 MPI 头文件(否则您将无法通过编译阶段),但您的链接器无法找到实际的 MPI 库。确保您的 MPI 库已正确安装,并且链接器提供了正确的路径。
-
你真的把库添加到项目中了吗?仅仅添加库的路径是不够的,您必须指定它也需要链接到。
标签: visual-studio-2010 compiler-errors mpi windows-7-x64 intel-fortran