|
[Sponsors] |
November 11, 2003, 11:58 |
coment lines in UDF
|
#1 |
Guest
Posts: n/a
|
Hi, all,
I have many coment lines in my UDFs, leading with double slash. I had no problem when interpret the UDFs, but when trying compiling them, I had errors caused by the double-slash comments. I have to bracket them with /* (slash-star) and */ (star-slash). How come to this? I am running FLUENT on linux which has gcc compiler which recognise both types of comments. I saw from FLUENT console that it invokes the preprocessor /usr/bin/cpp to interpret a UDF and use /usr/bin/cc (symbolic link to gcc on linux) to compile it. But so what? I tested compiling a C source which has double-slash comments from command line, and it works fine. Therefore, there might be either: 1) the makefile Fluent creates has some special option to turn of the double-slash comment support; 2) Fluent first preprocesses the UDF somehow without support for double-slash comments, before the system gcc takes over the job. I am looking at the makefile for a clue, but even I find the reason, how can I get over it? Does FLUENT store a template for the makefile in plain text somewhere? I hope someone can put up a suggestion, other than bracketing every comment with /* and */. Because I am used to use this kind of comments to comment out some block of code and in the block double-slash comments may exist. Thanks, jx |
|
November 11, 2003, 12:55 |
Re: coment lines in UDF
|
#2 |
Guest
Posts: n/a
|
Arha, caught the one.
It is because the make file created by FLUENT has a compiler flag "-ansi" which turns off the double-slashed comment support. And fortunately, I found the template for the makefile is $FLUENT_INC/fluent6.1/src/makefile.udf (another file, $FLUENT_INC/fluent6.1/realgas/src/Makefile, also switches on option "-ansi" for gcc). However, removing the option or change it to something like "-std=gnu89", "-std=c99", etc, does not make peace, I got a parse error in compiling /usr/include/math.h. Sigh! I am fed up with this sort of things. Maybe I should remove all comments in my UDFs? |
|
November 21, 2003, 13:03 |
Re: coment lines in UDF
|
#3 |
Guest
Posts: n/a
|
Thanks for sharing this information. ==> Mahesh
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Tutorials] Tutorial of how to plot residuals ! | wolle1982 | OpenFOAM Community Contributions | 171 | February 20, 2024 03:55 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
Plotting Residuals | ata | OpenFOAM | 12 | July 8, 2011 03:50 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |