找回密码
 注册
查看: 5881|回复: 22

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

[复制链接]
发表于 2008-5-26 21:34:19 | 显示全部楼层 |阅读模式

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

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

x
谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?包括什么软件,怎样安装,安装后怎么设置?我安装了一个Microsoft Visual C++ 2008 Express Edition,也不知道时装错了还是没设置对,用C写的扩展程序怎么也无法编译加载进去,要么出错(但是肯定是对的,别人已经用过),要么没显示出错但是在FLUENT里找不到扩展程序。 :(
有谁在Windows系统下用过FLUENT的UDF吗?如果加载成功应该是什么样子的?
发表于 2008-5-28 01:07:27 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

同问,我昨天搞了一晚上,现在build和load都能通过,但是好像还是不对,出了很多warning,执行结果也不对。
好像说是express的版本是不行的,还是要装完整版的,我就是2008完整版的,3G多啊,笔记本都快占满了。
发表于 2008-5-28 10:45:17 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

OK了,我装了MSVS6.0,完整安装,大概500多M,装的时候只要勾选设置环境变量,然后再装Fluent,装完set envrionment,然后就按照Fluent help文档操作就行了。
唉,整了好几天了,终于可以喘口气了。
发表于 2008-5-28 16:03:20 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

下面引用由plusmoon2008/05/28 10:45am 发表的内容:
OK了,我装了MSVS6.0,完整安装,大概500多M,装的时候只要勾选设置环境变量,然后再装Fluent,装完set envrionment,然后就按照Fluent help文档操作就行了。
唉,整了好几天了,终于可以喘口气了。
赞一个,楼上的真不错
发表于 2008-5-28 16:03:39 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

下面引用由plusmoon2008/05/28 10:45am 发表的内容:
OK了,我装了MSVS6.0,完整安装,大概500多M,装的时候只要勾选设置环境变量,然后再装Fluent,装完set envrionment,然后就按照Fluent help文档操作就行了。
唉,整了好几天了,终于可以喘口气了。
楼上的不错,佩服
 楼主| 发表于 2008-5-28 16:13:56 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

[这个贴子最后由wteagle在 2008/05/28 04:15pm 第 1 次编辑]
下面引用由plusmoon2008/05/28 10:45am 发表的内容:
OK了,我装了MSVS6.0,完整安装,大概500多M,装的时候只要勾选设置环境变量,然后再装Fluent,装完set envrionment,然后就按照Fluent help文档操作就行了。
唉,整了好几天了,终于可以喘口气了。
你真的搞定了?太棒了!能不能详细教我一下,还有你说的按照Fluent help文档操作是些什么操作?你现在那些出了很多warning的程序也能运行了吗?我的也是出了暴多的warning,但是我不相信是程序真的有这么多错[br][br][以下内容由 wteagle 在 2008年05月28日 04:14pm 时添加] [br]
我也是整了有一个星期了!老板已是怒气冲天,再搞不定就要……哇哇哇~~~~~~
发表于 2008-5-28 17:40:13 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

安装msvs6.0最好了。正如plusmoon所述,装的时候只要勾选设置环境变量是非常重要的。
如果没有钩选或其他情况的话,原则上要设置所有可能用到的include,lib,以及cc.exe,cl.exe等等的目录到path环境变量,基本上要抓狂的。[br][br][以下内容由 topshen 在 2008年05月28日 05:44pm 时添加] [br]
对于楼上提到的warning,看看就过去了,一般都不要紧。主要先排除error.
当然如果你的程序很长,就要小心有没有很特别的警告了,用多了自然就了解了。
 楼主| 发表于 2008-5-28 19:35:14 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

msvs6.0在哪里下载啊?我到处找也没找到真正能下的,是不是不是免费软件啊?
发表于 2008-5-28 22:58:55 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

我忘了从哪里下载的了,放在硬盘上很久了,不是MS免费的软件吧。安装时候构选设置环境变量,再在程序菜单里运行Fluent的set environment,然后就没问题了。
后面就是在你存放cas,dat的目录里面建libudf目录,下面建ntx86和src目录,把udf.c放到src里面,在ntx86下建2d或3d目录,拷贝user_nt.udf和makefile进来,然后修改文件。最后开一个command窗口,敲nmake,就好了!现在我的已经没有一个warning了!
祝你早日完工!
 楼主| 发表于 2008-5-29 00:52:16 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

下面引用由plusmoon2008/05/28 10:58pm 发表的内容:
我忘了从哪里下载的了,放在硬盘上很久了,不是MS免费的软件吧。安装时候构选设置环境变量,再在程序菜单里运行Fluent的set environment,然后就没问题了。
后面就是在你存放cas,dat的目录里面建libudf目录,下 ...
太感谢你了!茫茫黑夜中看到一丝曙光…… :)
你说的 msvs6.0 是指 Microsoft Visual Studio C++ 6.0 吧?这是一个付费软件。我在国外,什么都要license license 烦死了!还是国内好啊!我现在想在家里装个FLUENT练练手也没办法,又不敢用BT下,唉……
我还想问两个很菜鸟的问题,莫笑。实在是这本不是我的专业,被老板抓壮丁赶鸭子上架了。
1. “然后修改文件”是什么意思?怎么修改修改什么文件?
2. “最后开一个command窗口,敲nmake”这个command窗口怎么打开?在哪里打开?
谢谢!
 楼主| 发表于 2008-5-29 19:43:01 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

多谢上面的帮助!现在VC++似乎是装上了,有一些简单的UDF也能运行了。但是另外一些在编译中却出现了奇怪的问题,出现了一大堆的错误,细细看来,似乎是编译过程中不认识cell_t,Thread和real。这怎么可能呢?这些不是FLUENT里特有的定义类型吗?难道编译和FLUENT脱节了,编译器还是不认识这些定义类型?这个问题该如何解决呢?高手们请帮帮忙啊!
源程序前面部分:
#include "udf.h"
#define PI M_PI
#define TINY 1.0e-37
extern int offset,num;
extern float *diamAry;
extern  real rhoPartikel,molDiam ;
static real dmaxarg1,dmaxarg2;
#define RMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\
       (dmaxarg1) : (dmaxarg2))
DEFINE_ON_DEMAND(Auswertung)
{
   cell_t c;
   Thread *t;
   face_t f;
   Domain *d;
   d=Get_Domain(1);
   cell_t  c0=-1;
   Thread *t0=NULL;
   real lossesImp,vPx,vPy,vPz,d_p,masse,konz,NV_VEC(A);
   real lossesDiff,friction,B1,B2,B3,kB,diffKoeff,press,T0,nu,p_operating,C;
   real freieWegl,NV_VEC(geschwPartikel),rhoGas,lossesDiffSum,lossesImpSum;
   int  dimension,k,equation,i;
   equation=EQ_UDS+offset;
   dimension=ND_ND;  
等等,后面不用看了,到这里已经错的不行了
编译信息:
Deleted old test-2\ntx86\2ddp\libudf.dll
       1 Datei(en) kopiert.
       1 Datei(en) kopiert.
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf test-2\ntx86\2ddp\makefile")
       1 Datei(en) kopiert.
(chdir "test-2")()
(chdir "ntx86\2ddp")()
auswertungOnDemand.c
..\..\src\auswertungOnDemand.c(21) : error C2275: ';cell_t'; : illegal use of this type as an expression
       C:\Fluent.Inc\fluent6.3.26\src\mem.h(173) : see declaration of ';cell_t';
..\..\src\auswertungOnDemand.c(21) : error C2146: syntax error : missing ';;'; before identifier ';c0';
..\..\src\auswertungOnDemand.c(21) : error C2065: ';c0'; : undeclared identifier
..\..\src\auswertungOnDemand.c(22) : error C2275: ';Thread'; : illegal use of this type as an expression
       C:\Fluent.Inc\fluent6.3.26\src\mem.h(653) : see declaration of ';Thread';
..\..\src\auswertungOnDemand.c(22) : error C2065: ';t0'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2275: ';real'; : illegal use of this type as an expression
       C:\Fluent.Inc\fluent6.3.26\src\global.h(150) : see declaration of ';real';
..\..\src\auswertungOnDemand.c(24) : error C2146: syntax error : missing ';;'; before identifier ';lossesImp';
..\..\src\auswertungOnDemand.c(24) : error C2065: ';lossesImp'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';vPx'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';vPy'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';vPz'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';d_p'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';masse'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';konz'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';A'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2109: subscript requires array or pointer type
..\..\src\auswertungOnDemand.c(25) : error C2275: ';real'; : illegal use of this type as an expression
       C:\Fluent.Inc\fluent6.3.26\src\global.h(150) : see declaration of ';real';
..\..\src\auswertungOnDemand.c(25) : error C2146: syntax error : missing ';;'; before identifier ';lossesDiff';
..\..\src\auswertungOnDemand.c(25) : error C2065: ';lossesDiff'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';friction'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';B1'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';B2'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';B3'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';kB'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';diffKoeff'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';press'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';T0'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';nu'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';p_operating'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';C'; : undeclared identifier
..\..\src\auswertungOnDemand.c(26) : error C2275: ';real'; : illegal use of this type as an expression
       C:\Fluent.Inc\fluent6.3.26\src\global.h(150) : see declaration of ';real';
..\..\src\auswertungOnDemand.c(26) : error C2146: syntax error : missing ';;'; before identifier ';freieWegl';
..\..\src\auswertungOnDemand.c(26) : error C2065: ';freieWegl'; : undeclared identifier
..\..\src\auswertungOnDemand.c(26) : error C2065: ';geschwPartikel'; : undeclared identifier
等等,后面不用看了,前面已经错的不行了
另外顺便问一下,在家里装VC++6.0,装不上,总是快装完的时候跳出尚未安装完成,只有点确定跳出,然后连卸载都卸载不了!而在办公室却能顺利安装上。当然这跟FLUENT没什么关系。不过有谁在装VC的时候碰到并解决过同样问题吗?[br][br][以下内容由 wteagle 在 2008年05月30日 04:11pm 时添加] [br]
已解决!正如下面高手所说的,竟然是代码格式的问题!必须先全部定义完了变量才能进行别的语句。
发表于 2008-5-29 23:24:35 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

[这个贴子最后由kevinxiao在 2008/05/30 00:11am 第 4 次编辑]

不知道楼上几位用的是什么版本的fluent,我刚测试了一下Fluetn6.3.26+XP+VC express 2005, 编译顺利通过,VC express可以免费在微软网站download。
Plusmoon所说的自建libudf以及下属目录好像在Fluent6.1之前的时候是需要的,现在的版本应该不需要了,只要把你的code和case file放在一个目录下就行了,编译之后自动生成libudf目录。
唯一值得注意的一点是编译udf的时候用户需要从VC command window启动Fluent,其它情况下可以直接启动(这些在manual里都有写)。个人感觉windows对code format的要求比较严一些,我原来的code是在linux/unix下写的,格式比较随意,经过一些改动才编译成功。所以大家也先检查一下是不是自己code的问题。
欲善其事,先利其器,wish you all have good compiling enviroments.
 楼主| 发表于 2008-5-30 16:09:38 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

谢谢楼上的回答。不过请问一下,那个VC command window在哪里?我怎么找不到?
另外,真的必须从VC command window启动吗?我没有注意这一点直接点它的图标启动的,然后正常的用compiled...进行编译和加载,似乎也编译成功也加载上了。是不是这样会有什么错误?
发表于 2008-5-30 22:35:29 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

在你的VC启动菜单里面应该能找到那个窗口,其实就是一个DOS console。
如果你能直接启动并且编译成功应该也没有问题,找个简单的例子测试一下结果就知道了。
 楼主| 发表于 2008-5-31 00:20:51 | 显示全部楼层

[求助]谁能详细说明一下怎样在Windows XP下安装FLUENT用的C-Compiler编译器?

是我太笨了吗,为什么就是找不到呢?
在开始——程序里只有Microsoft Visual C++ 6.0自己的图标和Microsoft Visual C++ 6.0 Tools,里面没看到像控制台或DOS的东西。
启动VC++后,最上面的菜单只有File, Edit, View, Insert, Project, Build, Tools, Windows, Help,哪一个下面有command window呢?是叫这个名字吗?
我真急死了。我试过一个简单程序,确实可以,但是还是感觉不保险,万一用大程序出了错自己却还不知道不是死掉了。既然手册上有这么一句,我还是想照着办。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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