找回密码
 注册
查看: 7069|回复: 15

VS2008加入intel Fortran,怎么不能编译李老师的Open-CFD-EC?

[复制链接]
发表于 2013-1-30 21:42:49 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
自己下载了OpenCFD-EC最新版本opecfd-ec2d-1.5.1.在VS2008中安装了Inel Fortran,新建项目--在source files中增加现有项---将opecfd-ec2d-1.5.1中所有文件都加进去。然后编译opencfd_ec2d_v1.1.f90文件,然后就报错了。
1>------ 已启动生成: 项目: opencfd11, 配置: Debug Win32 ------
1>Compiling with Intel(R) Fortran 11.0.061 [IA-32]...
1>sub_convert.f90
1>: remark #5133: The input stream is empty
1>check_mesh.f90
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfd11\opencfd11\check_mesh.f90(37): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: (
1>compilation aborted for C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfd11\opencfd11\check_mesh.f90 (code 1)
1>
1>Build log written to  "file://C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfd11\opencfd11\Debug\BuildLog.htm"
1>opencfd11 - 2 error(s), 0 warning(s)
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========


这是什么错误?需要更换编译器吗?
发表于 2013-2-2 18:12:12 | 显示全部楼层
没用过intel Fortran,不能独立用么?还要加到vs里?
 楼主| 发表于 2013-2-3 07:14:31 | 显示全部楼层

不知道能不能独立运行,实验室里的人反正都是加到VS里弄的,李新亮老师的程序用什么编译器可以通过编译啊,能不能提供一个可靠的下载链接?
发表于 2013-2-3 10:30:54 | 显示全部楼层
你问实验室的人不是更方便。
IF肯定行。
我一般用win下的gcc里的gfortran,这里
http://www.equation.com/servlet/equation.cmd?fa=fortran
 楼主| 发表于 2013-2-3 17:39:48 | 显示全部楼层

回复 4# shirazbj 的帖子

实验室的人也不懂这程序怎么编译....我试试你推荐的,多谢。
发表于 2013-2-4 12:28:36 | 显示全部楼层

这是最简单的fortran编译了

见图
ec.PNG
发表于 2013-2-6 09:57:24 | 显示全部楼层
intel Fortran也可编译,
直接启intel Fortran命令界面,进入程序所在目录,
输入命令:ifort open_ec2d_v1.5.1.f90
就可以了
 楼主| 发表于 2013-2-6 12:59:06 | 显示全部楼层
原帖由 ch06 于 2013-2-6 09:57 发表
intel Fortran也可编译,
直接启intel Fortran命令界面,进入程序所在目录,
输入命令:ifort open_ec2d_v1.5.1.f90
就可以了


哦,我是通过用VS2008来编译fortran文件的,“直接启intel Fortran命令界面”是什么?能具体说说吗?听你的描述貌似像DOS窗口的那种。。。难道intel fortran还能独立运行?
发表于 2013-2-6 14:14:14 | 显示全部楼层
你试试不就知道了?
发表于 2013-2-6 19:46:21 | 显示全部楼层
编译都没过,关编辑器什么事情。
 楼主| 发表于 2013-2-7 06:32:03 | 显示全部楼层
原帖由 shirazbj 于 2013-2-6 14:14 发表
你试试不就知道了?


我的配置是VS2008内嵌安装了Intel Visual Fortran v11.0.061。我的操作步骤为:
1. 新建项目
2. 按照OpenCFD-EC理论手册上,Visual studio 环境下 项目‐> xxx 项目的属性‐> Fortran‐> Command line ‐> 对话框中添加
/Qopenmp(但是不会弄理论手册中下面写的“设置OMP_NUM_THREADS环境变量”...)
360软件小助手截图20130207065217.jpg
3. 在项目中,Source Files中添加项(把opecfd-ec2d-1.5.1文件夹里的文件都添加进去,如下图)
360软件小助手截图20130206140312.jpg
360软件小助手截图20130206140335.jpg
4. 打开opencfd_ec2d_v1.5.1.f90,点击编译按钮。如下图:
360软件小助手截图20130206140355.jpg


但是会报错,如下:

1>------ 已启动生成: 项目: opencfdec, 配置: Debug Win32 ------
1>Compiling with Intel(R) Fortran 11.0.061 [IA-32]...
1>opencfd_ec2d_v1.5.1.f90
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Residual.f90(128): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Residual.f90(140): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(295): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(324): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(163): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(184): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(206): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(226): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(248): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(316): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(329): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(367): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_multigrid.f90(384): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_LU_SGS.f90(26): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_LU_SGS.f90(72): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_BL.f90(37): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SST.f90(36): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SST.f90(51): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SST.f90(126): (col. 8) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SST.f90(183): (col. 8) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SST.f90(195): (col. 8) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SST.f90(251): (col. 8) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SST.f90(34): (col. 7) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SA.f90(24): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SA.f90(42): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SA.f90(76): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SA.f90(86): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SA.f90(117): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SA.f90(128): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_turbulence_SA.f90(40): (col. 7) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Finite_Difference.f90(36): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Finite_Difference.f90(58): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Finite_Difference.f90(86): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Finite_Difference.f90(122): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Finite_Difference.f90(137): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Finite_Difference.f90(35): (col. 7) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Residual.f90(224): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Residual.f90(238): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Residual.f90(352): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Residual.f90(459): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_Residual.f90(222): (col. 7) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(44): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(91): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(114): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(163): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(220): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\sub_NS_singlegrid.f90(250): (col. 7) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
1>C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\opencfd_ec2d_v1.5.1.f90(151): (col. 7) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
1>Linking...
1>opencfd_ec2d_v1.5.1.obj : error LNK2005: _MAIN__ 已经在 mesh-cylinder-1.1.obj 中定义
1>read_flow-1.2.obj : error LNK2005: _UPDATE_COORDINATE_BUFFER 已经在 opencfd_ec2d_v1.5.1.obj 中定义
1>read_flow-1.2.obj : error LNK2005: _INIT 已经在 opencfd_ec2d_v1.5.1.obj 中定义
1>read_flow-1.2.obj : error LNK2005: _MAIN__ 已经在 mesh-cylinder-1.1.obj 中定义
1>Debug\opencfdec.exe : fatal error LNK1169: 找到一个或多个多重定义的符号
1>
1>Build log written to  "file://C:\Users\L538\Documents\Visual Studio 2008\Projects\opencfdec\opencfdec\Debug\BuildLog.htm"
1>opencfdec - 5 error(s), 0 warning(s)
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

[ 本帖最后由 sxhqjfl 于 2013-2-7 06:36 编辑 ]
 楼主| 发表于 2013-2-7 09:03:58 | 显示全部楼层
原帖由 shirazbj 于 2013-2-6 14:14 发表
你试试不就知道了?


不知道怎么试。。。我连FORTRAN的安装位置都不知道了。当时FORTRAN的安装文件就是一个很大的BIN文件
发表于 2013-2-7 13:41:23 | 显示全部楼层
不懂VS2008,openmp
 楼主| 发表于 2013-2-8 10:24:52 | 显示全部楼层
原帖由 shirazbj 于 2013-2-7 13:41 发表
不懂VS2008,openmp


貌似解决了,在看代码的时候,发下同一个函数在不同的文件中都有定义,就觉得出问题了。把“read_flow-1.2.f90” “mesh-cylinder-1.1.f90”移除了解决方案里,然后编译就没问题了。
发表于 2013-2-8 14:25:17 | 显示全部楼层
那两个是辅助程序。独立的。
我在试openmp,编译过去了,但运行很慢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表