找回密码
 注册
查看: 5606|回复: 3

求助:compiled型udf设置问题!~

[复制链接]
发表于 2009-12-16 17:16:56 | 显示全部楼层 |阅读模式

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

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

x
compeled型udf环境变量设置过程按照如下过程处理的:
1) Set up the environmental variable. This is done by going to the start menu > Programs>Fluent> Set_environment clicking this would set the path and variable.
         我的电脑 > 属性 > 高级 > 环境变量
         Verify that the Include, Lib and path variables have been defined.
(1)将自己所安装的VC路径作为include和lib变量的值,如:
include:D:\Program Files\Microsoft Visual Studio .NET\Vc7\include\  
lib:D:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\
(2)找到Microsoft Visual Studio .NET\Vc7\bin\cl.exe的动态链接库mspdb70.dll, 将mspdb70.dll的路径加入到path的值。
  cl.exe is the Microsoft Visual Studio compiler executable and will only be recognized if the environment is set up properly. You will see output similar to what is shown below:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]

2) Set up a directory structure as follows: create a direction libudf in that create "src" and "ntx86". In ntx86 create 3d (assuming that your simulation is 3d).
libudf/src/和libudf/ntx86/3d
3) Copy the udf (.c file) and the required header files (you can get the header files from c:\FLUENT.INC\fluent6.*.*\ntx86\src) files into the "src" folder.
libudf/src/*.c
libudf/src/*.h
4) Go to c:\FLUENT.INC\fluent6.*.*\ntx86\3d copy the contents into the 3d folder which you created.(好像可以不要这一步)
5) Go to c:\FLUENT.INC\fluent6.*.*\ntx86\src copy makefile_nt.udf and user_nt.udf to your 3d folder.
         libudf/ntx86/3d/makefile_nt.udf
         libudf/ntx86/3d/user_nt.udf
6) Rename makefile_nt.edf to makefile and open user_nt.udf and read the instructions and do accordingly.
         libudf/ntx86/3d/makefile
         打开user_nt.udf,根据里面的提示修改user_nt.udf里的内容
7) Close FLUENT(可关可不关). Open cmd.exe (开始 > 运行 > cmd). Type the following C:\ Program Files \ Microsoft Visual Studio .NET\Vc7\bin. Type 执行命令:vcvars32.(这步不能省略)
8) Go to the libudf\ntx86\3d which you have created. Type 命令nmake.
        This will compile your code and build a libudf if you don’t have any errors. If errors are present it will say, so you need to debug it then.
9) Open FLUENT, read case, define->user-defined->functions->complied, tap load. This will load the created libudf.

在第8)步时,nmake不能通过,提示如下:
Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.

用compiled udf编译时有如下提示:

Deleted old libudf\ntx86\2ddp\libudf.dll
已复制         1 个文件。
系统找不到指定的文件。
(system "copy D:\PROGRA~1\Fluent.Inc\fluent6.3.21\src\makefile_nt.udf libudf\ntx86\2ddp\makefile")
已复制         1 个文件。
(chdir "libudf")()
(chdir "ntx86\2ddp")()

请问上述过程问题出在哪里?谢谢
发表于 2009-12-24 19:30:01 | 显示全部楼层
不建议自己手工设置环境变量,
我一般直接在软件安装过程中选上
发表于 2010-7-22 19:08:14 | 显示全部楼层
安装vc平台的时候,把环境变量那个选项勾选就行了。
发表于 2011-7-8 10:38:09 | 显示全部楼层

VC++安装有问题吗?

Deleted old libudf\ntx86\2d\libudf.dll
我调用自己编译的UDF后出现下述信息
已复制         1 个文件。
(system "copy C:\fluent.Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\2d\makefile")
已复制         1 个文件。
(chdir "libudf")()
(chdir "ntx86\2d")()
'nmake' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
'nmake' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

Done.
"c:/documents and settings/administrator"

Opening library "libudf"...
Error: open_udf_library: 系统找不到指定的文件。

Error Object: ()
安装VC++的时候我选择环境变量了啊,还望大家指点一下到底是什么问题?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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